slash_admin 1.5.2 → 1.5.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/slash_admin/application.scss +6 -3
- data/app/controllers/slash_admin/models_controller.rb +5 -1
- data/app/views/slash_admin/base/_data_list.html.erb +18 -8
- data/app/views/slash_admin/base/_data_show.html.erb +8 -1
- data/app/views/slash_admin/fields/_belongs_to.html.erb +1 -1
- data/app/views/slash_admin/fields/_has_many.html.erb +1 -1
- data/app/views/slash_admin/fields/_nested_belongs_to.html.erb +1 -1
- data/config/initializers/js_routes.rb +3 -0
- data/config/locales/en.yml +1 -0
- data/config/locales/fr.yml +1 -0
- data/lib/slash_admin/version.rb +1 -1
- metadata +6 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 905087476b4fe1a2cefd7cba21a3214fcf4834cb4fed1f1c5ccf00570fb246af
|
4
|
+
data.tar.gz: 5d29e7eb6d2ee39960526c5a85f033b34aa7549c3b38e53db84d137778ac1993
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0aafd6dfba8ff8d7a46059b7a37380d8ef8b16df1b5fa6b7659942259ea99f0114e2f6e855857a92b7f50b4cea5763c6aec1a7a6913cf5fbb763e7e8ed0ca801
|
7
|
+
data.tar.gz: 32ef3759aa3558806282585bc470fbbcaf9dacdc9677a6710d0b96554c87f208380ba45b6335b0a68f89937dd68e99df4bd5d600ffc910378d47f7452b5470e3
|
@@ -29,7 +29,7 @@ $border-radius: 0.15rem !default;
|
|
29
29
|
|
30
30
|
@import "bootstrap";
|
31
31
|
|
32
|
-
@import url("https://use.fontawesome.com/releases/v5.
|
32
|
+
@import url("https://use.fontawesome.com/releases/v5.15.1/css/all.css");
|
33
33
|
|
34
34
|
@import url("https://fonts.googleapis.com/css?family=Open+Sans:400,300,600,700&subset=all");
|
35
35
|
@import url("https://cdnjs.cloudflare.com/ajax/libs/simple-line-icons/2.4.1/css/simple-line-icons.css");
|
@@ -252,7 +252,6 @@ p[data-f-id="pbf"] {
|
|
252
252
|
}
|
253
253
|
|
254
254
|
.tag-boolean {
|
255
|
-
width: 45px;
|
256
255
|
text-align: center;
|
257
256
|
display: inline-block;
|
258
257
|
}
|
@@ -764,6 +763,7 @@ p[data-f-id="pbf"] {
|
|
764
763
|
> a.nav-link {
|
765
764
|
color: $textColorHover;
|
766
765
|
font-weight: bold;
|
766
|
+
background-color: $border;
|
767
767
|
}
|
768
768
|
|
769
769
|
&::after {
|
@@ -1240,9 +1240,12 @@ p[data-f-id="pbf"] {
|
|
1240
1240
|
.datatable_wrapper {
|
1241
1241
|
.tag {
|
1242
1242
|
font-size: 13px;
|
1243
|
-
padding: 2px
|
1243
|
+
padding: 2px 8px;
|
1244
1244
|
color: #fff;
|
1245
1245
|
text-transform: uppercase;
|
1246
|
+
a, a:hover, a:visited, a:active {
|
1247
|
+
color: #fff;
|
1248
|
+
}
|
1246
1249
|
}
|
1247
1250
|
}
|
1248
1251
|
|
@@ -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
|
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
|
15
15
|
|
16
16
|
def index
|
17
17
|
authorize! :index, @model_class
|
@@ -157,6 +157,10 @@ module SlashAdmin
|
|
157
157
|
{}
|
158
158
|
end
|
159
159
|
|
160
|
+
def no_title
|
161
|
+
[]
|
162
|
+
end
|
163
|
+
|
160
164
|
def handle_has_one
|
161
165
|
@has_one = {}
|
162
166
|
Array.wrap(update_params + create_params).uniq.each do |p|
|
@@ -28,13 +28,20 @@
|
|
28
28
|
</th>
|
29
29
|
<% list_params.each do |attr| %>
|
30
30
|
<% if attr.is_a?(Hash) %>
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
31
|
+
<% if no_title.include? attr.keys.first %>
|
32
|
+
<th></th>
|
33
|
+
<% else %>
|
34
|
+
<th>
|
35
|
+
<%= @model_class.human_attribute_name(attr.keys.first) %>
|
36
|
+
<% if tooltips.key? attr.keys.first %>
|
37
|
+
<a href="#" data-toggle="tooltip" data-placement="top" title="<%= tooltips[attr.keys.first] %>"><i class="fas fa-question-circle"></i></a>
|
38
|
+
<% end %>
|
39
|
+
</th>
|
40
|
+
<% end %>
|
37
41
|
<% else %>
|
42
|
+
<% if no_title.include? attr %>
|
43
|
+
<th></th>
|
44
|
+
<% else %>
|
38
45
|
<th
|
39
46
|
<% if orderable?(@model_class, attr) %>
|
40
47
|
data-order-field="<%= attr %>"
|
@@ -50,6 +57,7 @@
|
|
50
57
|
<a href="#" data-toggle="tooltip" data-placement="top" title="<%= tooltips[attr] %>"><i class="fas fa-question-circle"></i></a>
|
51
58
|
<% end %>
|
52
59
|
</th>
|
60
|
+
<% end %>
|
53
61
|
<% end %>
|
54
62
|
<% end %>
|
55
63
|
<th class="text-center"><%= t('slash_admin.view.actions') %></th>
|
@@ -92,8 +100,10 @@
|
|
92
100
|
</td>
|
93
101
|
<% elsif @has_many_fields.include?(attr) %>
|
94
102
|
<td class="<%= attr.to_s.parameterize.underscore.downcase %>">
|
95
|
-
<button type="button" class="btn btn-sm btn-primary" data-toggle="modal" data-target="#modal-see-assoc-<%= attr.to_s %>-<%= m.id %>"
|
96
|
-
|
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) %>"
|
105
|
+
>
|
106
|
+
<i class="fa fa-list"></i>
|
97
107
|
</button>
|
98
108
|
<div class="modal fade" id="modal-see-assoc-<%= attr.to_s %>-<%= m.id %>" tabindex="-1" role="dialog" aria-labelledby="modal" aria-hidden="true">
|
99
109
|
<div class="modal-dialog" role="document">
|
@@ -19,7 +19,14 @@
|
|
19
19
|
<span class="show-attr-title"><%= @model_class.human_attribute_name(a) %></span>
|
20
20
|
<% if @model.send(a).present? %>
|
21
21
|
<br/>
|
22
|
-
|
22
|
+
<% extension = @model.send(a).file.try(:extension).try(:downcase) || @model.send(a).file.try(:format).try(:downcase) || file.try(:file).try(:extension) %>
|
23
|
+
<% if extension.present? %>
|
24
|
+
<% if %w{pdf doc docx xls xlsx ppt pptx}.include?(extension) %>
|
25
|
+
<iframe src="https://docs.google.com/gview?url=<%= @model.send(a) %>&embedded=true" style="width:100%; height:600px;" frameborder="0"></iframe>
|
26
|
+
<% else %>
|
27
|
+
<img src="<%= @model.send(a) %>" class="img-fluid background-default"/>
|
28
|
+
<% end %>
|
29
|
+
<% end %>
|
23
30
|
<% end %>
|
24
31
|
</div>
|
25
32
|
</div>
|
@@ -1,7 +1,7 @@
|
|
1
1
|
<%= f.label a, class: "form-control-label #{required?(f.object, a).present? ? 'required' : ''}" %>
|
2
2
|
<%= render 'slash_admin/shared/tooltip', a: a %>
|
3
3
|
<%= f.collection_select a.to_s + '_id',
|
4
|
-
class_name_from_association(f.object, a).constantize.all.order(f.object.send(a).present? ? "CASE WHEN id = #{f.object.send(a).try(:id)} THEN 1 ELSE 0 END DESC" : "id DESC").limit(20), :id, object_label(class_name_from_association(f.object, a)),
|
4
|
+
class_name_from_association(f.object, a).constantize.all.order(f.object.send(a).present? ? Arel.sql("CASE WHEN id = #{f.object.send(a).try(:id)} THEN 1 ELSE 0 END DESC") : "id DESC" ).limit(20), :id, object_label(class_name_from_association(f.object, a)),
|
5
5
|
{
|
6
6
|
include_blank: true,
|
7
7
|
},
|
@@ -1,7 +1,7 @@
|
|
1
1
|
<%= f.label a, class: "form-control-label #{required?(f.object, a) ? 'required' : ''}" %>
|
2
2
|
<%= render 'slash_admin/shared/tooltip', a: a %>
|
3
3
|
<%= f.collection_select "#{a.to_s.singularize}_ids",
|
4
|
-
class_name_from_association(f.object, a).constantize.all.order(f.object.send(a).present? ? "CASE WHEN id IN(#{f.object.send(a).pluck(:id).join(',')}) THEN 1 ELSE 0 END DESC" : "id DESC").limit(20), :id,
|
4
|
+
class_name_from_association(f.object, a).constantize.all.order(f.object.send(a).present? ? Arel.sql("CASE WHEN id IN(#{f.object.send(a).pluck(:id).join(',')}) THEN 1 ELSE 0 END DESC") : "id DESC").limit(20), :id,
|
5
5
|
object_label(class_name_from_association(f.object, a)),
|
6
6
|
{include_blank: true},
|
7
7
|
{
|
@@ -2,7 +2,7 @@
|
|
2
2
|
<%= render 'slash_admin/shared/tooltip', a: a %>
|
3
3
|
<% class_name_from_association = class_name_from_association(f.object, a) %>
|
4
4
|
<%= f.collection_select a.to_s + '_id',
|
5
|
-
class_name_from_association.constantize.all.order(f.object.send(a).present? ? "CASE WHEN id = #{f.object.send(a).try(:id)} THEN 1 ELSE 0 END DESC" : "id DESC").limit(20), :id, object_label(a),
|
5
|
+
class_name_from_association.constantize.all.order(f.object.send(a).present? ? Arel.sql("CASE WHEN id = #{f.object.send(a).try(:id)} THEN 1 ELSE 0 END DESC") : "id DESC").limit(20), :id, object_label(a),
|
6
6
|
{
|
7
7
|
include_blank: true,
|
8
8
|
},
|
data/config/locales/en.yml
CHANGED
data/config/locales/fr.yml
CHANGED
data/lib/slash_admin/version.rb
CHANGED
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.
|
4
|
+
version: 1.5.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- KOVACS Nicolas
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-04-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '6.
|
19
|
+
version: '6.1'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '6.
|
26
|
+
version: '6.1'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: http_accept_language
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -390,6 +390,7 @@ files:
|
|
390
390
|
- app/views/slash_admin/shared/_new_form_buttons.html.erb
|
391
391
|
- app/views/slash_admin/shared/_sub_header.html.erb
|
392
392
|
- app/views/slash_admin/shared/_tooltip.html.erb
|
393
|
+
- config/initializers/js_routes.rb
|
393
394
|
- config/initializers/validators.rb
|
394
395
|
- config/locales/en.yml
|
395
396
|
- config/locales/fr.yml
|
@@ -456,7 +457,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
456
457
|
- !ruby/object:Gem::Version
|
457
458
|
version: '0'
|
458
459
|
requirements: []
|
459
|
-
rubygems_version: 3.
|
460
|
+
rubygems_version: 3.2.16
|
460
461
|
signing_key:
|
461
462
|
specification_version: 4
|
462
463
|
summary: A modern and overridable admin gem, just the rails way.
|