thecore_ui_rails_admin 2.1.8 → 2.1.9

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: 75369cb3f050b4996aafce1b1651216c51db2c3248195a46a5a9e42293372b6e
4
- data.tar.gz: 7f72b944c75a1a4a9a36a2633266c977d48638b34a15a6ea8915156b86adcc21
3
+ metadata.gz: 1a6756ba49af59b55c1fa566eca295c98e52c7580f184e1d45ae0c25a7bd75f4
4
+ data.tar.gz: ecbfb2985e40f30bb57c3c3a81469cc1d3147c9fdac68d999005dfc162899229
5
5
  SHA512:
6
- metadata.gz: b81368ff53b4f4362f2318a0949b5be0a673161899c5c4a85433895683f13fbee00dae9bb3cc2137dee5fc56698b7e4983ccd763128eab3d8b7a9b1d4f0c681b
7
- data.tar.gz: 72557529214aef7ed4f464309c10846ff0ad57a1f594ed1ecc328a3a940a79eaf37b965e7a40eccf22e14fcfcdf76eed89ab9f5a902f1ec413cfbd7a0146f7fc
6
+ metadata.gz: e638884d96e59d9d809885cd9a2a7e6a6ecb1cf4cef6a8bb93a17428f1492bd271e71b253a251b53b7c191aa128796fd602b67f7059b48432a832548e979ec97
7
+ data.tar.gz: 2b248f371c27d01b9189f654351c15a2475383effa6ad47fc6c4c91a177c7c304bb2eb41c95479d25be66406bfa59fb1aab4bbab74b09145a94342fd549d2152
@@ -19,18 +19,6 @@ $(document).on('ready pjax:success', function(e) {
19
19
  } else {
20
20
  $('.page-header, .content').removeClass('dashboard');
21
21
  }
22
-
23
- // $(document).ready(function () {
24
- // Hide and show the sidebar
25
- // Make the sidebar button shine a bit
26
- // setTimeout(function() {
27
- // $('#sidebar-collapse').addClass("flash");
28
- // }, 500);
29
- // setTimeout(function() {
30
- // if (!$('#wrapper').hasClass('toggled'))
31
- // $('#wrapper').addClass('toggled');
32
- // }, 1200);
33
- // });
34
22
  });
35
23
 
36
24
  $(function() {
@@ -86,14 +74,4 @@ $(document).ready(function () {
86
74
  $('#wrapper').toggleClass('toggled');
87
75
  });
88
76
 
89
- $('textarea[data-richtext="froala-wysiwyg"').froalaEditor();
90
- // // Hide and show the sidebar
91
- // // Make the sidebar button shine a bit
92
- // setTimeout(function() {
93
- // $('#sidebar-collapse').addClass("flash");
94
- // }, 500);
95
- // setTimeout(function() {
96
- // if (!$('#wrapper').hasClass('toggled'))
97
- // $('#wrapper').addClass('toggled');
98
- // }, 1200);
99
77
  });
@@ -12,7 +12,6 @@
12
12
  *
13
13
  *= required _colors
14
14
 
15
- *= require_tree .
16
15
  *= require_self
17
16
  */
18
17
  @import "jquery-ui";
@@ -1,3 +1,21 @@
1
+ /*
2
+ * This is a manifest file that'll be compiled into application.css, which will include all the files
3
+ * listed below.
4
+ *
5
+ * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
6
+ * or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
7
+ *
8
+ * You're free to add application-wide styles to this file and they'll appear at the bottom of the
9
+ * compiled file so the styles you add here take precedence over styles defined in any styles
10
+ * defined in the other CSS/SCSS files in this directory. It is generally better to create a new
11
+ * file per style scope.
12
+ *
13
+ *= required _colors
14
+
15
+ *= require_self
16
+ */
17
+ @import 'thecore';
18
+ @import 'thecore_ui_commons/thecore';
1
19
  @import "togglable-sidebar";
2
20
  @import "flashing";
3
21
  @import 'common';
@@ -83,4 +83,8 @@
83
83
 
84
84
  body.rails_admin .sidebar-nav {
85
85
  top: 0px;
86
+ }
87
+
88
+ .sub-menu a {
89
+ padding-left: 20px;
86
90
  }
@@ -1,3 +1,3 @@
1
1
  -# %ul.sidebar-nav
2
2
  - actions(:root).each do |action|
3
- %li= link_to wording_for(:menu, action), { action: action.action_name, controller: 'rails_admin/main' }, class: action.pjax? ? "pjax" : "", style: "padding-left: 0px;"
3
+ %li= link_to wording_for(:menu, action), { action: action.action_name, controller: 'rails_admin/main' }, class: action.pjax? ? "pjax" : "", style: "padding-left: 0px;text-indent:20px"
@@ -2,6 +2,6 @@
2
2
  -# %ul.sidebar-nav
3
3
  %li.dropdown-header=t :current_user
4
4
  - if user_link = edit_user_link
5
- %li.edit_user_root_link= user_link
5
+ %li.edit_user_root_link= link_to content_tag('i', "", class: 'fa fa-user', style: 'text-indent: 0') + _current_user.email, show_path(:user, _current_user.id)
6
6
  - if logout_path.present?
7
- %li=link_to content_tag('span', t('admin.misc.log_out'), class: 'label label-danger'), logout_path, method: logout_method
7
+ %li=link_to content_tag('i', "", class: 'fa fa-unlink', style: 'text-indent: 0') + t('admin.misc.log_out'), logout_path, method: logout_method
@@ -13,12 +13,9 @@
13
13
 
14
14
  = stylesheet_link_tag "rails_admin/rails_admin.css", media: :all
15
15
  = javascript_include_tag "rails_admin/rails_admin.js"
16
+ -# Getting all the assets needed by thecore_rails_admin from all the gems
17
+ = get_asset_tags_for("thecore_rails_admin")
16
18
 
