flipside 0.3.1 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -1
- data/lib/flipside/feature_presenter.rb +10 -0
- data/lib/flipside/version.rb +1 -1
- data/lib/flipside/views/_toggle_button.erb +1 -3
- data/lib/flipside/views/show.erb +8 -2
- data/lib/flipside/web.rb +5 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c535d4251e9119b215ca601c3d1a59c595d6554edb8fe5bb85438dea02d215e2
|
4
|
+
data.tar.gz: de524dc5a8def73cf07b62d311594bad9069857ebbe0ab8f3277d40132a1ebfe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 10f6b91375dd7562188a129206d49da15d0e2fd91753369d78e2cd988d672b706ef69d0a366c3e41a433aa24ed816250c1af70e59f12e5d90aabff3c4e7eee4d
|
7
|
+
data.tar.gz: bd9fb2f1bc985759de41ab08c4c5878c8820ae458ba66782719400825d504175ab91f5eec130c0e2d97f025467df3c7b067199a0740f02e045e75dcac77d25d2
|
data/CHANGELOG.md
CHANGED
@@ -28,6 +28,16 @@ class FeaturePresenter
|
|
28
28
|
end
|
29
29
|
end
|
30
30
|
|
31
|
+
def switch_color
|
32
|
+
return "bg-blue-700" if feature.enabled
|
33
|
+
|
34
|
+
if (feature.entities.count + feature.roles.count) > 0
|
35
|
+
"bg-blue-300"
|
36
|
+
else
|
37
|
+
"bg-gray-200"
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
31
41
|
def activated_at
|
32
42
|
feature.activated_at&.strftime("%Y-%m-%d %H:%M")
|
33
43
|
end
|
data/lib/flipside/version.rb
CHANGED
@@ -1,11 +1,9 @@
|
|
1
|
-
<% color = feature.enabled ? "bg-blue-700" : "bg-gray-200" %>
|
2
1
|
<% translate = feature.enabled ? "translate-x-5" : "translate-x-0" %>
|
3
|
-
<%# FIXME: How to prevent clicking the submit button from propageting? E.g. link navigation on index page. %>
|
4
2
|
|
5
3
|
<form action="<%= feature_path(feature, "toggle") %>" method="post">
|
6
4
|
<input type="hidden" name="_method" value="put" />
|
7
5
|
<button type="submit"
|
8
|
-
class="relative inline-flex h-6 w-11 shrink-0 cursor-pointer rounded-full border-2 border-transparent <%=
|
6
|
+
class="relative inline-flex h-6 w-11 shrink-0 cursor-pointer rounded-full border-2 border-transparent <%= feature.switch_color %>"
|
9
7
|
>
|
10
8
|
<span aria-hidden="true" class="pointer-events-none inline-block size-5 <%= translate %> transform rounded-full bg-white shadow"></span>
|
11
9
|
</button>
|
data/lib/flipside/views/show.erb
CHANGED
@@ -7,13 +7,19 @@
|
|
7
7
|
<div class="mt-2 flex justify-between items-center">
|
8
8
|
<span class="font-semibold">Name:</span>
|
9
9
|
<span class="font-bold text-lg text-slate-300"><%= feature.name %></span>
|
10
|
+
<span>
|
11
|
+
<form action="<%= feature_path(feature) %>" method="post" onsubmit="return confirm('Are you sure you want to delete this feature?')">
|
12
|
+
<input type="hidden" name="_method" value="delete" />
|
13
|
+
<button type="submit" class="px-2 py-1 rounded-lg bg-amber-800 text-xl text-slate-400 border border-amber-950 hover:bg-amber-900">Delete</button>
|
14
|
+
</form>
|
15
|
+
</span>
|
10
16
|
</div>
|
11
17
|
<div class="mt-2 flex justify-between items-center text-center" data-controller="inline-edit">
|
12
18
|
<div class="font-semibold">Description:</div>
|
13
|
-
<div data-inline-edit-target="read"><%= feature.description %></div>
|
19
|
+
<div class="-ml-6" data-inline-edit-target="read"><%= feature.description %></div>
|
14
20
|
<div class="ml-2 " data-inline-edit-target="read">
|
15
21
|
<button
|
16
|
-
class="px-
|
22
|
+
class="px-5 py-1 rounded-lg bg-blue-900 text-xl text-slate-400 border border-blue-950 hover:bg-blue-800"
|
17
23
|
data-action="inline-edit#edit" >
|
18
24
|
Edit
|
19
25
|
</button>
|
data/lib/flipside/web.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: flipside
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sammy Henningsson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-05-
|
11
|
+
date: 2025-05-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|