slash_admin 1.5.7 → 1.5.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/stylesheets/slash_admin/application.scss +10 -0
- data/app/controllers/slash_admin/models_controller.rb +9 -5
- data/app/views/slash_admin/base/_data_list.html.erb +14 -3
- data/app/views/slash_admin/shared/_menu.html.erb +6 -6
- data/config/locales/en.yml +1 -1
- data/config/locales/fr.yml +1 -1
- data/lib/slash_admin/version.rb +1 -1
- metadata +12 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3f37650357b94f30b5d5ec38a6727a2acd36ee415bdccc9677b88edeaee134d8
|
4
|
+
data.tar.gz: 175e7a5bdaff7f68148cce13ea8e4c11c079770a603f235e09f0e6bd98c82fa2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 287c7ca4f35a1611e4e462ea510d6214146f25f1095508e449a4bc92dd4aa0a5187f7f722b4790f0dc543b2a59b0c9c7d518eb6458c08b7941aba4ec301f3de2
|
7
|
+
data.tar.gz: e95d407901935798cf5ce90b5b88d99c96abb2e739d4ac6e29583dbb0e7b8b863523f32bf38528407cda973c411df2b05661fe40e59c97377005b87eb96821f5
|
@@ -11,7 +11,7 @@ module SlashAdmin
|
|
11
11
|
before_action :handle_default_params
|
12
12
|
before_action :handle_associations
|
13
13
|
|
14
|
-
helper_method :list_params, :export_params, :create_params, :update_params, :show_params, :nested_params, :should_add_translatable?, :translatable_params, :available_locales, :tooltips, :no_title
|
14
|
+
helper_method :list_params, :export_params, :create_params, :update_params, :show_params, :nested_params, :should_add_translatable?, :translatable_params, :available_locales, :tooltips, :no_title, :icons
|
15
15
|
|
16
16
|
def index
|
17
17
|
authorize! :index, @model_class
|
@@ -161,6 +161,10 @@ module SlashAdmin
|
|
161
161
|
[]
|
162
162
|
end
|
163
163
|
|
164
|
+
def icons
|
165
|
+
{}
|
166
|
+
end
|
167
|
+
|
164
168
|
def handle_has_one
|
165
169
|
@has_one = {}
|
166
170
|
Array.wrap(update_params + create_params).uniq.each do |p|
|
@@ -218,7 +222,7 @@ module SlashAdmin
|
|
218
222
|
|
219
223
|
flash[:success] = t("slash_admin.controller.nestable.success")
|
220
224
|
|
221
|
-
redirect_to(main_app.polymorphic_url([
|
225
|
+
redirect_to(main_app.polymorphic_url([:slash_admin, @model_class])) && return if params.key?(:submit_redirect)
|
222
226
|
redirect_to main_app.polymorphic_url([:nestable, :slash_admin, @model_class])
|
223
227
|
end
|
224
228
|
end
|
@@ -346,9 +350,9 @@ module SlashAdmin
|
|
346
350
|
end
|
347
351
|
|
348
352
|
def handle_redirect_after_submit
|
349
|
-
path = main_app.edit_polymorphic_url([
|
350
|
-
path = main_app.polymorphic_url([
|
351
|
-
path = main_app.new_polymorphic_url([
|
353
|
+
path = main_app.edit_polymorphic_url([:slash_admin, @model])
|
354
|
+
path = main_app.polymorphic_url([:slash_admin, @model_class]) if params.key?(:submit_redirect)
|
355
|
+
path = main_app.new_polymorphic_url([:slash_admin, @model_class]) if params.key?(:submit_add)
|
352
356
|
|
353
357
|
path
|
354
358
|
end
|
@@ -101,15 +101,26 @@
|
|
101
101
|
<% elsif @has_many_fields.include?(attr) %>
|
102
102
|
<td class="<%= attr.to_s.parameterize.underscore.downcase %>">
|
103
103
|
<button type="button" class="btn btn-sm btn-primary" data-toggle="modal" data-target="#modal-see-assoc-<%= attr.to_s %>-<%= m.id %>"
|
104
|
-
data-toggle="tooltip" data-placement="top" title="<%= t("slash_admin.view.
|
104
|
+
data-toggle="tooltip" data-placement="top" title="<%= t("slash_admin.view.see_model_of", model: attr.to_s.pluralize, of: m.name) %>"
|
105
105
|
>
|
106
|
-
<
|
106
|
+
<span class="list-icon">
|
107
|
+
<i class="fas fa-ellipsis-v"></i>
|
108
|
+
<% if icons.key? attr %>
|
109
|
+
<%= raw icons[attr.to_sym] %>
|
110
|
+
<% else %>
|
111
|
+
<%= attr.to_s.first.upcase %>
|
112
|
+
<% end %>
|
113
|
+
</span>
|
107
114
|
</button>
|
108
115
|
<div class="modal fade" id="modal-see-assoc-<%= attr.to_s %>-<%= m.id %>" tabindex="-1" role="dialog" aria-labelledby="modal" aria-hidden="true">
|
109
116
|
<div class="modal-dialog" role="document">
|
110
117
|
<div class="modal-content">
|
111
118
|
<div class="modal-header">
|
112
|
-
<h5 class="modal-title" id="exampleModalLabel"
|
119
|
+
<h5 class="modal-title" id="exampleModalLabel">
|
120
|
+
<% if icons.key? attr %>
|
121
|
+
<%= raw icons[attr.to_sym] %>
|
122
|
+
<% end %>
|
123
|
+
<%= t("model.#{attr}") %>
|
113
124
|
<strong>(<%= m.send(attr).length %>)</strong></h5>
|
114
125
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
115
126
|
<span aria-hidden="true">×</span>
|
@@ -22,11 +22,11 @@
|
|
22
22
|
<div class="sub-menu">
|
23
23
|
<table class="table-sm">
|
24
24
|
<tbody>
|
25
|
-
<% s[:sub_menu].
|
25
|
+
<% s[:sub_menu].each_with_index do |sub, idx| %>
|
26
26
|
<% if sub[:path].present? %>
|
27
|
-
<tr class="clickable-row <%= request.fullpath == sub[:path] ? 'active' : '' %>"
|
28
|
-
|
29
|
-
|
27
|
+
<tr class="clickable-row <%= request.fullpath == sub[:path] ? 'active' : '' %> <%= s.dig(:sub_menu, idx + 1, :layout) == 'divider' ? 'menu-divider-below' : '' %>"
|
28
|
+
data-href="<%= sub[:path] %>"
|
29
|
+
data-blank="<%= s[:blank].present? ? 'true' : 'false' %>">
|
30
30
|
<td>
|
31
31
|
<a href="<%= sub[:path] %>" class="<%= request.fullpath == sub[:path] ? 'active' : '' %>" target="<%= s[:blank].present? ? '_blank' : '_self' %>">
|
32
32
|
<% if sub[:icon] %>
|
@@ -41,8 +41,8 @@
|
|
41
41
|
</td>
|
42
42
|
</tr>
|
43
43
|
<% else %>
|
44
|
-
<% if access_model?(sub) %>
|
45
|
-
<tr class="clickable-row <%= controller.controller_name == sub[:model].name.split('::').last.tableize ? 'active' : '' %>"
|
44
|
+
<% if access_model?(sub) && sub[:layout].blank? %>
|
45
|
+
<tr class="clickable-row <%= controller.controller_name == sub[:model].name.split('::').last.tableize ? 'active' : '' %> <%= s.dig(:sub_menu, idx + 1, :layout) == 'divider' ? 'menu-divider-below' : '' %>"
|
46
46
|
data-href="<%= polymorphic_url([:slash_admin, sub[:model]]) %>"
|
47
47
|
data-blank="<%= s[:blank].present? ? 'true' : 'false' %>">
|
48
48
|
<td>
|
data/config/locales/en.yml
CHANGED
data/config/locales/fr.yml
CHANGED
data/lib/slash_admin/version.rb
CHANGED
metadata
CHANGED
@@ -1,29 +1,35 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: slash_admin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.5.
|
4
|
+
version: 1.5.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- KOVACS Nicolas
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-12-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '6.1'
|
20
|
+
- - "<"
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: '7.1'
|
20
23
|
type: :runtime
|
21
24
|
prerelease: false
|
22
25
|
version_requirements: !ruby/object:Gem::Requirement
|
23
26
|
requirements:
|
24
|
-
- - "
|
27
|
+
- - ">="
|
25
28
|
- !ruby/object:Gem::Version
|
26
29
|
version: '6.1'
|
30
|
+
- - "<"
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '7.1'
|
27
33
|
- !ruby/object:Gem::Dependency
|
28
34
|
name: http_accept_language
|
29
35
|
requirement: !ruby/object:Gem::Requirement
|
@@ -450,14 +456,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
450
456
|
requirements:
|
451
457
|
- - ">="
|
452
458
|
- !ruby/object:Gem::Version
|
453
|
-
version: 2.
|
459
|
+
version: 2.7.0
|
454
460
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
455
461
|
requirements:
|
456
462
|
- - ">="
|
457
463
|
- !ruby/object:Gem::Version
|
458
464
|
version: '0'
|
459
465
|
requirements: []
|
460
|
-
rubygems_version: 3.2.
|
466
|
+
rubygems_version: 3.2.26
|
461
467
|
signing_key:
|
462
468
|
specification_version: 4
|
463
469
|
summary: A modern and overridable admin gem, just the rails way.
|