quick_admin 0.1.5 → 0.1.7
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/app/assets/stylesheets/quick_admin/application.css +12 -2
- data/app/helpers/quick_admin/application_helper.rb +16 -4
- data/app/views/layouts/quick_admin/application.html.erb +4 -4
- data/app/views/quick_admin/resources/_form.html.erb +3 -1
- data/app/views/quick_admin/resources/_resource_row.html.erb +5 -3
- data/app/views/quick_admin/resources/show.html.erb +3 -2
- data/lib/quick_admin/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f5ccce0d8b771909d9fa6ebc569572c4c0fe9ac8e0224a1b42b07037315cd906
|
|
4
|
+
data.tar.gz: 4e278527a52d3f624c7ea56b9dc5ee405b6f908c2eb0b9aa6d54752445553be8
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3798f45da60ce5ac20b420e1cc3981fe5a4a488378534de162d48054f3f51a937fea2bbb56010f016b0c3dc064422c9eff95a527c388e8b5ee8004167eab89e7
|
|
7
|
+
data.tar.gz: 709d9d50121ac45c3038315ec46a7dc247957b215f1a3d46308fee98659391c292919caebb49740acf1611d4566ee9ea33fff8d7676b067bd72b5e3fe99560c9
|
|
@@ -110,15 +110,25 @@ body {
|
|
|
110
110
|
white-space: nowrap;
|
|
111
111
|
}
|
|
112
112
|
|
|
113
|
-
.sign-out-
|
|
113
|
+
.sign-out-form {
|
|
114
|
+
margin: 0;
|
|
115
|
+
padding: 0;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.sign-out-btn {
|
|
119
|
+
background: none;
|
|
120
|
+
border: none;
|
|
114
121
|
color: rgba(255,255,255,0.8);
|
|
115
122
|
text-decoration: none;
|
|
116
123
|
padding: 0.5rem 0;
|
|
117
124
|
display: block;
|
|
118
125
|
font-size: 0.9rem;
|
|
126
|
+
cursor: pointer;
|
|
127
|
+
width: 100%;
|
|
128
|
+
text-align: left;
|
|
119
129
|
}
|
|
120
130
|
|
|
121
|
-
.sign-out-
|
|
131
|
+
.sign-out-btn:hover {
|
|
122
132
|
color: var(--danger-color);
|
|
123
133
|
}
|
|
124
134
|
|
|
@@ -227,11 +227,23 @@ module QuickAdmin
|
|
|
227
227
|
# Returns the sign out path if available.
|
|
228
228
|
# @return [String, nil] the sign out path or nil
|
|
229
229
|
def quick_admin_sign_out_path
|
|
230
|
-
|
|
231
|
-
|
|
230
|
+
# First check explicit configuration
|
|
231
|
+
configured_path = QuickAdmin.config.sign_out_path
|
|
232
|
+
return configured_path if configured_path.present?
|
|
232
233
|
|
|
233
|
-
#
|
|
234
|
-
|
|
234
|
+
# Try to use Rails route helpers (more reliable than string paths)
|
|
235
|
+
if defined?(Devise)
|
|
236
|
+
begin
|
|
237
|
+
# Try destroy_admin_session_path first
|
|
238
|
+
return main_app.destroy_admin_session_path if main_app.respond_to?(:destroy_admin_session_path)
|
|
239
|
+
# Fall back to destroy_user_session_path
|
|
240
|
+
return main_app.destroy_user_session_path if main_app.respond_to?(:destroy_user_session_path)
|
|
241
|
+
rescue => e
|
|
242
|
+
Rails.logger.debug "QuickAdmin: Could not resolve sign out path: #{e.message}"
|
|
243
|
+
end
|
|
244
|
+
end
|
|
245
|
+
|
|
246
|
+
nil
|
|
235
247
|
end
|
|
236
248
|
end
|
|
237
249
|
end
|
|
@@ -32,10 +32,10 @@
|
|
|
32
32
|
</div>
|
|
33
33
|
<% end %>
|
|
34
34
|
<% if quick_admin_sign_out_path %>
|
|
35
|
-
<%=
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
35
|
+
<%= button_to "Sign Out", quick_admin_sign_out_path,
|
|
36
|
+
method: QuickAdmin.config.sign_out_method,
|
|
37
|
+
class: "sign-out-btn",
|
|
38
|
+
form_class: "sign-out-form" %>
|
|
39
39
|
<% end %>
|
|
40
40
|
</div>
|
|
41
41
|
</nav>
|
|
@@ -3,10 +3,12 @@
|
|
|
3
3
|
resource_name_param = defined?(resource_name) ? resource_name : @resource_config.model_name
|
|
4
4
|
# Get the correct param value for URLs (uses configured find_by_field)
|
|
5
5
|
param_value = resource_param_value(resource)
|
|
6
|
+
# Preserve current page for after save
|
|
7
|
+
current_page = params[:page] || 1
|
|
6
8
|
%>
|
|
7
9
|
|
|
8
10
|
<%= form_with model: [QuickAdmin::Engine, resource_name_param.singularize.to_sym, resource],
|
|
9
|
-
url: resource.persisted? ? quick_admin.resource_path(resource_name_param, param_value) : quick_admin.resources_path(resource_name_param),
|
|
11
|
+
url: resource.persisted? ? quick_admin.resource_path(resource_name_param, param_value, page: current_page) : quick_admin.resources_path(resource_name_param, page: current_page),
|
|
10
12
|
method: resource.persisted? ? :patch : :post,
|
|
11
13
|
local: false,
|
|
12
14
|
class: "resource-form" do |form| %>
|
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
resource_name_param = defined?(resource_name) ? resource_name : params[:resource_name]
|
|
4
4
|
# Get the correct param value for URLs (uses configured find_by_field)
|
|
5
5
|
param_value = resource_param_value(resource)
|
|
6
|
+
# Preserve current page
|
|
7
|
+
current_page = params[:page] || 1
|
|
6
8
|
%>
|
|
7
9
|
|
|
8
10
|
<tr class="resource-row" id="resource_<%= resource.id %>">
|
|
@@ -16,13 +18,13 @@
|
|
|
16
18
|
</td>
|
|
17
19
|
<% end %>
|
|
18
20
|
<td class="actions">
|
|
19
|
-
<%= link_to "View", quick_admin.resource_path(resource_name_param, param_value),
|
|
21
|
+
<%= link_to "View", quick_admin.resource_path(resource_name_param, param_value, page: current_page),
|
|
20
22
|
class: "btn btn-sm btn-info",
|
|
21
23
|
data: { turbo_frame: "modal" } %>
|
|
22
|
-
<%= link_to "Edit", quick_admin.edit_resource_path(resource_name_param, param_value),
|
|
24
|
+
<%= link_to "Edit", quick_admin.edit_resource_path(resource_name_param, param_value, page: current_page),
|
|
23
25
|
class: "btn btn-sm btn-warning",
|
|
24
26
|
data: { turbo_frame: "modal" } %>
|
|
25
|
-
<%= link_to "Delete", quick_admin.resource_path(resource_name_param, param_value),
|
|
27
|
+
<%= link_to "Delete", quick_admin.resource_path(resource_name_param, param_value, page: current_page),
|
|
26
28
|
class: "btn btn-sm btn-danger",
|
|
27
29
|
data: {
|
|
28
30
|
turbo_method: :delete,
|
|
@@ -20,10 +20,11 @@
|
|
|
20
20
|
|
|
21
21
|
<div class="detail-actions">
|
|
22
22
|
<% param_value = resource_param_value(@resource) %>
|
|
23
|
-
|
|
23
|
+
<% current_page = params[:page] || 1 %>
|
|
24
|
+
<%= link_to "Edit", quick_admin.edit_resource_path(resource_name, param_value, page: current_page),
|
|
24
25
|
class: "btn btn-warning",
|
|
25
26
|
data: { turbo_frame: "modal" } %>
|
|
26
|
-
<%= button_to "Delete", quick_admin.resource_path(resource_name, param_value),
|
|
27
|
+
<%= button_to "Delete", quick_admin.resource_path(resource_name, param_value, page: current_page),
|
|
27
28
|
method: :delete,
|
|
28
29
|
class: "btn btn-danger",
|
|
29
30
|
form_class: "inline-form",
|
data/lib/quick_admin/version.rb
CHANGED