camaleon_cms 2.0.1 → 2.0.2
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/README.md +1 -1
- data/app/apps/themes/new/views/index.html.erb +1 -0
- data/app/assets/fonts/camaleon_cms/glyphicons-halflings-regular.eot +0 -0
- data/app/assets/fonts/camaleon_cms/glyphicons-halflings-regular.svg +273 -214
- data/app/assets/fonts/camaleon_cms/glyphicons-halflings-regular.ttf +0 -0
- data/app/assets/fonts/camaleon_cms/glyphicons-halflings-regular.woff +0 -0
- data/app/assets/fonts/camaleon_cms/glyphicons-halflings-regular.woff2 +0 -0
- data/app/assets/javascripts/camaleon_cms/admin/_libraries.js +11 -2
- data/app/assets/javascripts/camaleon_cms/admin/_post.js +1 -1
- data/app/assets/stylesheets/camaleon_cms/bootstrap.min.css.scss +6796 -2
- data/app/controllers/camaleon_cms/admin/appearances/widgets/assign_controller.rb +13 -4
- data/app/controllers/camaleon_cms/admin/appearances/widgets/main_controller.rb +8 -4
- data/app/controllers/camaleon_cms/admin/appearances/widgets/sidebar_controller.rb +8 -3
- data/app/controllers/camaleon_cms/admin/posts/drafts_controller.rb +11 -18
- data/app/controllers/camaleon_cms/admin/posts_controller.rb +16 -17
- data/app/controllers/camaleon_cms/admin/sessions_controller.rb +10 -16
- data/app/controllers/camaleon_cms/admin/settings/custom_fields_controller.rb +14 -10
- data/app/controllers/camaleon_cms/admin/settings/post_types_controller.rb +10 -7
- data/app/controllers/camaleon_cms/admin/settings/sites_controller.rb +2 -1
- data/app/controllers/camaleon_cms/frontend_controller.rb +8 -9
- data/app/controllers/concerns/camaleon_cms/frontend_concern.rb +1 -1
- data/app/decorators/camaleon_cms/application_decorator.rb +1 -1
- data/app/decorators/camaleon_cms/custom_field_decorator.rb +0 -6
- data/app/decorators/camaleon_cms/metas_decorator_methods.rb +1 -1
- data/app/decorators/camaleon_cms/plugin_decorator.rb +11 -0
- data/app/decorators/camaleon_cms/post_decorator.rb +0 -11
- data/app/decorators/camaleon_cms/post_type_decorator.rb +1 -1
- data/app/decorators/camaleon_cms/site_decorator.rb +4 -2
- data/app/decorators/camaleon_cms/term_taxonomy_decorator.rb +12 -16
- data/app/decorators/camaleon_cms/user_decorator.rb +0 -6
- data/app/helpers/camaleon_cms/admin/menus_helper.rb +1 -1
- data/app/helpers/camaleon_cms/camaleon_helper.rb +1 -1
- data/app/helpers/camaleon_cms/frontend/nav_menu_helper.rb +2 -1
- data/app/helpers/camaleon_cms/html_helper.rb +14 -1
- data/app/helpers/camaleon_cms/session_helper.rb +32 -0
- data/app/helpers/camaleon_cms/short_code_helper.rb +2 -2
- data/app/helpers/camaleon_cms/site_helper.rb +3 -4
- data/app/helpers/camaleon_cms/uploader_helper.rb +7 -5
- data/app/mailers/camaleon_cms/html_mailer.rb +4 -0
- data/app/models/camaleon_cms/ability.rb +9 -14
- data/app/models/camaleon_cms/category.rb +1 -2
- data/app/models/camaleon_cms/custom_field_group.rb +1 -1
- data/app/models/camaleon_cms/plugin.rb +4 -1
- data/app/models/camaleon_cms/post.rb +7 -0
- data/app/models/camaleon_cms/post_default.rb +7 -0
- data/app/models/camaleon_cms/post_type.rb +6 -4
- data/app/models/camaleon_cms/site.rb +2 -1
- data/app/models/camaleon_cms/term_taxonomy.rb +1 -0
- data/app/models/concerns/camaleon_cms/custom_fields_read.rb +8 -6
- data/app/models/concerns/camaleon_cms/metas.rb +2 -2
- data/app/views/camaleon_cms/admin/appearances/nav_menus/_custom_menus.html.erb +1 -1
- data/app/views/camaleon_cms/admin/appearances/themes/index.html.erb +1 -2
- data/app/views/camaleon_cms/admin/posts/_sidebar.html.erb +2 -2
- data/app/views/camaleon_cms/admin/posts/form.html.erb +1 -1
- data/app/views/camaleon_cms/admin/posts/index.html.erb +2 -1
- data/app/views/camaleon_cms/admin/sessions/login.html.erb +1 -1
- data/app/views/camaleon_cms/admin/settings/_file_system_settings.html.erb +4 -0
- data/app/views/camaleon_cms/admin/settings/custom_fields/index.html.erb +1 -1
- data/app/views/camaleon_cms/admin/settings/site.html.erb +11 -4
- data/app/views/camaleon_cms/default_theme/category.html.erb +1 -1
- data/app/views/camaleon_cms/default_theme/index.html.erb +1 -1
- data/app/views/camaleon_cms/default_theme/layouts/cama_ajax.html.erb +1 -0
- data/app/views/camaleon_cms/default_theme/partials/_categories_list.html.erb +1 -1
- data/app/views/camaleon_cms/default_theme/partials/_post_list_item.html.erb +1 -1
- data/app/views/camaleon_cms/default_theme/partials/_sidebar.html.erb +1 -1
- data/app/views/camaleon_cms/default_theme/post_type.html.erb +1 -1
- data/app/views/camaleon_cms/default_theme/single.html.erb +1 -1
- data/app/views/layouts/camaleon_cms/admin.html.erb +3 -0
- data/config/initializers/action_view.rb +6 -2
- data/config/locales/camaleon_cms/admin/en.yml +1 -0
- data/config/routes/frontend.rb +11 -8
- data/config/system.json +1 -1
- data/lib/camaleon_cms/engine.rb +1 -1
- data/lib/camaleon_cms/version.rb +1 -1
- data/lib/generators/camaleon_cms/gem_plugin_template/config/camaleon_plugin.json +0 -4
- data/lib/generators/camaleon_cms/gem_plugin_template/config/custom_models.rb +3 -0
- data/lib/generators/camaleon_cms/theme_template/app/apps/themes/my_theme/views/admin/settings.html.erb +1 -3
- data/lib/plugin_routes.rb +4 -4
- data/lib/tasks/camaleon_cms/rspec_test.rake +2 -1
- metadata +7 -13
- data/app/apps/themes/new/data.json +0 -1
- data/app/apps/themes/new/views/partials/_breadcrumb.html.erb +0 -10
- data/app/apps/themes/new/views/partials/_categories_list.html.erb +0 -23
- data/app/apps/themes/new/views/partials/_comments.html.erb +0 -32
- data/app/apps/themes/new/views/partials/_comments_list.html.erb +0 -21
- data/app/apps/themes/new/views/partials/_flash_messages.html.erb +0 -26
- data/app/apps/themes/new/views/partials/_forms.html.erb +0 -19
- data/app/apps/themes/new/views/partials/_post_list_item.html.erb +0 -13
- data/app/apps/themes/new/views/partials/_search_form.html.erb +0 -9
- data/app/apps/themes/new/views/partials/_sidebar.html.erb +0 -60
@@ -13,10 +13,9 @@ class CamaleonCms::Category < CamaleonCms::TermTaxonomy
|
|
13
13
|
default_scope { where(taxonomy: :category) }
|
14
14
|
has_many :metas, ->{ where(object_class: 'Category')}, :class_name => "CamaleonCms::Meta", foreign_key: :objectid, dependent: :destroy
|
15
15
|
has_many :posts, foreign_key: :objectid, through: :term_relationships, :source => :objects
|
16
|
-
has_many :children, class_name: "CamaleonCms::Category", foreign_key: :parent_id
|
16
|
+
has_many :children, class_name: "CamaleonCms::Category", foreign_key: :parent_id, dependent: :destroy
|
17
17
|
belongs_to :parent, class_name: "CamaleonCms::Category", foreign_key: :parent_id
|
18
18
|
belongs_to :post_type_parent, class_name: "CamaleonCms::PostType", foreign_key: :parent_id
|
19
|
-
belongs_to :owner, class_name: "CamaleonCms::User", foreign_key: :user_id
|
20
19
|
|
21
20
|
scope :no_empty, ->{ where("count > 0") } # return all categories that contains at least one post
|
22
21
|
scope :empty, ->{ where(count: [0,nil]) } # return all categories that does not contain any post
|
@@ -85,7 +85,7 @@ class CamaleonCms::CustomFieldGroup < CamaleonCms::CustomField
|
|
85
85
|
when 'Widget::Main'
|
86
86
|
caption = "Fields for Widget <b>(#{CamaleonCms::Widget::Main.find(self.objectid).name.translate})</b>"
|
87
87
|
when 'Theme'
|
88
|
-
caption = "Field settings for Theme <b>(#{self.objectid})</b>"
|
88
|
+
caption = "Field settings for Theme <b>(#{self.site.themes.find(self.objectid).name rescue self.objectid})</b>"
|
89
89
|
when 'NavMenu'
|
90
90
|
caption = "Field settings for Menus <b>(#{CamaleonCms::NavMenu.find(self.objectid).name})</b>"
|
91
91
|
when 'Site'
|
@@ -44,7 +44,8 @@ class CamaleonCms::Plugin < CamaleonCms::TermTaxonomy
|
|
44
44
|
# check if current installation version is older
|
45
45
|
# return boolean
|
46
46
|
def old_version?
|
47
|
-
self.installed_version.to_s != self.settings["version"].to_s
|
47
|
+
# self.installed_version.to_s != self.settings["version"].to_s
|
48
|
+
false
|
48
49
|
end
|
49
50
|
|
50
51
|
# set a new installation version for this plugin
|
@@ -54,6 +55,7 @@ class CamaleonCms::Plugin < CamaleonCms::TermTaxonomy
|
|
54
55
|
|
55
56
|
# return gem installed version
|
56
57
|
def installed_version
|
58
|
+
return ""
|
57
59
|
res = self.get_option("version_installed")
|
58
60
|
unless res.present? # fix for old installations
|
59
61
|
res = self.settings["version"]
|
@@ -62,6 +64,7 @@ class CamaleonCms::Plugin < CamaleonCms::TermTaxonomy
|
|
62
64
|
res
|
63
65
|
end
|
64
66
|
|
67
|
+
# return the title of this plugin
|
65
68
|
def title
|
66
69
|
PluginRoutes.plugin_info(self.slug)["title"]
|
67
70
|
end
|
@@ -126,6 +126,13 @@ class CamaleonCms::Post < CamaleonCms::PostDefault
|
|
126
126
|
get_option('has_comments', (posttype || self.post_type).get_option('has_comments', false))
|
127
127
|
end
|
128
128
|
|
129
|
+
# check if the post can be commented
|
130
|
+
# sample: @post.can_commented?
|
131
|
+
# return Boolean (true/false)
|
132
|
+
def can_commented?
|
133
|
+
manage_comments? && get_meta('has_comments').to_s == "1"
|
134
|
+
end
|
135
|
+
|
129
136
|
# define post configuration for current post
|
130
137
|
# possible key values (String):
|
131
138
|
# has_content, boolean (default true)
|
@@ -64,6 +64,13 @@ class CamaleonCms::PostDefault < ActiveRecord::Base
|
|
64
64
|
CamaleonCms::NavMenuItem.joins(:metas).where("value LIKE ?","%\"object_id\":\"#{self.id}\"%").where("value LIKE ?","%\"type\":\"post\"%").readonly(false)
|
65
65
|
end
|
66
66
|
|
67
|
+
# Set the meta, field values and the post keywords here
|
68
|
+
def set_params(meta, field_options, post_data_keywords)
|
69
|
+
self.set_meta_from_form(meta)
|
70
|
+
self.set_field_values(field_options)
|
71
|
+
self.set_option("keywords", post_data_keywords)
|
72
|
+
end
|
73
|
+
|
67
74
|
private
|
68
75
|
def before_validating
|
69
76
|
#self.slug = self.title if self.slug.blank?
|
@@ -22,6 +22,7 @@ class CamaleonCms::PostType < CamaleonCms::TermTaxonomy
|
|
22
22
|
scope :hidden_menu, -> {where(term_group: -1)}
|
23
23
|
before_destroy :destroy_field_groups
|
24
24
|
after_create :set_default_site_user_roles
|
25
|
+
before_update :default_category
|
25
26
|
|
26
27
|
# check if current post type manage categories
|
27
28
|
def manage_categories?
|
@@ -159,10 +160,11 @@ class CamaleonCms::PostType < CamaleonCms::TermTaxonomy
|
|
159
160
|
|
160
161
|
# destroy all custom field groups assigned to this post type
|
161
162
|
def destroy_field_groups
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
163
|
+
# TODO: CHANGE TO SUPPORT DESTROY FOR SITE DESTROY
|
164
|
+
# if self.slug == "post" || self.slug == "page"
|
165
|
+
# errors.add(:base, "This post type can not be deleted.")
|
166
|
+
# return false
|
167
|
+
# end
|
166
168
|
self.get_field_groups.destroy_all
|
167
169
|
end
|
168
170
|
|
@@ -111,7 +111,7 @@ class CamaleonCms::Site < CamaleonCms::TermTaxonomy
|
|
111
111
|
|
112
112
|
# security: user register form show captcha?
|
113
113
|
def security_user_register_captcha_enabled?
|
114
|
-
get_option('security_captcha_user_register',
|
114
|
+
get_option('security_captcha_user_register', false) == true
|
115
115
|
end
|
116
116
|
|
117
117
|
# auto create default user roles
|
@@ -192,6 +192,7 @@ class CamaleonCms::Site < CamaleonCms::TermTaxonomy
|
|
192
192
|
end
|
193
193
|
end
|
194
194
|
|
195
|
+
# return all users including administrators
|
195
196
|
def users_include_admins
|
196
197
|
if PluginRoutes.system_info["users_share_sites"]
|
197
198
|
CamaleonCms::User.where(site_id: -1)
|
@@ -34,6 +34,7 @@ class CamaleonCms::TermTaxonomy < ActiveRecord::Base
|
|
34
34
|
has_many :term_relationships, :class_name => "CamaleonCms::TermRelationship", :foreign_key => :term_taxonomy_id, dependent: :destroy
|
35
35
|
has_many :posts, foreign_key: :objectid, through: :term_relationships, :source => :objects
|
36
36
|
belongs_to :parent, class_name: "CamaleonCms::TermTaxonomy", foreign_key: :parent_id
|
37
|
+
belongs_to :owner, class_name: "CamaleonCms::User", foreign_key: :user_id
|
37
38
|
has_many :user_relationships, :class_name => "CamaleonCms::UserRelationship", :foreign_key => :term_taxonomy_id, dependent: :destroy
|
38
39
|
has_many :users, through: :user_relationships, :source => :user
|
39
40
|
|
@@ -107,15 +107,17 @@ module CamaleonCms::CustomFieldsRead extend ActiveSupport::Concern
|
|
107
107
|
fields.to_sym
|
108
108
|
end
|
109
109
|
|
110
|
-
# return all custom fields
|
111
|
-
|
110
|
+
# return all custom fields for current element
|
111
|
+
# {my_field_slug: {options: {}, values: [], name: '', ...} }
|
112
|
+
# deprecated f attribute
|
113
|
+
def get_fields_object(f=true)
|
112
114
|
fields = {}
|
113
115
|
self.field_values.to_a.uniq.each do |field_value|
|
114
116
|
custom_field = field_value.custom_fields
|
115
|
-
if
|
116
|
-
|
117
|
-
|
118
|
-
end
|
117
|
+
# if custom_field.options[:show_frontend].to_s.to_bool
|
118
|
+
values = custom_field.values.where(objectid: self.id).pluck(:value)
|
119
|
+
fields[field_value.custom_field_slug] = custom_field.attributes.merge(options: custom_field.options, values: custom_field.options[:multiple].to_s.to_bool ? values : values.first)
|
120
|
+
# end
|
119
121
|
end
|
120
122
|
fields.to_sym
|
121
123
|
end
|
@@ -11,7 +11,7 @@ module CamaleonCms::Metas extend ActiveSupport::Concern
|
|
11
11
|
# options and metas auto save support
|
12
12
|
attr_accessor :data_options
|
13
13
|
attr_accessor :data_metas
|
14
|
-
|
14
|
+
after_create :save_metas_options, unless: :save_metas_options_skip
|
15
15
|
before_update :fix_save_metas_options_no_changed
|
16
16
|
|
17
17
|
has_many :metas, ->(object){where(object_class: object.class.to_s.gsub("Decorator","").gsub("CamaleonCms::", ""))}, :class_name => "CamaleonCms::Meta", foreign_key: :objectid, dependent: :destroy
|
@@ -101,7 +101,7 @@ module CamaleonCms::Metas extend ActiveSupport::Concern
|
|
101
101
|
|
102
102
|
# fix to save options and metas when a model was not changed
|
103
103
|
def fix_save_metas_options_no_changed
|
104
|
-
save_metas_options unless self.changed?
|
104
|
+
save_metas_options #unless self.changed?
|
105
105
|
end
|
106
106
|
|
107
107
|
# save all settings for this post type received in data_options and data_metas attribute (options and metas)
|
@@ -15,7 +15,7 @@
|
|
15
15
|
<% r[:custom_menus].each do |k, item| %>
|
16
16
|
<li>
|
17
17
|
<label class="class_slug">
|
18
|
-
<input type="checkbox" value="<%= item[:
|
18
|
+
<input type="checkbox" value="<%= item[:link] %>"> <%= item[:title] %>
|
19
19
|
</label>
|
20
20
|
</li>
|
21
21
|
<% end %>
|
@@ -31,7 +31,7 @@
|
|
31
31
|
</div>
|
32
32
|
<div class="panel-body" style="min-height: 120px;">
|
33
33
|
<h3><%= theme[:name] %></h3>
|
34
|
-
<
|
34
|
+
<div><%= raw theme[:description] %></div>
|
35
35
|
</div>
|
36
36
|
<div class="panel-footer text-muted text-right">
|
37
37
|
<% if current_theme.slug == theme[:key] && params[:set].nil? %>
|
@@ -43,7 +43,6 @@
|
|
43
43
|
<%= raw r[:links].join(" | ") %>
|
44
44
|
<span class="btn btn-success"><%= t('camaleon_cms.admin.button.actived').upcase %></span>
|
45
45
|
<% else %>
|
46
|
-
<!--<a href="<%= "#{preview_cama_admin_appearances_themes_path(ccc_theme_preview: theme[:key])}" %>" title="<%= t('camaleon_cms.admin.button.preview') %>" class="btn btn-info preview_link"><%= t('camaleon_cms.admin.button.preview') %></a>-->
|
47
46
|
<a href="<%= current_site.the_url(ccc_theme_preview: theme[:key])%>" title="<%= t('camaleon_cms.admin.button.preview') %>" class="btn btn-info preview_link"><%= t('camaleon_cms.admin.button.preview') %></a>
|
48
47
|
<a href="<%= cama_admin_appearances_themes_path(set: theme[:key]) %>" class="btn btn-primary"><%= t('camaleon_cms.admin.button.select')%></a>
|
49
48
|
<% end %>
|
@@ -66,9 +66,9 @@
|
|
66
66
|
<% end %>
|
67
67
|
|
68
68
|
<!-- has comments? -->
|
69
|
-
<% if @
|
69
|
+
<% if @post.manage_comments?(@post_type) %>
|
70
70
|
<div class="form-group">
|
71
|
-
<label class="control-label"><%= check_box("meta", "has_comments", {checked: ( params[:meta][:has_comments] == '1' rescue false || @post.
|
71
|
+
<label class="control-label"><%= check_box("meta", "has_comments", {checked: ( params[:meta][:has_comments] == '1' rescue false || @post.can_commented?) }) %> <%= t('camaleon_cms.admin.post_type.permit_comments')%></label>
|
72
72
|
</div>
|
73
73
|
<% end %>
|
74
74
|
<%= raw @post_form_extra_settings.join("") if @post_form_extra_settings.present? %>
|
@@ -82,7 +82,7 @@
|
|
82
82
|
post_id: '<%= @post.draft? ? (@post.parent.present? ? @post.parent.id : nil) : @post.id %>',
|
83
83
|
post_draft_id: '<%= @post.id if @post.draft? %>',
|
84
84
|
post_status: '<%= @post.status %>',
|
85
|
-
_post_path: '<%=
|
85
|
+
_post_path: '<%= @post_type.posts.new({slug: '__-__', locale: '____'}).decorate.the_url() %>',
|
86
86
|
_drafts_path: '<%= (@post.draft? && !@post.new_record?) ? cama_admin_post_type_draft_path(@post_type.id, @post) : cama_admin_post_type_drafts_path(@post_type.id) %>',
|
87
87
|
_posts_path: '<%= cama_admin_post_type_posts_path(@post_type.id) %>',
|
88
88
|
_ajax_path: '<%= ajax_cama_admin_post_type_posts_path(@post_type.id) %>',
|
@@ -3,7 +3,8 @@
|
|
3
3
|
<div class="row">
|
4
4
|
<div class="col-md-12">
|
5
5
|
<h4 class="pull-left"><%= t('camaleon_cms.admin.page_title.list_of') %> <%= @post_type.the_title.pluralize %>
|
6
|
-
|
6
|
+
<b>(slug = <%= @post_type.the_slug %>)</b> <%= link_to("<i class='fa fa-eye'></i> #{t("camaleon_cms.common.visit")}".html_safe, @post_type.the_url, class: 'btn btn-xs', target: '_blank') %>
|
7
|
+
</h4>
|
7
8
|
<%= link_to raw("<i class='fa fa-plus'></i> #{t('camaleon_cms.admin.post_type.add')} #{@post_type.the_title}"), {action: :new}, class: "btn btn-primary pull-right cama_ajax_request" if can? :create_post, @post_type %>
|
8
9
|
</div>
|
9
10
|
</div>
|
@@ -35,7 +35,7 @@
|
|
35
35
|
<hr>
|
36
36
|
|
37
37
|
<%= raw cama_content_before_draw %>
|
38
|
-
<%= r = {html: ""}; hooks_run("user_login_form", r); raw(r[:html]); %>
|
38
|
+
<%= r = {html: "", f: f}; hooks_run("user_login_form", r); raw(r[:html]); %>
|
39
39
|
|
40
40
|
<div class="row">
|
41
41
|
<% if current_site.get_option('permit_create_account', false) %>
|
@@ -20,4 +20,8 @@
|
|
20
20
|
<%= label_tag t('camaleon_cms.admin.settings.filesystem_region') %><br>
|
21
21
|
<%= text_field :options, :filesystem_region, :class => "form-control required", value: @site.get_option("filesystem_region") %>
|
22
22
|
</div>
|
23
|
+
<div class="form-group">
|
24
|
+
<%= label_tag t('camaleon_cms.admin.settings.filesystem_s3_endpoint') %><br>
|
25
|
+
<%= text_field :options, :filesystem_s3_endpoint, :class => "form-control required", value: @site.get_option("filesystem_s3_endpoint") %>
|
26
|
+
</div>
|
23
27
|
</div>
|
@@ -32,7 +32,7 @@
|
|
32
32
|
<td><%= f.slug %></td>
|
33
33
|
<td><%= f.name %></td>
|
34
34
|
<td><%= f.description %></td>
|
35
|
-
<td><%= raw
|
35
|
+
<td><%= link_to(raw(f.get_caption), {action: :index, c: f.object_class, id: f.objectid}) %></td>
|
36
36
|
<td>
|
37
37
|
<%= link_to raw('<i class="fa fa-pencil"></i>'), {action: :edit, id: f.id }, class: "btn btn-default btn-xs cama_ajax_request", title: "#{t('camaleon_cms.admin.button.edit')}" %>
|
38
38
|
<%= link_to raw('<i class="fa fa-times"></i>'), { action: :destroy, id: f.id },
|
@@ -1,5 +1,7 @@
|
|
1
1
|
<%
|
2
|
-
groups = @site.get_field_groups
|
2
|
+
groups = @site.get_field_groups
|
3
|
+
theme_field_groups = current_theme.get_field_groups
|
4
|
+
show_theme_tab = (theme_field_groups.present? || File.exist?(current_theme.settings_file)) ? true : false
|
3
5
|
%>
|
4
6
|
<!-- PAGE CONTENT WRAPPER -->
|
5
7
|
<div class="page-content-wrap">
|
@@ -21,7 +23,7 @@
|
|
21
23
|
<a data-toggle="tab" role="tab" href="#tab-other-configuration" aria-expanded="false"><%= t('camaleon_cms.admin.post_type.other_configuration') %></a>
|
22
24
|
</li>
|
23
25
|
<% end %>
|
24
|
-
<% if
|
26
|
+
<% if show_theme_tab %>
|
25
27
|
<li class="<%= "active" if "theme" == params[:tab] %>">
|
26
28
|
<a data-toggle="tab" role="tab" href="#tab-theme-configuration" aria-expanded="false"><%= t('camaleon_cms.admin.settings.theme_setting') %></a>
|
27
29
|
</li>
|
@@ -70,9 +72,14 @@
|
|
70
72
|
<%= render partial: "camaleon_cms/admin/settings/custom_fields/render", locals: {record: @site, field_groups: groups} %>
|
71
73
|
</div>
|
72
74
|
<% end %>
|
73
|
-
<% if
|
75
|
+
<% if show_theme_tab %>
|
74
76
|
<div id="tab-theme-configuration" class="<%= "active" if "theme" == params[:tab] %> tab-pane">
|
75
|
-
|
77
|
+
<% if File.exist?(current_theme.settings_file) %>
|
78
|
+
<%= render file: current_theme.settings_file %>
|
79
|
+
<%= render(partial: "camaleon_cms/admin/settings/custom_fields/render", locals: {record: current_theme, field_groups: theme_field_groups}) unless File.read(current_theme.settings_file).include?('.get_field_groups') %>
|
80
|
+
<% else %>
|
81
|
+
<%= render partial: "camaleon_cms/admin/settings/custom_fields/render", locals: {record: current_theme, field_groups: theme_field_groups} %>
|
82
|
+
<% end %>
|
76
83
|
</div>
|
77
84
|
<% end %>
|
78
85
|
<%= render "seo_settings", f: f %>
|
@@ -1,6 +1,6 @@
|
|
1
1
|
<article id="category-view" class="category_<%= @category.slug %>">
|
2
2
|
<%= render partial: 'partials/breadcrumb', locals: {breadcrumb: @category.the_breadcrumb } %>
|
3
|
-
<h1><%= @category.the_title %></h1>
|
3
|
+
<h1><%= @category.the_title %><%= @category.the_edit_link %></h1>
|
4
4
|
<div class="content">
|
5
5
|
<%= raw @category.the_content %>
|
6
6
|
</div><br><br>
|
@@ -56,7 +56,7 @@
|
|
56
56
|
</a>
|
57
57
|
<div class="caption">
|
58
58
|
<h4 id="thumbnail-label"><a href="<%= ptype.the_url %>"><%= ptype.the_title %></a></h4><hr>
|
59
|
-
<p><%= raw ptype.the_excerpt %></p>
|
59
|
+
<p><%= raw ptype.the_excerpt %> <%= ptype.the_edit_link %></p>
|
60
60
|
</div>
|
61
61
|
</div>
|
62
62
|
</div>
|
@@ -0,0 +1 @@
|
|
1
|
+
<%= yield %>
|
@@ -8,7 +8,7 @@
|
|
8
8
|
<div class="col-md-2">
|
9
9
|
<a href="<%= cat.the_url %>" class="thumbnail text-center">
|
10
10
|
<img src="<%= cat.the_thumb_url %>" alt="Image" style="max-width:100%;">
|
11
|
-
<span class="category-title"><%= cat.the_title %></span>
|
11
|
+
<span class="category-title"><%= cat.the_title %> <%= cat.the_edit_link %></span>
|
12
12
|
</a>
|
13
13
|
</div>
|
14
14
|
<% end %>
|
@@ -1,6 +1,6 @@
|
|
1
1
|
<article id="post_type-view" class="post_type_<%= @post_type.slug %>">
|
2
2
|
<%= render partial: 'partials/breadcrumb', locals: {breadcrumb: @post_type.the_breadcrumb } %>
|
3
|
-
<h1><%= @post_type.the_title %></h1>
|
3
|
+
<h1><%= @post_type.the_title %> <%= @post_type.the_edit_link %></h1>
|
4
4
|
<div class="content">
|
5
5
|
<%= raw @post_type.the_content %>
|
6
6
|
</div><br><br>
|
@@ -4,7 +4,7 @@
|
|
4
4
|
<% if @post_type.the_slug == "page" %>
|
5
5
|
<div class="col-md-12 page-view">
|
6
6
|
<article class="post-content">
|
7
|
-
<h1><%= @post.the_title %></h1>
|
7
|
+
<h1><%= @post.the_title %> <%= @post.the_edit_link %></h1>
|
8
8
|
<div class="item-content">
|
9
9
|
<%= raw @post.the_content %>
|
10
10
|
</div>
|
@@ -20,12 +20,14 @@
|
|
20
20
|
<%= javascript_include_tag "camaleon_cms/admin/admin-manifest" %>
|
21
21
|
<%= javascript_include_tag "camaleon_cms/admin/jquery_validate/#{current_locale}.js" if current_locale != "en" %> <!-- validator translations -->
|
22
22
|
<%= raw the_head({}, false) %>
|
23
|
+
<%= yield :head if content_for? :head %>
|
23
24
|
<!--[if lt IE 9]>
|
24
25
|
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
|
25
26
|
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
|
26
27
|
<![endif]-->
|
27
28
|
</head>
|
28
29
|
<body class="hold-transition skin-blue sidebar-mini" data-intro="<%= current_site.get_option("save_intro") %>">
|
30
|
+
<%= yield :before_content if content_for? :before_content %>
|
29
31
|
<%= raw cama_content_before_draw %>
|
30
32
|
<div class="wrapper">
|
31
33
|
|
@@ -45,5 +47,6 @@
|
|
45
47
|
<%= render partial: "layouts/camaleon_cms/admin/footer" %>
|
46
48
|
</div>
|
47
49
|
<%= raw cama_content_after_draw %>
|
50
|
+
<%= yield :after_content if content_for? :after_content %>
|
48
51
|
</body>
|
49
52
|
</html>
|
@@ -13,8 +13,12 @@ module ActionView
|
|
13
13
|
module ViewPaths
|
14
14
|
# fix to add camaleon prefix to search partials and layouts
|
15
15
|
def find(name, prefixes = [], partial = false, keys = [], options = {})
|
16
|
-
|
17
|
-
|
16
|
+
if !partial && !prefixes.present? && File.exist?(name) # fix for windows ==> render file: '....'
|
17
|
+
#puts "rendering specific file (render file: '....')"
|
18
|
+
else
|
19
|
+
prefixes = [""] unless prefixes.present?
|
20
|
+
prefixes = self.prefixes + prefixes if prefixes.is_a?(Array)
|
21
|
+
end
|
18
22
|
@view_paths.find(*args_for_lookup(name, prefixes, partial, keys, options))
|
19
23
|
end
|
20
24
|
alias :find_template :find
|
@@ -341,6 +341,7 @@ en:
|
|
341
341
|
filesystem_s3_access_key: "AWS S3 Access Key"
|
342
342
|
filesystem_s3_secret_key: "AWS S3 Secret Key"
|
343
343
|
filesystem_s3_bucket_name: "AWS S3 Bucket name"
|
344
|
+
filesystem_s3_endpoint: "AWS S3 Bucket endpoint"
|
344
345
|
filesystem_region: "AWS S3 Region"
|
345
346
|
filesystem_cdn: "CDN url"
|
346
347
|
security:
|
data/config/routes/frontend.rb
CHANGED
@@ -1,4 +1,13 @@
|
|
1
1
|
Rails.application.routes.draw do
|
2
|
+
|
3
|
+
# frontend plugins
|
4
|
+
scope PluginRoutes.system_info["relative_url_root"] do
|
5
|
+
scope "(:locale)", locale: /#{PluginRoutes.all_locales}/, :defaults => { } do
|
6
|
+
instance_eval(PluginRoutes.load("front"))
|
7
|
+
end
|
8
|
+
end
|
9
|
+
|
10
|
+
# frontend camaleon cms
|
2
11
|
scope PluginRoutes.system_info["relative_url_root"], as: "cama" do
|
3
12
|
scope "(:locale)", locale: /#{PluginRoutes.all_locales}/, :defaults => { } do
|
4
13
|
root 'camaleon_cms/frontend#index'
|
@@ -33,14 +42,8 @@ Rails.application.routes.draw do
|
|
33
42
|
get "ajax"
|
34
43
|
end
|
35
44
|
|
36
|
-
get ":slug" => 'camaleon_cms/frontend#post', format: true, :as => :post1, defaults: { format: :html }, constraints: { slug: /
|
37
|
-
get ":slug" => 'camaleon_cms/frontend#post', :as => :post, constraints: { slug: /
|
38
|
-
end
|
39
|
-
end
|
40
|
-
|
41
|
-
scope PluginRoutes.system_info["relative_url_root"] do
|
42
|
-
scope "(:locale)", locale: /#{PluginRoutes.all_locales}/, :defaults => { } do
|
43
|
-
instance_eval(PluginRoutes.load("front"))
|
45
|
+
get ":slug" => 'camaleon_cms/frontend#post', format: true, :as => :post1, defaults: { format: :html }, constraints: { slug: /[a-zA-Z0-9\._=\s\-]+/}
|
46
|
+
get ":slug" => 'camaleon_cms/frontend#post', :as => :post, constraints: { slug: /[a-zA-Z0-9\._=\s\-]+/}
|
44
47
|
end
|
45
48
|
end
|
46
49
|
|
data/config/system.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"default_template": "default", // default template name for new sites
|
3
3
|
"hooks": { }, // system hooks
|
4
|
-
|
4
|
+
"skip_format_url": true, // enable or disable .html extension in the urls.
|
5
5
|
"default_plugins": ["front_cache", "contact_form", "attack"], // Default plugins installed for each new site
|
6
6
|
"available_languages": ["es", "en", "fr", "zh", "de", "it", "pt_br"], // Available languages for frontend panel, here all locales: https://github.com/svenfuchs/rails-i18n
|
7
7
|
"admin_available_languages": ["en", "es", "it", "pt_br"], //Available languages for the admin panel
|