slash_admin 1.4.1 → 1.5.4
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 -5
- data/app/views/slash_admin/base/_data_show.html.erb +8 -1
- data/app/views/slash_admin/base/_filters.html.erb +7 -0
- data/app/views/slash_admin/fields/_belongs_to.html.erb +13 -8
- data/app/views/slash_admin/fields/_has_one.html.erb +10 -8
- data/app/views/slash_admin/shared/_header.html.erb +13 -2
- data/config/locales/en.yml +1 -0
- data/config/locales/fr.yml +1 -0
- data/lib/slash_admin/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 784dbf2f3663366f6eb5c600b4590b3bba191ab63a9b6b71ca1de792abd81650
|
4
|
+
data.tar.gz: '00828e7a32a7f64f0366c7a9a1ab9d2694417a1be14b63e2a06cf099f8d8e2df'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6046a425354193760cb8647efd5e2247f07ca2478d961168d43509b6e8323345c61ab04f5a52e238301a1c5ac6895de36dbb7f3e89ebff4f396607d4faa37114
|
7
|
+
data.tar.gz: dc3140cc8e14d89d478b258e68819626aed20065f3180affd5c94f9b1132ab2503e9904635e78ed0dfd2b5a947dc044716603041da97f3720bd8640242f2c1cc
|
@@ -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
|
}
|
@@ -480,11 +479,9 @@ p[data-f-id="pbf"] {
|
|
480
479
|
|
481
480
|
.badge {
|
482
481
|
font-size: 11px;
|
483
|
-
font-weight: 300;
|
484
482
|
height: 18px;
|
485
483
|
color: #fff;
|
486
484
|
padding: 3px 6px;
|
487
|
-
border-radius: 12px;
|
488
485
|
text-shadow: none;
|
489
486
|
text-align: center;
|
490
487
|
vertical-align: middle;
|
@@ -567,6 +564,10 @@ p[data-f-id="pbf"] {
|
|
567
564
|
padding-left: 8px;
|
568
565
|
}
|
569
566
|
|
567
|
+
.dropdown .dropdown-menu a.dropdown-item {
|
568
|
+
color: #7f96ac;
|
569
|
+
}
|
570
|
+
|
570
571
|
.nav-item {
|
571
572
|
margin: 0;
|
572
573
|
padding: 0;
|
@@ -762,6 +763,7 @@ p[data-f-id="pbf"] {
|
|
762
763
|
> a.nav-link {
|
763
764
|
color: $textColorHover;
|
764
765
|
font-weight: bold;
|
766
|
+
background-color: $border;
|
765
767
|
}
|
766
768
|
|
767
769
|
&::after {
|
@@ -1238,9 +1240,12 @@ p[data-f-id="pbf"] {
|
|
1238
1240
|
.datatable_wrapper {
|
1239
1241
|
.tag {
|
1240
1242
|
font-size: 13px;
|
1241
|
-
padding: 2px
|
1243
|
+
padding: 2px 8px;
|
1242
1244
|
color: #fff;
|
1243
1245
|
text-transform: uppercase;
|
1246
|
+
a, a:hover, a:visited, a:active {
|
1247
|
+
color: #fff;
|
1248
|
+
}
|
1244
1249
|
}
|
1245
1250
|
}
|
1246
1251
|
|
@@ -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>
|
@@ -60,6 +60,13 @@
|
|
60
60
|
<% else %>
|
61
61
|
<td> </td>
|
62
62
|
<% end %>
|
63
|
+
<% elsif attr.is_a?(Hash) && attr[:filter].present? %>
|
64
|
+
<td>
|
65
|
+
<% case attr[:filter] %>
|
66
|
+
<% when :text, :string %>
|
67
|
+
<input type="text" name="filters[<%= attr.keys.first %>]" value="<%= params[:filters][attr.keys.first] rescue nil %>" class="form-control form-control-sm"/>
|
68
|
+
<% end %>
|
69
|
+
</td>
|
63
70
|
<% else %>
|
64
71
|
<td> </td>
|
65
72
|
<% end %>
|
@@ -1,11 +1,16 @@
|
|
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
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
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)),
|
5
|
+
{
|
6
|
+
include_blank: true,
|
7
|
+
},
|
8
|
+
{
|
9
|
+
'data-placeholder': t('slash_admin.view.select_model', model_name: class_name_from_association(f.object, a).constantize.model_name.human.downcase),
|
10
|
+
'data-model': class_name_from_association(f.object, a).constantize.model_name.to_s.underscore,
|
11
|
+
'data-fields': "SlashAdmin::Models::#{class_name_from_association(f.object, a).classify.pluralize}Controller".constantize.new.autocomplete_params.join(' '),
|
12
|
+
class: 'form-control select2-model-single',
|
13
|
+
required: required?(f.object, a).present?,
|
14
|
+
selected: f.object.send(a).present? ? f.object.send(a).try(:id) : nil,
|
15
|
+
}
|
16
|
+
%>
|
@@ -1,11 +1,13 @@
|
|
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.select a.to_s,
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
4
|
+
options_for_select(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).collect { |assoc| [assoc.send(object_label(class_name_from_association(f.object, a))), assoc.id] }, f.object.send(a).present? ? f.object.send(a).try(:id) : nil),
|
5
|
+
{
|
6
|
+
include_blank: true,
|
7
|
+
},
|
8
|
+
'data-placeholder': t('slash_admin.view.select_model', model_name: class_name_from_association(f.object, a).constantize.model_name.human.downcase),
|
9
|
+
'data-model': class_name_from_association(f.object, a).constantize.model_name.to_s.underscore,
|
10
|
+
'data-fields': "SlashAdmin::Models::#{class_name_from_association(f.object, a).classify.pluralize}Controller".constantize.new.autocomplete_params.join(' '),
|
11
|
+
class: 'form-control select2-model-single',
|
12
|
+
required: required?(f.object, a).present?
|
13
|
+
%>
|
@@ -10,8 +10,12 @@
|
|
10
10
|
<div class="navbar-nav mr-auto mt-2 mt-lg-0">
|
11
11
|
</div>
|
12
12
|
<ul class="nav right-nav-fix">
|
13
|
-
<li class="nav-item">
|
14
|
-
|
13
|
+
<li class="nav-item <%= can?(:update, current_admin) ? 'dropdown' : '' %>">
|
14
|
+
<% if can?(:update, current_admin) %>
|
15
|
+
<a class= "nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown">
|
16
|
+
<% else %>
|
17
|
+
<a class="nav-link">
|
18
|
+
<% end %>
|
15
19
|
<% if current_admin.avatar.present? %>
|
16
20
|
<img src="<%= current_admin.avatar.url %>" class="rounded-circle"/>
|
17
21
|
<% else %>
|
@@ -19,6 +23,13 @@
|
|
19
23
|
<% end %>
|
20
24
|
<span class=""><%= current_admin.login %></span>
|
21
25
|
</a>
|
26
|
+
<% if can?(:update, current_admin) %>
|
27
|
+
<div class="dropdown-menu" aria-labelledby="navbarDropdown">
|
28
|
+
<a href="<%= edit_slash_admin_admin_path current_admin %>" class="dropdown-item">
|
29
|
+
<i class="fas fa-user-circle"></i> <%= t('slash_admin.view.edit_account') %>
|
30
|
+
</a>
|
31
|
+
</div>
|
32
|
+
<% end %>
|
22
33
|
</li>
|
23
34
|
|
24
35
|
<li class="nav-item">
|
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.4
|
4
|
+
version: 1.5.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- KOVACS Nicolas
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-10-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -456,7 +456,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
456
456
|
- !ruby/object:Gem::Version
|
457
457
|
version: '0'
|
458
458
|
requirements: []
|
459
|
-
rubygems_version: 3.1.
|
459
|
+
rubygems_version: 3.1.4
|
460
460
|
signing_key:
|
461
461
|
specification_version: 4
|
462
462
|
summary: A modern and overridable admin gem, just the rails way.
|