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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 905087476b4fe1a2cefd7cba21a3214fcf4834cb4fed1f1c5ccf00570fb246af
4
- data.tar.gz: 5d29e7eb6d2ee39960526c5a85f033b34aa7549c3b38e53db84d137778ac1993
3
+ metadata.gz: 3f37650357b94f30b5d5ec38a6727a2acd36ee415bdccc9677b88edeaee134d8
4
+ data.tar.gz: 175e7a5bdaff7f68148cce13ea8e4c11c079770a603f235e09f0e6bd98c82fa2
5
5
  SHA512:
6
- metadata.gz: 0aafd6dfba8ff8d7a46059b7a37380d8ef8b16df1b5fa6b7659942259ea99f0114e2f6e855857a92b7f50b4cea5763c6aec1a7a6913cf5fbb763e7e8ed0ca801
7
- data.tar.gz: 32ef3759aa3558806282585bc470fbbcaf9dacdc9677a6710d0b96554c87f208380ba45b6335b0a68f89937dd68e99df4bd5d600ffc910378d47f7452b5470e3
6
+ metadata.gz: 287c7ca4f35a1611e4e462ea510d6214146f25f1095508e449a4bc92dd4aa0a5187f7f722b4790f0dc543b2a59b0c9c7d518eb6458c08b7941aba4ec301f3de2
7
+ data.tar.gz: e95d407901935798cf5ce90b5b88d99c96abb2e739d4ac6e29583dbb0e7b8b863523f32bf38528407cda973c411df2b05661fe40e59c97377005b87eb96821f5
@@ -1493,3 +1493,13 @@ p[data-f-id="pbf"] {
1493
1493
  }
1494
1494
  }
1495
1495
  }
1496
+
1497
+ .list-icon {
1498
+ font-weight: 900;
1499
+ display: flex;
1500
+ align-items: center;
1501
+ }
1502
+
1503
+ .menu-divider-below {
1504
+ border-bottom: #e3e9fc 1px solid;
1505
+ }
@@ -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(["slash_admin", @model_class])) && return if params.key?(:submit_redirect)
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(["slash_admin", @model])
350
- path = main_app.polymorphic_url(["slash_admin", @model_class]) if params.key?(:submit_redirect)
351
- path = main_app.new_polymorphic_url(["slash_admin", @model_class]) if params.key?(:submit_add)
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.see_model", model: attr.to_s.pluralize) %>"
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
- <i class="fa fa-list"></i>
106
+ <span class="list-icon">
107
+ <i class="fas fa-ellipsis-v"></i>
108
+ <% if icons.key? attr %>
109
+ &nbsp;<%= raw icons[attr.to_sym] %>
110
+ <% else %>
111
+ &nbsp;<%= 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"><%= t('slash_admin.view.associations') %>
119
+ <h5 class="modal-title" id="exampleModalLabel">
120
+ <% if icons.key? attr %>
121
+ <%= raw icons[attr.to_sym] %>&nbsp;
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">&times;</span>
@@ -22,11 +22,11 @@
22
22
  <div class="sub-menu">
23
23
  <table class="table-sm">
24
24
  <tbody>
25
- <% s[:sub_menu].each do |sub| %>
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
- data-href="<%= sub[:path] %>"
29
- data-blank="<%= s[:blank].present? ? 'true' : 'false' %>">
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>
@@ -26,7 +26,7 @@ en:
26
26
  save: Save
27
27
  delete: Delete
28
28
  new: New
29
- see_model: "View the %{model}"
29
+ see_model_of: "View the %{model} of %{of}"
30
30
  edit: "Edit: %{model_name}"
31
31
  show: "Show: %{model_name}"
32
32
  tools: Tools
@@ -29,7 +29,7 @@ fr:
29
29
  edit: "Édition: %{model_name}"
30
30
  show: "Affichage: %{model_name}"
31
31
  see: Voir
32
- see_model: "Voir les %{model}"
32
+ see_model_of: "Voir les %{model} de %{of}"
33
33
  tools: Outils
34
34
  order: Trier
35
35
  erase: Effacer
@@ -1,3 +1,3 @@
1
1
  module SlashAdmin
2
- VERSION = "1.5.7"
2
+ VERSION = "1.5.11"
3
3
  end
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.7
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-04-21 00:00:00.000000000 Z
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.5.0
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.16
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.