17
- - Rails.application.config.assets.paths.each do |p|
18
- -# Getting all the assets needed by thecore from all the gems
19
- = stylesheet_link_tag("#{p.to_s.split("/").last}/thecore_rails_admin", media: 'all', 'data-turbolinks-track' => true) if File.exists?("#{p}/thecore_rails_admin.scss")
20
- = javascript_include_tag("#{Dir["#{p}/**/thecore_rails_admin.js"].first.split("/")[-2]}/thecore_rails_admin", 'data-turbolinks-track' => true) if Dir["#{p}/**/thecore_rails_admin.js"].any?
21
-
22
19
  = favicon_link_tag 'apple-touch-icon.png', rel: 'apple-touch-icon', sizes: "180x180"
23
20
  = favicon_link_tag 'favicon-32x32.png', rel: 'icon', sizes: "32x32"
24
21
  = favicon_link_tag 'favicon-16x16.png', rel: 'icon', sizes: "16x16"
@@ -15,7 +15,7 @@
15
15
  .text-center
16
16
  %p= capitalize_first_letter(abstract_model.config.label_plural)
17
17
  %strong= @count[abstract_model.model.name].to_s
18
- %p= link_to t('admin.rollincode.show'), index_path, class: 'btn btn-black pjax'
18
+ %p= link_to content_tag("i", "", class: "fa fa-list-ul"), index_path, class: 'btn btn-black pjax'
19
19
  - index += 1
20
20
 
21
21
  - if @auditing_adapter && authorized?(:history_index)
@@ -9,6 +9,26 @@ RailsAdmin.config do |config|
9
9
  visible false
10
10
  end
11
11
 
12
+ config.model "Predicate" do
13
+ visible false
14
+ end
15
+
16
+ config.model "Target" do
17
+ visible false
18
+ end
19
+
20
+ config.model "Action" do
21
+ visible false
22
+ end
23
+
24
+ config.model "PermissionRole" do
25
+ visible false
26
+ end
27
+
28
+ config.model "Permission" do
29
+ visible false
30
+ end
31
+
12
32
  config.model "ActionText::RichText" do
13
33
  visible false
14
34
  end
@@ -32,7 +52,7 @@ RailsAdmin.config do |config|
32
52
 
33
53
  ## == PaperTrail ==
34
54
  # config.audit_with :paper_trail, 'User', 'PaperTrail::Version' # PaperTrail >= 3.0.0
35
-
55
+ config.show_gravatar = false
36
56
  ### More at https://github.com/sferik/rails_admin/wiki/Base-configuration
37
57
  config.label_methods.unshift(:display_name)
38
58
 
@@ -12,7 +12,6 @@ module ThecoreConcern
12
12
  redirect_to main_app.root_url, :alert => exception.message
13
13
  end
14
14
  include HttpAcceptLanguage::AutoLocale
15
- Rails.logger.debug "Selected Locale: #{I18n.locale}"
16
15
  before_action :store_user_location!, if: :storable_location?
17
16
  before_action :configure_permitted_parameters, if: :devise_controller?
18
17
  before_action :reject_locked!, if: :devise_controller?
@@ -1,4 +1,6 @@
1
1
  Rails.application.configure do
2
+ # config.assets.paths << root.join("app", "assets", "stylesheets", "thecore_ui_rails_admin")
3
+ # config.assets.paths << root.join("app", "assets", "javascripts", "thecore_ui_rails_admin")
2
4
  # Login Page and pages not in RailsAdmin
3
5
  config.assets.precompile += %w( thecore_ui_rails_admin/thecore.css thecore_ui_rails_admin/thecore.js )
4
6
  # Pages under Rails Admin
@@ -9,5 +11,7 @@ Rails.application.configure do
9
11
  RailsAdmin::Config::Actions::BulkDelete.send(:include, BulkDeleteConcern)
10
12
  RailsAdminSettings::Setting.send(:include, RailsAdminSettings::RailsAdminExtensionConfig)
11
13
  User.send(:include, ThecoreUiRailsAdminUser)
14
+ Role.send(:include, ThecoreUiRailsAdminRole)
15
+ Permission.send(:include, ThecoreUiRailsAdminPermission)
12
16
  end
13
17
  end
@@ -0,0 +1,31 @@
1
+ en:
2
+ settings:
3
+ namespaces:
4
+ main: Main
5
+ names:
6
+ app_name: Application Name
7
+ admin:
8
+ settings:
9
+ label: Settings
10
+ phone_invalid: Invalid Telephone
11
+ phones_invalid: "Invalid Telephones: %{phones}"
12
+ email_invalid: Invalid Email
13
+ yaml_invalid: Invalid Email
14
+ color_invalid: Invalid Color
15
+ mongoid: &mongoid
16
+ models:
17
+ rails_admin_settings/setting: Configurations
18
+ attributes:
19
+ rails_admin_settings/setting:
20
+ c_at: Created
21
+ u_at: Modified
22
+ enabled: Enabled
23
+ ns: Group
24
+ name: Name
25
+ key: Key
26
+ raw: Value
27
+ type: Type
28
+ kind: Type
29
+ label: Label
30
+ activerecord:
31
+ <<: *mongoid
@@ -7,7 +7,6 @@ it:
7
7
  admin:
8
8
  settings:
9
9
  label: 'Impostazioni'
10
- no_ckeditor_detected: CKEditor non trovato &mdash; mostro il campo come semplice testo
11
10
  phone_invalid: Telefono non valido
12
11
  phones_invalid: "Telefono non valido: %{phones}"
13
12
  email_invalid: Email non valida
@@ -2,7 +2,6 @@ module Abilities
2
2
  class ThecoreUiRailsAdmin
3
3
  include CanCan::Ability
4
4
  def initialize user
5
- puts "LAMMEEEEEEEEERDAAAAAAAAAAAAAAAAAAAAAAAA"
6
5
  # No one is allowed to add or destroy settings
7
6
  # just list or edit existing
8
7
  cannot :create, RailsAdminSettings::Setting
@@ -0,0 +1,32 @@
1
+ require 'active_support/concern'
2
+
3
+ module ThecoreUiRailsAdminPermission
4
+ extend ActiveSupport::Concern
5
+
6
+ included do
7
+
8
+ rails_admin do
9
+ field :predicate
10
+ field :action
11
+ field :target
12
+ list do
13
+ field :created_at
14
+ exclude_fields :lock_version
15
+ end
16
+ show do
17
+ exclude_fields :id
18
+ exclude_fields :lock_version
19
+ end
20
+ create do
21
+ field :lock_version, :hidden do
22
+ visible true
23
+ end
24
+ end
25
+ edit do
26
+ field :lock_version, :hidden do
27
+ visible true
28
+ end
29
+ end
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,36 @@
1
+ require 'active_support/concern'
2
+
3
+ module ThecoreUiRailsAdminRole
4
+ extend ActiveSupport::Concern
5
+
6
+ included do
7
+
8
+ rails_admin do
9
+ navigation_label I18n.t("admin.settings.label")
10
+ navigation_icon 'fa fa-group'
11
+ desc I18n.t("activerecord.descriptions.role")
12
+
13
+ field :name
14
+ field :permissions, :selectize
15
+ list do
16
+ field :created_at
17
+ exclude_fields :lock_version
18
+ end
19
+ show do
20
+ exclude_fields :id
21
+ exclude_fields :lock_version
22
+ end
23
+ create do
24
+ field :lock_version, :hidden do
25
+ visible true
26
+ end
27
+ # include UserRailsAdminCreateConcern
28
+ end
29
+ edit do
30
+ field :lock_version, :hidden do
31
+ visible true
32
+ end
33
+ end
34
+ end
35
+ end
36
+ end
@@ -5,73 +5,70 @@ module ThecoreUiRailsAdminUser
5
5
 
6
6
  included do
7
7
 
8
- RailsAdmin.config do |config|
9
- config.model self.name.underscore.capitalize.constantize do
10
- # rails_admin do
11
- navigation_label I18n.t("admin.settings.label")
12
- navigation_icon 'fa fa-user-circle'
13
- desc I18n.t("activerecord.descriptions.user")
14
-
15
- weight 1000
16
- # Field present Everywhere
17
- field :email do
18
- required true
8
+ rails_admin do
9
+ # rails_admin do
10
+ navigation_label I18n.t("admin.settings.label")
11
+ navigation_icon 'fa fa-user-circle'
12
+ desc I18n.t("activerecord.descriptions.user")
13
+
14
+ # Field present Everywhere
15
+ field :email do
16
+ required true
17
+ end
18
+ field :username do
19
+ required true
20
+ end
21
+ field :admin do
22
+ visible do
23
+ bindings[:view].current_user.admin? && bindings[:view].current_user.id != bindings[:object].id
19
24
  end
20
- field :username do
21
- required true
25
+ end
26
+ field :locked do
27
+ visible do
28
+ bindings[:view].current_user.admin? && bindings[:view].current_user.id != bindings[:object].id
29
+ end
30
+ end
31
+ field :roles, :selectize
32
+ # include UserRailsAdminConcern
33
+
34
+ # Fields only in lists and forms
35
+ list do
36
+ field :created_at
37
+ configure :email do
38
+ visible false
22
39
  end
23
- field :admin do
24
- visible do
25
- bindings[:view].current_user.admin? && bindings[:view].current_user.id != bindings[:object].id
26
- end
40
+ exclude_fields :lock_version
41
+ # include UserRailsAdminListConcern
42
+ end
43
+ show do
44
+ #exclude_fields :id
45
+ exclude_fields :lock_version
46
+ end
47
+ create do
48
+ field :password do
49
+ required true
27
50
  end
28
- field :locked do
29
- visible do
30
- bindings[:view].current_user.admin? && bindings[:view].current_user.id != bindings[:object].id
31
- end
51
+ field :password_confirmation do
52
+ required true
32
53
  end
33
- field :roles
34
- # include UserRailsAdminConcern
35
-
36
- # Fields only in lists and forms
37
- list do
38
- field :created_at
39
- configure :email do
40
- visible false
41
- end
42
- exclude_fields :lock_version
43
- field :authentication_token
44
- # include UserRailsAdminListConcern
54
+ field :lock_version, :hidden do
55
+ visible true
45
56
  end
46
- show do
47
- #exclude_fields :id
48
- exclude_fields :lock_version
57
+ # include UserRailsAdminCreateConcern
58
+ end
59
+ edit do
60
+ field :password do
61
+ required false
49
62
  end
50
- create do
51
- field :password do
52
- required true
53
- end
54
- field :password_confirmation do
55
- required true
56
- end
57
- field :lock_version, :hidden do
58
- visible true
59
- end
60
- # include UserRailsAdminCreateConcern
63
+ field :password_confirmation do
64
+ required false
61
65
  end
62
- edit do
63
- field :password do
64
- required false
65
- end
66
- field :password_confirmation do
67
- required false
68
- end
69
-
70
- field :lock_version, :hidden do
71
- visible true
72
- end
73
- # include UserRailsAdminEditConcern
66
+
67
+ field :lock_version, :hidden do
68
+ visible true
74
69
  end
70
+ # include UserRailsAdminEditConcern
71
+
75
72
  end
76
73
  end
77
74
  end
@@ -7,6 +7,7 @@ require 'rails_admin-i18n'
7
7
  require 'safe_yaml'
8
8
  require 'rails_admin_toggleable'
9
9
  require 'rails_admin_settings'
10
+ require 'rails_admin_selectize'
10
11
  require 'concerns/rails_admin_requirements'
11
12
  # Abilities
12
13
  require 'abilities/thecore_ui_rails_admin'
@@ -15,6 +16,8 @@ require 'jquery-ui-rails'
15
16
  require 'bootstrap-sass'
16
17
 
17
18
  require 'concerns/thecore_ui_rails_admin_user'
19
+ require 'concerns/thecore_ui_rails_admin_role'
20
+ require 'concerns/thecore_ui_rails_admin_permission'
18
21
  require 'concerns/thecore_rails_admin_export_concern'
19
22
  require 'concerns/thecore_rails_admin_bulk_delete_concern'
20
23
 
@@ -1,8 +1,5 @@
1
1
  module ThecoreUiRailsAdmin
2
2
  class Engine < ::Rails::Engine
3
- initializer :assets do |config|
4
- Rails.application.config.assets.paths << root.join("app", "assets", "stylesheets", "thecore_ui_rails_admin")
5
- end
6
3
  initializer 'thecore_ui_rails_admin.add_to_migrations' do |app|
7
4
  unless app.root.to_s.match root.to_s
8
5
  # APPEND TO MAIN APP MIGRATIONS FROM THIS GEM
@@ -1,3 +1,3 @@
1
1
  module ThecoreUiRailsAdmin
2
- VERSION = '2.1.8'
2
+ VERSION = '2.1.9'
3
3
  end
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.1.8
4
+ version: 2.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gabriele Tassoni
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-05-17 00:00:00.000000000 Z
11
+ date: 2020-05-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thecore_ui_commons
@@ -150,6 +150,20 @@ dependencies:
150
150
  - - "~>"
151
151
  - !ruby/object:Gem::Version
152
152
  version: '1.5'
153
+ - !ruby/object:Gem::Dependency
154
+ name: rails_admin_selectize
155
+ requirement: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - "~>"
158
+ - !ruby/object:Gem::Version
159
+ version: '2.0'
160
+ type: :runtime
161
+ prerelease: false
162
+ version_requirements: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - "~>"
165
+ - !ruby/object:Gem::Version
166
+ version: '2.0'
153
167
  - !ruby/object:Gem::Dependency
154
168
  name: jquery-ui-rails
155
169
  requirement: !ruby/object:Gem::Requirement
@@ -211,6 +225,7 @@ files:
211
225
  - config/locales/it.main.yml
212
226
  - config/locales/it.rails_admin.yml
213
227
  - config/locales/it.rollincode.yml
228
+ - config/locales/thecore_settings.en.yml
214
229
  - config/locales/thecore_settings.it.yml
215
230
  - config/routes.rb
216
231
  - db/migrate/20161227101954_create_rails_admin_settings.rb
@@ -219,6 +234,8 @@ files:
219
234
  - lib/concerns/rails_admin_requirements.rb
220
235
  - lib/concerns/thecore_rails_admin_bulk_delete_concern.rb
221
236
  - lib/concerns/thecore_rails_admin_export_concern.rb
237
+ - lib/concerns/thecore_ui_rails_admin_permission.rb
238
+ - lib/concerns/thecore_ui_rails_admin_role.rb
222
239
  - lib/concerns/thecore_ui_rails_admin_user.rb
223
240
  - lib/tasks/thecore_ui_rails_admin_tasks.rake
224
241
  - lib/thecore_ui_rails_admin.rb