slash_admin 1.5.7 → 1.5.8

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: eab3ae290969bd0aafca3d62534ad33addd33964b3d0a86252a3e1b572899a61
4
+ data.tar.gz: 11dc8b152fe0ae371a9455368d093053830b5022aca93e81e219241994198ad1
5
5
  SHA512:
6
- metadata.gz: 0aafd6dfba8ff8d7a46059b7a37380d8ef8b16df1b5fa6b7659942259ea99f0114e2f6e855857a92b7f50b4cea5763c6aec1a7a6913cf5fbb763e7e8ed0ca801
7
- data.tar.gz: 32ef3759aa3558806282585bc470fbbcaf9dacdc9677a6710d0b96554c87f208380ba45b6335b0a68f89937dd68e99df4bd5d600ffc910378d47f7452b5470e3
6
+ metadata.gz: c1270c0a3a732ccd0e5700defcfc5bb1be81987014e3a3b8329bbb8ce2d5220b9eb1403d195851d246961b31d7cb21e98b84964b6fdbbf35986a33203b585158
7
+ data.tar.gz: 9cf8b935b5d76c57eff1ccebbce9623748efff7cc703663c1e47dbcc1e623792222bbc7c775133f5a56788bea8e0d18718e588dcde153b40e72b07bc7338b73e
@@ -1493,3 +1493,9 @@ 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
+ }
@@ -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|
@@ -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>
@@ -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.8"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
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.8
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-04-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails