thecore_ui_rails_admin 2.3.0 → 2.3.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: f76496b79f5a6fe6a8d4b41e90395cd7842e103285fd62518abcd0c53aef5769
4
- data.tar.gz: 303c1f2acc389de1b0e1c0a603a0b3071eaed8bbc5d7bddbcb087602b164e303
3
+ metadata.gz: 6afdee67342dd81ce895511f249dcd7e00e5b25dff08304260ede1547ff7651e
4
+ data.tar.gz: 7ee3dbf243ad43052672f0ac3d2ded93b3381343437099741e35202b095b230b
5
5
  SHA512:
6
- metadata.gz: b02e9490e1b9652ff4479f6a888c2763fddd9dd59c45358dfefc0141705df38f79bd29b85367573c8d3be239b1586ed5891a92f7fd195352dbd3cb300278008a
7
- data.tar.gz: df4af562e11e9dc2b38df87f705038a5440b1f0a34b7827206ff9d0cfc841d6554bd3ba861a524cc35d5185af40ffbb6b76d5bacfe5d108b31670b6e2a4ec22e
6
+ metadata.gz: af2f3bfbece22b9da3eb7d36469b284aee31778c9e327251573ab0661039791873fe60c9565d0145899bd5cef9e2c12095a9d55eba8617592382d38ddb9f7d58
7
+ data.tar.gz: 071b660f0bc6464690b7fdac0e46b808e002a55694dd164981407c5c01e0d3bf389df708be115656b7d27c354608bc431f3ae634dfba5a1cb0c02f12e4030b1c
@@ -0,0 +1,4 @@
1
+ %style{media: "screen"}
2
+ div#sidebar-wrapper div.sidebar-nav li.dropdown-header {padding-left: 0px}
3
+ div.sub-menu-container li.sub-menu a.pjax {padding-left: 0px}
4
+ div#wrapper div#sidebar-wrapper {overflow: hidden}
@@ -0,0 +1 @@
1
+ -# Placeholder to be overridden for special CSS needs, like using interpolation
@@ -7,11 +7,9 @@
7
7
  %meta{name: "viewport", content: "width=device-width, initial-scale=1"}
8
8
  %meta{content: "NONE,NOARCHIVE", name: "robots"}
9
9
  = csrf_meta_tag
10
- %style{media: "screen"}
11
- div#sidebar-wrapper div.sidebar-nav li.dropdown-header { padding-left: 0px }
12
- div.sub-menu-container li.sub-menu a.pjax { padding-left: 0px }
13
- div#wrapper div#sidebar-wrapper { overflow: hidden }
14
10
 
11
+ = render "layouts/rails_admin/style_common"
12
+ = render "layouts/rails_admin/style_override"
15
13
 
16
14
  = stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => 'reload'
17
15
  = javascript_pack_tag 'application', 'data-turbolinks-track' => 'reload'
@@ -17,8 +17,10 @@
17
17
  = breadcrumb
18
18
  .well.well-sm
19
19
  %ul.nav.nav-pills#action-menu
20
- = menu_for((@abstract_model ? (@object.try(:persisted?) ? :member : :collection) : :root), @abstract_model, @object)
20
+ = content_for :search_form
21
+ = content_for :action_links
21
22
  = content_for :contextual_tabs
23
+
22
24
  .well.well-sm
23
25
  = yield
24
26
  - else
@@ -0,0 +1,9 @@
1
+ - @abstract_models.each do |abstract_model|
2
+ - index_path = index_path(model_name: abstract_model.to_param)
3
+ - if authorized?(:index, abstract_model)
4
+ .col-sm-4
5
+ %a.box.pjax{href: index_path}
6
+ %i{class: "icon-bg #{abstract_model.config.navigation_icon.present? ? abstract_model.config.navigation_icon : 'file' }"}
7
+ .text-center
8
+ %p.model= capitalize_first_letter(abstract_model.config.label_plural)
9
+ %strong.count= @count[abstract_model.model.name].to_s
@@ -19,15 +19,7 @@
19
19
 
20
20
  - if @abstract_models
21
21
  .row
22
- - @abstract_models.each do |abstract_model|
23
- - index_path = index_path(model_name: abstract_model.to_param)
24
- - if authorized?(:index, abstract_model)
25
- .col-sm-4
26
- %a.box.pjax{href: index_path}
27
- %i{class: "icon-bg #{abstract_model.config.navigation_icon.present? ? abstract_model.config.navigation_icon : 'file' }"}
28
- .text-center
29
- %p.model= capitalize_first_letter(abstract_model.config.label_plural)
30
- %strong.count= @count[abstract_model.model.name].to_s
22
+ = render partial: 'rails_admin/main/dashboard_block'
31
23
 
32
24
  - if @auditing_adapter && authorized?(:history_index)
33
25
  #block-tables.block
@@ -8,6 +8,7 @@
8
8
  params.delete(:sort) if params[:sort] == @model_config.list.sort_by.to_s
9
9
  export_action = RailsAdmin::Config::Actions.find(:export, { controller: self.controller, abstract_model: @abstract_model })
10
10
  export_action = nil unless export_action && authorized?(export_action.authorization_key, @abstract_model)
11
+ bulk_delete_action = actions(:bulkable, @abstract_model).select { |action| action.action_name.to_s == "bulk_delete" }.first
11
12
  description = RailsAdmin.config(@abstract_model.model_name).description
12
13
  properties = @model_config.list.with(controller: self.controller, view: self, object: @abstract_model.model.new).visible_fields
13
14
  checkboxes = @model_config.list.checkboxes?
@@ -19,23 +20,55 @@
19
20
  other_right = sets[params[:set].to_i + 1].present?
20
21
  end
21
22
 
23
+ - content_for :action_links do
24
+ - parent = (@abstract_model ? (@object.try(:persisted?) ? :member : :collection) : :root)
25
+ - actions = actions(parent, @abstract_model, @object).select { |a| a.http_methods.include?(:get) && a.show_in_menu && a.action_name.to_s != "export"}
26
+ - actions.collect do |action|
27
+ - wording = wording_for(:link, action)
28
+ %li{title: wording, rel: "tooltip", class: "icon #{action.key}_#{parent}_link #{'active' if current_action?(action)}", style: "float:right"}
29
+ %a{class: "#{action.pjax? ? 'pjax' : ''}", href: rails_admin.url_for(action: action.action_name, controller: 'rails_admin/main', model_name: @abstract_model.try(:to_param), id: (@object.try(:persisted?) && @object.try(:id) || nil))}
30
+ %i{class: action.link_icon}
31
+
32
+ - content_for :search_form do
33
+ %li.filer-search-form
34
+ = form_tag(index_path(params.except(*%w[page f query])), method: :get, class: "pjax-form form-inline") do
35
+ %span#filters_box{data: {options: ordered_filter_options.to_json}}
36
+ %hr.filters_box{style: "display:#{ordered_filters.blank? ? 'none' : 'block'}"}
37
+ .input-group#search-for-filter
38
+ %input.form-control.input-small{name: "query", type: "search", value: query, placeholder: t("admin.misc.filter")}
39
+ %span.input-group-btn
40
+ %button.btn.btn-primary{type: 'submit', :'data-disable-with' => '<i class="icon-white icon-refresh"></i> '.html_safe + t('admin.misc.refresh')}
41
+ %i.icon-white.icon-refresh
42
+ - if filterable_fields.present?
43
+ %button.btn.dropdown-toggle#filters-menu{ :'data-toggle' => "dropdown", :'aria-haspopup'=>"true", :'aria-expanded'=>"true"}
44
+ %i.icon-white.icon-filter
45
+ %b.caret
46
+ %ul.dropdown-menu#filters{style: 'left:auto; right:0;', :'aria-labelledby'=>"filters-menu"}
47
+ - filterable_fields.each do |field|
48
+ - field_options = case field.type
49
+ - when :enum
50
+ - options_for_select(field.with(object: @abstract_model.model.new).enum)
51
+ - else
52
+ - ''
53
+ %li
54
+ %a{href: '#', :"data-field-label" => field.label, :"data-field-name" => field.name, :"data-field-options" => field_options.html_safe, :"data-field-type" => field.type, :"data-field-value" => "", :"data-field-datetimepicker-format" => (field.try(:parser) && field.parser.to_momentjs)}= capitalize_first_letter(field.label)
55
+ %button#remove_filter.btn.btn-info{title: "Reset filters"}
56
+ %i.icon-white.icon-remove
57
+
22
58
  - content_for :contextual_tabs do
