slash_admin 1.5 → 1.5.5

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: 66c021626154a42a86fbd5227ac9e5af5ae42bb8a908c0a0a3683dd6d7cb6f47
4
- data.tar.gz: 8f8df399ea649c9d498221eac54d5216970d826d4626e6c6d96d3c01af37279f
3
+ metadata.gz: e05ff7dc688e9ce000ccc9b495ef50d15f426c793cc269e12a694f37cb3ee703
4
+ data.tar.gz: 97854cf7acee2e53de6edbc6aea3515d738c74d87073d83668b2a529cf221b88
5
5
  SHA512:
6
- metadata.gz: 3a38afabe3fa6ebbf1178dea5f832a162d591ca9060202ed58d0c77dab48466ecffe666d4d8c130b61bf9421af862b89b50005ff6e710acc4038edd5816d66d6
7
- data.tar.gz: 16cd83d5a57c4cfcc62b5d1a4e91993c2dba2fdffb3e1ea0d73f7dfe6f414a5f1108a332afaabd9ebe3d49ffb80f6a9a7553ca96e34aa4ca50187afe893fc5c1
6
+ metadata.gz: 5ccb114e9576d12d79fcf1e5ccbc35813046aec881098dc8aa796960715a37a4e0c3d1bc583c733484661ccc2f4650d1b6c0f94a42a8be06e1edcd3c62ebbe69
7
+ data.tar.gz: ddadcfcc2fae1e85525e34a338c6a93e4a169517ff4d5b9e0e6f76f5acf8d387d6a3f67a41681d1a8f944ffde55937f0322783330f8aea49b90fa8a74933b6a0
@@ -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
  }
@@ -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 5px;
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
- <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>
@@ -60,6 +60,13 @@
60
60
  <% else %>
61
61
  <td>&nbsp;</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>&nbsp;</td>
65
72
  <% end %>
@@ -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"
2
+ VERSION = "1.5.5"
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'
4
+ version: 1.5.5
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-06-22 00:00:00.000000000 Z
11
+ date: 2020-11-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -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.