slash_admin 1.5.1 → 1.5.6

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: a370ada076f5e75847c03295de614ad55fe75a3cc21aea02bb3643dae2112325
4
- data.tar.gz: 263f0df3accd2d6d316bcde3b11c476facd7e724a1c75980ef7ca7d1f358b37f
3
+ metadata.gz: 75a4d10e9ae3f3459f4f84a212d4cd959af543dfe9313daa264b860f057f93ad
4
+ data.tar.gz: 220d6763eea19e9eea0b556b092305d7e27b1cc25d075612df92888383f225e7
5
5
  SHA512:
6
- metadata.gz: d2418b0341f04bf62b210034f09ad73cee0b02e306f2b52ffe8f32327b2f4a607bbd8c356d4b5940cef4f5c3a28bd495c24cb43fe2a9c3d0162c37aec69d9573
7
- data.tar.gz: c002bf47c5741ce20fbba8a3d9260708794f4e16a7fb35ca56a847650ccc496254c8fe2440737bf6522c26c8385fca45845461f4d09015a83ce78327530b571e
6
+ metadata.gz: 68e65e9c493da98d401df31ff689bb752d67d2d4343083473b988ae5a228dbc03969778807e3199de72eb5f5d23c55f8934771020a447b18bc33feafdd424524
7
+ data.tar.gz: 93556b4c7d5e7078698f1cf30cab0ed0ac8900a5f6bf0d83570244c1c45eebcc814bbeacc5e79473416096018b137ebe63c037682f1ab69b847c9fc9a6a49894
@@ -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.12.1/css/all.css");
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
  }
@@ -565,6 +564,10 @@ p[data-f-id="pbf"] {
565
564
  padding-left: 8px;
566
565
  }
567
566
 
567
+ .dropdown .dropdown-menu a.dropdown-item {
568
+ color: #7f96ac;
569
+ }
570
+
568
571
  .nav-item {
569
572
  margin: 0;
570
573
  padding: 0;
@@ -760,6 +763,7 @@ p[data-f-id="pbf"] {
760
763
  > a.nav-link {
761
764
  color: $textColorHover;
762
765
  font-weight: bold;
766
+ background-color: $border;
763
767
  }
764
768
 
765
769
  &::after {
@@ -1236,9 +1240,12 @@ p[data-f-id="pbf"] {
1236
1240
  .datatable_wrapper {
1237
1241
  .tag {
1238
1242
  font-size: 13px;
1239
- padding: 2px 5px;
1243
+ padding: 2px 8px;
1240
1244
  color: #fff;
1241
1245
  text-transform: uppercase;
1246
+ a, a:hover, a:visited, a:active {
1247
+ color: #fff;
1248
+ }
1242
1249
  }
1243
1250
  }
1244
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
- <img src="<%= @model.send(a) %>" class="img-fluid background-default"/>
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
  },
@@ -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
- <a class="nav-link">
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">
@@ -0,0 +1,3 @@
1
+ JsRoutes.setup do |config|
2
+ config.namespace = "Routes"
3
+ end
@@ -13,6 +13,7 @@ en:
13
13
  error: Impossible to create '%{model_name}'
14
14
  success: Operation successed.
15
15
  view:
16
+ edit_account: Edit my Account
16
17
  fill_login_and_password: "Please enter your credentials to proceed."
17
18
  administration: Administration
18
19
  home: Home
@@ -13,6 +13,7 @@ fr:
13
13
  error: Impossible de trier '%{model_name}'
14
14
  success: Opération réussi.
15
15
  view:
16
+ edit_account: Modifier mon Compte
16
17
  fill_login_and_password: "Merci d'entrer votre identifiant et mot de passe."
17
18
  administration: Administration
18
19
  home: Accueil
@@ -1,3 +1,3 @@
1
1
  module SlashAdmin
2
- VERSION = "1.5.1"
2
+ VERSION = "1.5.6"
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.1
4
+ version: 1.5.6
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-07-31 00:00:00.000000000 Z
11
+ date: 2021-01-13 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.0'
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.0'
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.1.2
460
+ rubygems_version: 3.1.4
460
461
  signing_key:
461
462
  specification_version: 4
462
463
  summary: A modern and overridable admin gem, just the rails way.