23
- - if checkboxes
24
- = bulk_menu
25
- - if filterable_fields.present?
26
- %li.dropdown{style: 'float:right'}
27
- %a.dropdown-toggle#filters-menu{ :'data-toggle' => "dropdown", :'aria-haspopup'=>"true", :'aria-expanded'=>"true"}
28
- = t('admin.misc.add_filter')
59
+ - if checkboxes && bulk_delete_action
60
+ %li.icon{style: "float:right", title: t(:delete_selected)}
61
+ = link_to '<i class="fa fa-trash"></i>'.html_safe, '#', class: 'bulk-link', data: {action: "bulk_delete"}
62
+ - if export_action
63
+ %li.dropdown{style: "float:right", title: t(:export)}
64
+ %a.pjax.dropdown-toggle#exporters-menu{ :'data-toggle' => "dropdown", :'aria-haspopup'=>"true", :'aria-expanded'=>"true", style: "float: right;"}
65
+ %i.fa.fa-external-link
29
66
  %b.caret
30
- %ul.dropdown-menu#filters{style: 'left:auto; right:0;', :'aria-labelledby'=>"filters-menu"}
31
- - filterable_fields.each do |field|
32
- - field_options = case field.type
33
- - when :enum
34
- - options_for_select(field.with(object: @abstract_model.model.new).enum)
35
- - else
36
- - ''
37
- %li
38
- %a{href: '#', :"data-field-label" => field.label, :"data-field-name" => field.name, :"data-field-options" => field_options.html_safe, :"data-field-type" => field.type, :"data-field-value" => "", :"data-field-datetimepicker-format" => (field.try(:parser) && field.parser.to_momentjs)}= capitalize_first_letter(field.label)
67
+ %ul.dropdown-menu#exporters{style: 'left:auto; right:0;', :'aria-labelledby'=>"exporters-menu"}
68
+ %li= link_to t(:export_all).html_safe, rails_admin.url_for(action: "export", controller: 'rails_admin/main', model_name: @abstract_model.try(:to_param), id: (@object.try(:persisted?) && @object.try(:id) || nil)), class: "pjax"
69
+ %li= link_to t(:export_found).html_safe, export_path(params.except('set').except('page')), class: 'pjax'
70
+ %li= link_to t(:export_selected).html_safe, '#', class: 'bulk-link pjax', data: {action: "bulk_export"}
71
+
39
72
 
40
73
  %style
41
74
  - properties.select{ |p| p.column_width.present? }.each do |property|
@@ -43,20 +76,6 @@
43
76
  = "#list td.#{property.css_class} { max-width: #{property.column_width}px; }"
44
77
 
45
78
  #list
46
- = form_tag(index_path(params.except(*%w[page f query])), method: :get, class: "pjax-form form-inline") do
47
- %span#filters_box{data: {options: ordered_filter_options.to_json}}
48
- %hr.filters_box{style: "display:#{ordered_filters.blank? ? 'none' : 'block'}"}
49
- .input-group
50
- %input.form-control.input-small{name: "query", type: "search", value: query, placeholder: t("admin.misc.filter")}
51
- %span.input-group-btn
52
- %button.btn.btn-primary{type: 'submit', :'data-disable-with' => '<i class="icon-white icon-refresh"></i> '.html_safe + t('admin.misc.refresh')}
53
- %i.icon-white.icon-refresh
54
- = t('admin.misc.refresh')
55
- %button#remove_filter.btn.btn-info{title: "Reset filters"}
56
- %i.icon-white.icon-remove
57
- - if export_action
58
- %span{style: 'float:right'}= link_to wording_for(:link, export_action), export_path(params.except('set').except('page')), class: 'btn btn-info'
59
-
60
79
  - unless @model_config.list.scopes.blank?
61
80
  %ul.nav.nav-tabs.nav-justified#scope_selector
62
81
  - @model_config.list.scopes.each do |scope|
@@ -45,6 +45,11 @@ RailsAdmin.config do |config|
45
45
  config.model "ActiveStorage::VariantRecord" do
46
46
  visible false
47
47
  end
48
+
49
+ # action_mailbox~inbound_email
50
+ config.model "ActionMailbox::InboundEmail" do
51
+ visible false
52
+ end
48
53
 
