camaleon_cms 2.5.3.1 → 2.6.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of camaleon_cms might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/app/apps/plugins/front_cache/front_cache_helper.rb +1 -1
- data/app/assets/images/camaleon_cms/language/md.png +0 -0
- data/app/models/camaleon_cms/ability.rb +94 -92
- data/app/models/camaleon_cms/category.rb +45 -44
- data/app/models/camaleon_cms/custom_field.rb +26 -25
- data/app/models/camaleon_cms/custom_field_group.rb +115 -114
- data/app/models/camaleon_cms/custom_fields_relationship.rb +21 -19
- data/app/models/camaleon_cms/media.rb +48 -44
- data/app/models/camaleon_cms/meta.rb +5 -3
- data/app/models/camaleon_cms/nav_menu.rb +27 -24
- data/app/models/camaleon_cms/nav_menu_item.rb +58 -54
- data/app/models/camaleon_cms/plugin.rb +62 -60
- data/app/models/camaleon_cms/post.rb +205 -227
- data/app/models/camaleon_cms/post_comment.rb +44 -42
- data/app/models/camaleon_cms/post_default.rb +65 -62
- data/app/models/camaleon_cms/post_relationship.rb +1 -2
- data/app/models/camaleon_cms/post_tag.rb +9 -6
- data/app/models/camaleon_cms/post_type.rb +170 -163
- data/app/models/camaleon_cms/site.rb +211 -203
- data/app/models/camaleon_cms/term_relationship.rb +16 -14
- data/app/models/camaleon_cms/term_taxonomy.rb +49 -54
- data/app/models/camaleon_cms/theme.rb +24 -23
- data/app/models/camaleon_cms/user.rb +18 -13
- data/app/models/camaleon_cms/user_role.rb +130 -128
- data/app/models/camaleon_cms/widget/assigned.rb +25 -21
- data/app/models/camaleon_cms/widget/main.rb +40 -36
- data/app/models/camaleon_cms/widget/sidebar.rb +20 -16
- data/app/validators/camaleon_cms/post_uniq_validator.rb +28 -0
- data/app/validators/camaleon_cms/uniq_validator.rb +9 -0
- data/config/locales/camaleon_cms/admin/ar.yml +1 -0
- data/config/locales/camaleon_cms/admin/de.yml +1 -0
- data/config/locales/camaleon_cms/admin/en.yml +82 -21
- data/config/locales/camaleon_cms/admin/fr.yml +1 -0
- data/config/locales/camaleon_cms/admin/it.yml +1 -0
- data/config/locales/camaleon_cms/admin/js/de.yml +51 -0
- data/config/locales/camaleon_cms/admin/js/en.yml +51 -0
- data/config/locales/camaleon_cms/admin/js/es.yml +53 -0
- data/config/locales/camaleon_cms/admin/js/it.yml +44 -0
- data/config/locales/camaleon_cms/admin/js/nl.yml +42 -0
- data/config/locales/camaleon_cms/admin/js/pt-BR.yml +44 -0
- data/config/locales/camaleon_cms/admin/js/ru.yml +51 -0
- data/config/locales/camaleon_cms/admin/js/uk.yml +51 -0
- data/config/locales/camaleon_cms/admin/js/zh-CN.yml +51 -0
- data/config/locales/camaleon_cms/admin/nl.yml +1 -0
- data/config/locales/camaleon_cms/admin/ru.yml +1 -0
- data/config/locales/camaleon_cms/admin/uk.yml +2 -1
- data/config/locales/camaleon_cms/admin/zh-CH.yml +1 -0
- data/config/locales/camaleon_cms/common.md +3 -0
- data/config/locales/camaleon_cms/common/ar.yml +66 -0
- data/config/locales/camaleon_cms/common/de.yml +66 -0
- data/config/locales/camaleon_cms/common/en.yml +63 -0
- data/config/locales/camaleon_cms/common/es.yml +66 -0
- data/config/locales/camaleon_cms/common/fr.yml +66 -0
- data/config/locales/camaleon_cms/common/it.yml +63 -0
- data/config/locales/camaleon_cms/common/md.yml +60 -0
- data/config/locales/camaleon_cms/common/nl.yml +64 -0
- data/config/locales/camaleon_cms/common/pt-BR.yml +65 -0
- data/config/locales/camaleon_cms/common/pt.yml +65 -0
- data/config/locales/camaleon_cms/common/ru.yml +66 -0
- data/config/locales/camaleon_cms/common/uk.yml +64 -0
- data/config/locales/camaleon_cms/common/zh-CN.yml +66 -0
- data/config/locales/camaleon_cms/languages/ar.yml +16 -0
- data/config/locales/camaleon_cms/languages/de.yml +16 -0
- data/config/locales/camaleon_cms/languages/en.yml +16 -0
- data/config/locales/camaleon_cms/languages/es.yml +16 -0
- data/config/locales/camaleon_cms/languages/it.yml +16 -0
- data/config/locales/camaleon_cms/languages/md.yml +15 -0
- data/config/locales/camaleon_cms/languages/nl.yml +16 -0
- data/config/locales/camaleon_cms/languages/pt-BR.yml +16 -0
- data/config/locales/camaleon_cms/languages/pt.yml +16 -0
- data/config/locales/camaleon_cms/languages/ru.yml +16 -0
- data/config/locales/camaleon_cms/languages/uk.yml +16 -0
- data/config/locales/camaleon_cms/languages/zh-CN.yml +16 -0
- data/config/locales/camaleon_cms/routes/de.yml +8 -0
- data/config/locales/camaleon_cms/routes/es.yml +8 -0
- data/config/locales/camaleon_cms/routes/fr.yml +8 -0
- data/config/locales/camaleon_cms/routes/it.yml +8 -0
- data/config/locales/camaleon_cms/routes/md.yml +8 -0
- data/config/locales/camaleon_cms/routes/pt-BR.yml +8 -0
- data/config/locales/camaleon_cms/routes/pt.yml +8 -0
- data/config/locales/camaleon_cms/routes/ru.yml +8 -0
- data/config/locales/camaleon_cms/routes/uk.yml +8 -0
- data/config/locales/camaleon_cms/routes/zh-CN.yml +8 -0
- data/config/locales/md.yml +207 -0
- data/lib/camaleon_cms/version.rb +1 -1
- data/spec/dummy/config/application.rb +14 -2
- metadata +102 -109
- data/config/locales/camaleon_cms/admin/js.yml +0 -435
- data/config/locales/camaleon_cms/common.yml +0 -786
- data/config/locales/camaleon_cms/languages.yml +0 -167
- data/config/locales/camaleon_cms/routes.yml +0 -71
- data/spec/dummy/db/development.sqlite3 +0 -0
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/log/development.log +0 -254
- data/spec/dummy/log/test.log +0 -46384
- data/spec/dummy/public/media/1/rails_tmp.png +0 -0
- data/spec/dummy/public/media/1/rails_tmp_1.png +0 -0
- data/spec/dummy/public/media/1/rails_tmp_2.png +0 -0
- data/spec/dummy/public/media/1/rails_tmp_3.png +0 -0
- data/spec/dummy/public/media/1/sample/rails_tmp.png +0 -0
- data/spec/dummy/public/media/1/sample/thumb/rails_tmp-png.png +0 -0
- data/spec/dummy/public/media/1/slide33.jpg +0 -0
- data/spec/dummy/public/media/1/thumb/rails_tmp-png.png +0 -0
- data/spec/dummy/public/media/1/thumb/rails_tmp-png_20x.png +0 -0
- data/spec/dummy/public/media/1/thumb/rails_tmp-png_300x300.png +0 -0
- data/spec/dummy/public/media/1/thumb/rails_tmp-png_505x350.png +0 -0
- data/spec/dummy/public/media/1/thumb/rails_tmp_1-png.png +0 -0
- data/spec/dummy/public/media/1/thumb/rails_tmp_2-png.png +0 -0
- data/spec/dummy/public/media/1/thumb/rails_tmp_3-png.png +0 -0
- data/spec/dummy/public/media/1/thumb/slide33-jpg.jpg +0 -0
- data/spec/dummy/tmp/capybara/screenshot_2019-09-04-09-19-13.472.html +0 -457
- data/spec/dummy/tmp/capybara/screenshot_2019-09-04-09-19-13.472.png +0 -0
- data/spec/dummy/tmp/capybara/screenshot_2019-09-04-09-19-28.693.html +0 -428
- data/spec/dummy/tmp/capybara/screenshot_2019-09-04-09-19-28.693.png +0 -0
- data/spec/dummy/tmp/capybara/screenshot_2019-09-04-09-22-45.502.html +0 -337
- data/spec/dummy/tmp/capybara/screenshot_2019-09-04-09-22-45.502.png +0 -0
- data/spec/support/fixtures/rails_tmp.png +0 -0
@@ -1,18 +1,20 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
1
|
+
module CamaleonCms
|
2
|
+
class TermRelationship < ActiveRecord::Base
|
3
|
+
self.table_name = "#{PluginRoutes.static_system_info['db_prefix']}term_relationships"
|
4
|
+
default_scope ->{ order(term_order: :asc) }
|
4
5
|
|
5
|
-
|
6
|
-
|
6
|
+
belongs_to :term_taxonomy, inverse_of: :term_relationships
|
7
|
+
belongs_to :object, ->{ order("#{CamaleonCms::Post.table_name}.id DESC") }, class_name: 'CamaleonCms::Post', foreign_key: :objectid, inverse_of: :term_relationships
|
7
8
|
|
8
|
-
|
9
|
-
|
10
|
-
|
9
|
+
# callbacks
|
10
|
+
after_create :update_count
|
11
|
+
before_destroy :update_count
|
11
12
|
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
13
|
+
private
|
14
|
+
# update counter of post published items
|
15
|
+
# TODO verify counter
|
16
|
+
def update_count
|
17
|
+
term_taxonomy.update_column('count', term_taxonomy.posts.published.size) if term_taxonomy&.try(:posts)
|
18
|
+
end
|
17
19
|
end
|
18
|
-
end
|
20
|
+
end
|
@@ -1,61 +1,56 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
1
|
+
module CamaleonCms
|
2
|
+
class TermTaxonomy < ActiveRecord::Base
|
3
|
+
include CamaleonCms::Metas
|
4
|
+
include CamaleonCms::CustomFieldsRead
|
5
|
+
|
6
|
+
self.table_name = "#{PluginRoutes.static_system_info["db_prefix"]}term_taxonomy"
|
7
|
+
# attr_accessible :taxonomy, :description, :parent_id, :count, :name, :slug, :term_group, :status, :term_order, :user_id
|
8
|
+
# attr_accessible :data_options
|
9
|
+
# attr_accessible :data_metas
|
10
|
+
|
11
|
+
# callbacks
|
12
|
+
before_validation :before_validating
|
13
|
+
before_destroy :destroy_dependencies
|
14
|
+
|
15
|
+
# validates
|
16
|
+
validates :name, :taxonomy, presence: true
|
17
|
+
validates_with CamaleonCms::UniqValidator
|
18
|
+
|
19
|
+
# relations
|
20
|
+
has_many :term_relationships, class_name: "CamaleonCms::TermRelationship", foreign_key: :term_taxonomy_id, dependent: :destroy
|
21
|
+
# has_many :posts, foreign_key: :objectid, through: :term_relationships, :source => :objects
|
22
|
+
belongs_to :parent, class_name: "CamaleonCms::TermTaxonomy", foreign_key: :parent_id
|
23
|
+
belongs_to :owner, class_name: CamaManager.get_user_class_name, foreign_key: :user_id
|
24
|
+
|
25
|
+
# return all children taxonomy
|
26
|
+
# sample: sub categories of a category
|
27
|
+
def children
|
28
|
+
CamaleonCms::TermTaxonomy.where("#{CamaleonCms::TermTaxonomy.table_name}.parent_id = ?", id)
|
5
29
|
end
|
6
|
-
end
|
7
|
-
end
|
8
|
-
class CamaleonCms::TermTaxonomy < ActiveRecord::Base
|
9
|
-
include CamaleonCms::Metas
|
10
|
-
include CamaleonCms::CustomFieldsRead
|
11
|
-
self.table_name = "#{PluginRoutes.static_system_info["db_prefix"]}term_taxonomy"
|
12
|
-
# attr_accessible :taxonomy, :description, :parent_id, :count, :name, :slug, :term_group, :status, :term_order, :user_id
|
13
|
-
# attr_accessible :data_options
|
14
|
-
# attr_accessible :data_metas
|
15
|
-
|
16
|
-
# callbacks
|
17
|
-
before_validation :before_validating
|
18
|
-
before_destroy :destroy_dependencies
|
19
|
-
|
20
|
-
# validates
|
21
|
-
validates :name, :taxonomy, presence: true
|
22
|
-
validates_with CamaleonCms::UniqValidator
|
23
|
-
|
24
|
-
# relations
|
25
|
-
has_many :term_relationships, :class_name => "CamaleonCms::TermRelationship", :foreign_key => :term_taxonomy_id, dependent: :destroy
|
26
|
-
# has_many :posts, foreign_key: :objectid, through: :term_relationships, :source => :objects
|
27
|
-
belongs_to :parent, class_name: "CamaleonCms::TermTaxonomy", foreign_key: :parent_id
|
28
|
-
belongs_to :owner, class_name: CamaManager.get_user_class_name, foreign_key: :user_id
|
29
|
-
|
30
|
-
# return all children taxonomy
|
31
|
-
# sample: sub categories of a category
|
32
|
-
def children
|
33
|
-
CamaleonCms::TermTaxonomy.where("#{CamaleonCms::TermTaxonomy.table_name}.parent_id = ?", self.id)
|
34
|
-
end
|
35
30
|
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
31
|
+
# return all menu items in which this taxonomy was assigned
|
32
|
+
def in_nav_menu_items
|
33
|
+
CamaleonCms::NavMenuItem.where(url: id, kind: taxonomy)
|
34
|
+
end
|
40
35
|
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
36
|
+
# permit to skip slug validations for children models, like menu items
|
37
|
+
def skip_slug_validation?
|
38
|
+
false
|
39
|
+
end
|
45
40
|
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
41
|
+
private
|
42
|
+
# callback before validating
|
43
|
+
def before_validating
|
44
|
+
slug = self.slug
|
45
|
+
slug = name if slug.blank?
|
46
|
+
self.name = slug if name.blank?
|
47
|
+
self.slug = slug.to_s.parameterize.try(:downcase)
|
48
|
+
end
|
54
49
|
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
50
|
+
# destroy all dependencies
|
51
|
+
# unassign all items from menus
|
52
|
+
def destroy_dependencies
|
53
|
+
in_nav_menu_items.destroy_all
|
54
|
+
end
|
59
55
|
end
|
60
|
-
|
61
56
|
end
|
@@ -1,31 +1,32 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
1
|
+
module CamaleonCms
|
2
|
+
class Theme < CamaleonCms::TermTaxonomy
|
3
|
+
# attrs:
|
4
|
+
# slug => plugin key
|
5
|
+
cama_define_common_relationships('Theme')
|
6
|
+
belongs_to :site, class_name: "CamaleonCms::Site", foreign_key: :parent_id
|
6
7
|
|
7
|
-
|
8
|
+
default_scope { where(taxonomy: :theme) }
|
8
9
|
|
9
|
-
|
10
|
-
|
10
|
+
before_validation :fix_name
|
11
|
+
before_destroy :destroy_custom_fields
|
11
12
|
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
# return theme settings configured in config.json
|
14
|
+
def settings
|
15
|
+
PluginRoutes.theme_info(slug)
|
16
|
+
end
|
16
17
|
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
18
|
+
# return the path to the settings file for current theme
|
19
|
+
def settings_file
|
20
|
+
File.join(self.settings["path"], "views/admin/settings").to_s
|
21
|
+
end
|
21
22
|
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
23
|
+
private
|
24
|
+
def fix_name
|
25
|
+
self.name = slug if name.blank?
|
26
|
+
end
|
26
27
|
|
27
|
-
|
28
|
-
|
28
|
+
def destroy_custom_fields
|
29
|
+
get_field_groups.destroy_all
|
30
|
+
end
|
29
31
|
end
|
30
|
-
|
31
32
|
end
|
@@ -1,18 +1,23 @@
|
|
1
1
|
unless PluginRoutes.static_system_info['user_model'].present?
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
default_scope {order(role: :asc)}
|
6
|
-
validates :username, :presence => true
|
7
|
-
validates :email, :presence => true, :format => { :with => /\A[\w+\-.]+@[a-z\d\-.]+\.[a-z]+\z/i } #, :unless => Proc.new { |a| a.auth_social.present? }
|
8
|
-
has_secure_password
|
2
|
+
module CamaleonCms
|
3
|
+
class User < ActiveRecord::Base
|
4
|
+
include CamaleonCms::UserMethods
|
9
5
|
|
10
|
-
|
11
|
-
|
12
|
-
|
6
|
+
self.table_name = PluginRoutes.static_system_info['cama_users_db_table'] || "#{PluginRoutes.static_system_info['db_prefix']}users"
|
7
|
+
|
8
|
+
default_scope { order(role: :asc) }
|
9
|
+
|
10
|
+
validates :username, presence: true
|
11
|
+
validates :email, presence: true, format: { with: /\A[\w+\-.]+@[a-z\d\-.]+\.[a-z]+\z/i } #, :unless => Proc.new { |a| a.auth_social.present? }
|
12
|
+
has_secure_password
|
13
|
+
|
14
|
+
def self.find_by_email(email)
|
15
|
+
where(['lower(email) = ?', email.to_s.downcase]).take
|
16
|
+
end
|
13
17
|
|
14
|
-
|
15
|
-
|
18
|
+
def self.find_by_username(username)
|
19
|
+
where(['lower(username) = ?', username.to_s.downcase]).take
|
20
|
+
end
|
16
21
|
end
|
17
22
|
end
|
18
|
-
end
|
23
|
+
end
|
@@ -1,138 +1,140 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
module CamaleonCms
|
2
|
+
class UserRole < CamaleonCms::TermTaxonomy
|
3
|
+
after_destroy :set_users_as_cilent
|
3
4
|
|
4
|
-
|
5
|
-
|
6
|
-
|
5
|
+
default_scope { where(taxonomy: :user_roles) }
|
6
|
+
cama_define_common_relationships('UserRole')
|
7
|
+
belongs_to :site, class_name: 'CamaleonCms::Site', foreign_key: :parent_id
|
7
8
|
|
8
|
-
|
9
|
-
|
10
|
-
|
9
|
+
def roles_post_type
|
10
|
+
self.get_meta('_post_type')
|
11
|
+
end
|
11
12
|
|
12
|
-
|
13
|
-
|
14
|
-
|
13
|
+
def roles_manager
|
14
|
+
self.get_meta('_manager')
|
15
|
+
end
|
15
16
|
|
16
|
-
|
17
|
-
|
18
|
-
|
17
|
+
def editable?
|
18
|
+
term_group.nil?
|
19
|
+
end
|
19
20
|
|
20
21
|
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
22
|
+
ROLES = {
|
23
|
+
post_type: [
|
24
|
+
{
|
25
|
+
key: 'edit',
|
26
|
+
label: "#{I18n.t('camaleon_cms.admin.users.roles_values.html_create_or_edit')}",
|
27
|
+
color: 'success',
|
28
|
+
description: "#{I18n.t('camaleon_cms.admin.users.tool_tip.create_or_edit')}"
|
29
|
+
},
|
30
|
+
{
|
31
|
+
key: 'edit_other',
|
32
|
+
label: "#{I18n.t('camaleon_cms.admin.users.roles_values.html_edit_other')}",
|
33
|
+
color: 'success',
|
34
|
+
description: "#{I18n.t('camaleon_cms.admin.users.tool_tip.edit_other')}"
|
35
|
+
},
|
36
|
+
{
|
37
|
+
key: 'edit_publish',
|
38
|
+
label: "#{I18n.t('camaleon_cms.admin.users.roles_values.html_edit_publish')}",
|
39
|
+
color: 'success',
|
40
|
+
description: "#{I18n.t('camaleon_cms.admin.users.tool_tip.edit_publish')}"
|
41
|
+
},
|
42
|
+
{
|
43
|
+
key: 'publish',
|
44
|
+
label: "#{I18n.t('camaleon_cms.admin.users.roles_values.publish')}",
|
45
|
+
color: 'success',
|
46
|
+
description: "#{I18n.t('camaleon_cms.admin.users.tool_tip.publish')}"
|
47
|
+
},
|
48
|
+
{
|
49
|
+
key: 'delete',
|
50
|
+
label: "#{I18n.t('camaleon_cms.admin.button.delete')}",
|
51
|
+
color: 'danger',
|
52
|
+
description: "#{I18n.t('camaleon_cms.admin.users.tool_tip.delete')}"
|
53
|
+
},
|
54
|
+
{
|
55
|
+
key: 'delete_other',
|
56
|
+
label: "#{I18n.t('camaleon_cms.admin.users.roles_values.html_delete_other')}",
|
57
|
+
color: 'danger',
|
58
|
+
description: "#{I18n.t('camaleon_cms.admin.users.tool_tip.delete_other')}"
|
59
|
+
},
|
60
|
+
{
|
61
|
+
key: 'delete_publish',
|
62
|
+
label: "#{I18n.t('camaleon_cms.admin.users.roles_values.html_delete_publish')}",
|
63
|
+
color: 'danger',
|
64
|
+
description: "#{I18n.t('camaleon_cms.admin.users.tool_tip.delete_publish')}"
|
65
|
+
},
|
66
|
+
#{
|
67
|
+
# key: 'read_private',
|
68
|
+
# label: "#{I18n.t('camaleon_cms.admin.users.roles_values.html_read_private')}",
|
69
|
+
# color: 'info',
|
70
|
+
# description: "#{I18n.t('camaleon_cms.admin.users.tool_tip.read_private')}"
|
71
|
+
#},
|
72
|
+
{
|
73
|
+
key: 'manage_categories',
|
74
|
+
label: "#{I18n.t('camaleon_cms.admin.users.roles_values.html_manage_categories')}",
|
75
|
+
color: 'warning',
|
76
|
+
description: "#{I18n.t('camaleon_cms.admin.users.tool_tip.manage_categories')}"
|
77
|
+
},
|
78
|
+
{
|
79
|
+
key: 'manage_tags',
|
80
|
+
label: "#{I18n.t('camaleon_cms.admin.users.roles_values.html_manage_tags')}",
|
81
|
+
color: 'warning',
|
82
|
+
description: "#{I18n.t('camaleon_cms.admin.users.tool_tip.manage_tags')}"
|
83
|
+
}
|
84
|
+
],
|
85
|
+
manager: [
|
86
|
+
{
|
87
|
+
key: 'media',
|
88
|
+
label: "#{I18n.t('camaleon_cms.admin.users.roles_values.media')}",
|
89
|
+
description: "#{I18n.t('camaleon_cms.admin.users.tool_tip.media')}"
|
90
|
+
},
|
91
|
+
{
|
92
|
+
key: 'comments',
|
93
|
+
label: "#{I18n.t('camaleon_cms.admin.users.roles_values.comments')}",
|
94
|
+
description: "#{I18n.t('camaleon_cms.admin.users.tool_tip.comments')}"
|
95
|
+
},
|
96
|
+
{
|
97
|
+
key: 'themes',
|
98
|
+
label: "#{I18n.t('camaleon_cms.admin.users.roles_values.themes')}",
|
99
|
+
description: "#{I18n.t('camaleon_cms.admin.users.tool_tip.themes')}"
|
100
|
+
},
|
101
|
+
{
|
102
|
+
key: 'widgets',
|
103
|
+
label: "#{I18n.t('camaleon_cms.admin.sidebar.widgets')}",
|
104
|
+
description: "#{I18n.t('camaleon_cms.admin.users.tool_tip.widgets')}"
|
105
|
+
},
|
106
|
+
{
|
107
|
+
key: 'nav_menu',
|
108
|
+
label: "#{I18n.t('camaleon_cms.admin.sidebar.menus')}",
|
109
|
+
description: "#{I18n.t('camaleon_cms.admin.users.tool_tip.menus')}"
|
110
|
+
},
|
111
|
+
{
|
112
|
+
key: 'plugins',
|
113
|
+
label: "#{I18n.t('camaleon_cms.admin.sidebar.plugins')}",
|
114
|
+
description: "#{I18n.t('camaleon_cms.admin.users.tool_tip.plugins')}"
|
115
|
+
},
|
116
|
+
{
|
117
|
+
key: 'users',
|
118
|
+
label: "#{I18n.t('camaleon_cms.admin.sidebar.users')}",
|
119
|
+
description: "#{I18n.t('camaleon_cms.admin.users.tool_tip.users')}"
|
120
|
+
},
|
121
|
+
{
|
122
|
+
key: 'settings',
|
123
|
+
label: "#{I18n.t('camaleon_cms.admin.sidebar.settings')}",
|
124
|
+
description: "#{I18n.t('camaleon_cms.admin.users.tool_tip.settings')}"
|
125
|
+
},
|
126
|
+
{
|
127
|
+
key: 'theme_settings',
|
128
|
+
label: "#{I18n.t('camaleon_cms.admin.settings.theme_setting', default: 'Theme Settings')}",
|
129
|
+
description: "#{I18n.t('camaleon_cms.admin.users.tool_tip.themes')}"
|
130
|
+
}
|
131
|
+
]
|
132
|
+
}
|
132
133
|
|
133
|
-
|
134
|
+
private
|
134
135
|
|
135
|
-
|
136
|
-
|
136
|
+
def set_users_as_cilent
|
137
|
+
site.users.where(role: slug).update_all(role: 'client')
|
138
|
+
end
|
137
139
|
end
|
138
140
|
end
|