49
54
  ## == Devise ==
50
55
  config.authenticate_with do
@@ -31,9 +31,20 @@ module ThecoreConcern
31
31
  # Rails.logger.debug "ROOT ACTIONS: #{root_actions.inspect}"
32
32
  # GETTING THE FIRST ACTION I CAN MANAGE
33
33
  action = root_actions.collect(&:action_name).first
34
- # Rails.logger.debug "FIRST ACTION: #{action}"
35
34
  # REDIRECT TO THAT ACTION
36
- stored_location_for(resource) || rails_admin.send("#{action}_path").sub("#{ENV['RAILS_RELATIVE_URL_ROOT']}#{ENV['RAILS_RELATIVE_URL_ROOT']}", "#{ENV['RAILS_RELATIVE_URL_ROOT']}")
35
+
36
+ if stored_location_for(resource) && can?(resource, :all)
37
+ stored_location_for(resource)
38
+ elsif action
39
+ rails_admin.send("#{action}_path").sub("#{ENV['RAILS_RELATIVE_URL_ROOT']}#{ENV['RAILS_RELATIVE_URL_ROOT']}", "#{ENV['RAILS_RELATIVE_URL_ROOT']}")
40
+ else
41
+ sign_out current_user
42
+ user_session = nil
43
+ current_user = nil
44
+ flash[:alert] = "Your user is not authorized to access any page."
45
+ flash[:notice] = nil
46
+ root_url
47
+ end
37
48
  end
38
49
  end
39
50
 
@@ -1,10 +1,24 @@
1
1
  it:
2
+ export: Esporta
3
+ export_all: Esporta Tutti
4
+ export_found: Esporta i Filtrati
5
+ export_selected: Esporta i Selezionati
6
+ delete_selected: Elimina i Selezionati
2
7
  yes: Si
3
8
  no: Annulla
4
9
  error: Errore
5
10
  question: Domanda
6
11
  root_actions: "Operazioni"
7
12
  admin:
13
+ flash:
14
+ error: "Impossibile eseguire l'azione %{action} (%{name})"
15
+ model_not_found: Impossibile trovare il modello '%{model}'
16
+ noaction: Impossibile eseguire l'azione
17
+ object_not_found: "Impossibile trovare il modello %{model} con id '%{id}'"
18
+ successful: "Azione eseguita con successo: %{action} (%{name})"
19
+ actions:
20
+ index:
21
+ link: Mostra tutti gli Elementi
8
22
  label: "Impostazioni"
9
23
  advanced:
10
24
  label: Avanzate
@@ -31,7 +31,7 @@ module ThecoreUiRailsAdminUser
31
31
  field :roles#, :selectize
32
32
  field :access_token do
33
33
  pretty_value do
34
- "#{ENV['FRONTEND_URL']}/api/v2/authenticate?atoken=#{value}"
34
+ "#{ENV['FRONTEND_URL']}?atoken=#{value}"
35
35
  end
36
36
  # export_value do
37
37
  # # used in exports, where no html/data is allowed
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: thecore_ui_rails_admin
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.0
4
+ version: 2.3.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gabriele Tassoni
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-05-28 00:00:00.000000000 Z
11
+ date: 2021-07-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thecore_ui_commons
@@ -180,10 +180,13 @@ files:
180
180
  - app/views/layouts/rails_admin/_navigation.html.haml
181
181
  - app/views/layouts/rails_admin/_secondary_navigation.html.haml
182
182
  - app/views/layouts/rails_admin/_sidebar_navigation.html.haml
183
+ - app/views/layouts/rails_admin/_style_common.html.haml
184
+ - app/views/layouts/rails_admin/_style_override.html.haml
183
185
  - app/views/layouts/rails_admin/_user_navigation.html.haml
184
186
  - app/views/layouts/rails_admin/application.html.haml
185
187
  - app/views/layouts/rails_admin/pjax.html.haml
186
188
  - app/views/rails_admin/main/_card.html.haml
189
+ - app/views/rails_admin/main/_dashboard_block.html.haml
187
190
  - app/views/rails_admin/main/_modal_interaction.html.erb
188
191
  - app/views/rails_admin/main/dashboard.html.haml
189
192
  - app/views/rails_admin/main/index.html.haml