camaleon_cms 2.4.3.12 → 2.4.3.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of camaleon_cms might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/app/apps/plugins/authoring_post/authoring_post_helper.rb +1 -1
- data/app/apps/plugins/front_cache/admin_controller.rb +1 -5
- data/app/apps/plugins/visibility_post/assets/js/form.js +10 -7
- data/app/apps/plugins/visibility_post/visibility_post_helper.rb +2 -2
- data/app/assets/javascripts/camaleon_cms/admin/_bootstrap-datepicker.js +2 -2
- data/app/assets/javascripts/camaleon_cms/admin/_jquery.slugify.js +1 -1
- data/app/assets/javascripts/camaleon_cms/admin/_libraries.js +1 -1
- data/app/assets/javascripts/camaleon_cms/admin/_modal.js +1 -1
- data/app/assets/javascripts/camaleon_cms/admin/_post.js +1 -1
- data/app/assets/javascripts/camaleon_cms/admin/uploader/_media_manager.js.coffee +1 -1
- data/app/controllers/camaleon_cms/admin/posts_controller.rb +1 -1
- data/app/controllers/camaleon_cms/camaleon_controller.rb +8 -1
- data/app/controllers/concerns/camaleon_cms/frontend_concern.rb +2 -2
- data/app/helpers/camaleon_cms/admin/breadcrumb_helper.rb +1 -1
- data/app/views/camaleon_cms/admin/settings/custom_fields/_get_items.html.erb +1 -1
- data/lib/camaleon_cms/version.rb +1 -1
- data/spec/dummy/db/schema.rb +0 -17
- data/spec/spec_helper.rb +2 -2
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 60220e65572eba3df3e3307a97c423dda3a5c88b
|
4
|
+
data.tar.gz: 8fbafdb15258a5aec532b99f1f361f3f76a65d83
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3f392f06e049b9fc300785f955cbca6e57efda0e30719e2cfa7f1271673578579a2e328b040ae27b977247a9a2b0633464a27af960dbf0fceadaa51642d9f7dc
|
7
|
+
data.tar.gz: 6bef7a0c8e4c174456cbf5b9daec32377199a69f6e4d3238b887e615964a35c8fa529a616a2cfd12c0cfe9c5f971b5521702ff8f41b13d34039848cd68b4c57c
|
@@ -42,7 +42,7 @@ module Plugins::AuthoringPost::AuthoringPostHelper
|
|
42
42
|
def plugin_authoring_authors_list(post)
|
43
43
|
author_id = post.new_record? ? current_user.id : post.author.id
|
44
44
|
ret = ''
|
45
|
-
current_site.users.
|
45
|
+
current_site.users.where('role <> ?', 'client').order(:username).each do |user|
|
46
46
|
ret += "<option value='#{user.id}' #{user.id.eql?(author_id) ? 'selected' : ''}>#{user.username.titleize}#{user.fullname.eql?(user.username.titleize) ? '' : ' (' + user.fullname + ')' }</option>"
|
47
47
|
end
|
48
48
|
ret
|
@@ -23,11 +23,7 @@ class Plugins::FrontCache::AdminController < CamaleonCms::Apps::PluginsAdminCont
|
|
23
23
|
def clean_cache
|
24
24
|
flash[:notice] = "#{t('plugin.front_cache.message.cache_destroyed')}"
|
25
25
|
front_cache_clean()
|
26
|
-
|
27
|
-
redirect_to :back
|
28
|
-
else
|
29
|
-
redirect_back(fallback_location: '/admin/plugins')
|
30
|
-
end
|
26
|
+
redirect_to(request.referer || '/admin/plugins')
|
31
27
|
end
|
32
28
|
|
33
29
|
end
|
@@ -1,12 +1,12 @@
|
|
1
1
|
jQuery(function($){
|
2
2
|
var panel = $("#panel-post-visibility");
|
3
3
|
var link_edit = panel.find(".edit-visibility").click(function(){
|
4
|
-
panel.find(".panel-options").removeClass("hidden").show()
|
4
|
+
panel.find(".panel-options").removeClass("hidden").show();
|
5
5
|
link_edit.hide();
|
6
6
|
return false;
|
7
7
|
});
|
8
8
|
panel.find(".lnk_hide").click(function(){
|
9
|
-
panel.find(".panel-options").hide()
|
9
|
+
panel.find(".panel-options").hide();
|
10
10
|
link_edit.show();
|
11
11
|
return false;
|
12
12
|
});
|
@@ -15,11 +15,14 @@ jQuery(function($){
|
|
15
15
|
var label = $(this).closest("label");
|
16
16
|
panel.find(".visibility_label").html(label.text());
|
17
17
|
label.siblings("div").hide();
|
18
|
-
label.next().show();
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
18
|
+
var rel_block = label.next().show();
|
19
|
+
|
20
|
+
if($(this).val() == 'private') rel_block.find('input.visibility_private_group_item:first').addClass('required data-error-place-parent');
|
21
|
+
else panel.find('input.visibility_private_group_item:first').removeClass('required');
|
22
|
+
|
23
|
+
if($(this).val() == 'password') rel_block.find('input:text').addClass('required');
|
24
|
+
else panel.find('input.password_field_value').removeClass('required');
|
25
|
+
|
23
26
|
}).filter(":checked").trigger("change");
|
24
27
|
|
25
28
|
var cal_input = $("#form-post").find('#published_from');
|
@@ -102,7 +102,7 @@ module Plugins::VisibilityPost::VisibilityPostHelper
|
|
102
102
|
<div style='padding-left: 20px;'>#{groups_list(post)}</div>
|
103
103
|
|
104
104
|
<label style='display: block;'><input type='radio' name='post[visibility]' claass='radio' value='password' #{"checked=''" if "password" == post.visibility}> #{t('camaleon_cms.admin.table.password_protection')}</label>
|
105
|
-
<div><input type='text' class='form-control' name='post[visibility_value]' value='#{post.visibility_value if "password" == post.visibility}'></div>
|
105
|
+
<div><input type='text' class='form-control password_field_value' name='post[visibility_value]' value='#{post.visibility_value if "password" == post.visibility}'></div>
|
106
106
|
|
107
107
|
<p>
|
108
108
|
<a class='lnk_hide' href='#'>#{t('camaleon_cms.admin.table.hide')}</a>
|
@@ -116,7 +116,7 @@ module Plugins::VisibilityPost::VisibilityPostHelper
|
|
116
116
|
current_groups = []
|
117
117
|
current_groups = post.visibility_value.split(",") if post.visibility == "private"
|
118
118
|
current_site.user_roles.each do |role|
|
119
|
-
res << "<label><input type='checkbox' name='post_private_groups[]' class='' value='#{role.slug}' #{"checked=''" if current_groups.include?(role.slug.to_s) }> #{role.name}</label><br>"
|
119
|
+
res << "<label><input type='checkbox' name='post_private_groups[]' class='visibility_private_group_item' value='#{role.slug}' #{"checked=''" if current_groups.include?(role.slug.to_s) }> #{role.name}</label><br>"
|
120
120
|
end
|
121
121
|
res.join("")
|
122
122
|
end
|
@@ -2302,7 +2302,7 @@
|
|
2302
2302
|
input = element;
|
2303
2303
|
} else {
|
2304
2304
|
input = element.find(options.datepickerInput);
|
2305
|
-
if (input.
|
2305
|
+
if (input.length === 0) {
|
2306
2306
|
input = element.find('input');
|
2307
2307
|
} else if (!input.is('input')) {
|
2308
2308
|
throw new Error('CSS class "' + options.datepickerInput + '" cannot be applied to non input element');
|
@@ -2311,7 +2311,7 @@
|
|
2311
2311
|
|
2312
2312
|
if (element.hasClass('input-group')) {
|
2313
2313
|
// in case there is more then one 'input-group-addon' Issue #48
|
2314
|
-
if (element.find('.datepickerbutton').
|
2314
|
+
if (element.find('.datepickerbutton').length === 0) {
|
2315
2315
|
component = element.find('.input-group-addon');
|
2316
2316
|
} else {
|
2317
2317
|
component = element.find('.datepickerbutton');
|
@@ -44,7 +44,7 @@ function slugFunc(v, sep){
|
|
44
44
|
} else {
|
45
45
|
$target.filter(':not(.slugify-locked)').text(slug);
|
46
46
|
}
|
47
|
-
if(settings.change && $target.filter(':not(.slugify-locked)').
|
47
|
+
if(settings.change && $target.filter(':not(.slugify-locked)').length > 0){
|
48
48
|
settings.change(slug);
|
49
49
|
}
|
50
50
|
};
|
@@ -52,7 +52,7 @@ var init_form_validations = function (form, args) {
|
|
52
52
|
|
53
53
|
(form ? form : $('#admin_content form')).each(function () {
|
54
54
|
var $form = $(this)
|
55
|
-
if ($form.find('.translatable').
|
55
|
+
if ($form.find('.translatable').length > 0) {
|
56
56
|
$form.find('.translatable').Translatable();
|
57
57
|
}
|
58
58
|
}).filter(".validate").each(function () {
|
@@ -61,7 +61,7 @@ function open_modal(settings){
|
|
61
61
|
settings = $.extend({}, def, settings);
|
62
62
|
if(settings.id){
|
63
63
|
var hidden_modal = $("#"+settings.id);
|
64
|
-
if(hidden_modal.
|
64
|
+
if(hidden_modal.length){ hidden_modal.modal('show'); return hidden_modal; }
|
65
65
|
}
|
66
66
|
var modal = $('<div id="'+settings.id+'" class="modal fade modal-'+settings.type+'">'+
|
67
67
|
'<div class="modal-dialog '+settings.modal_size+'">'+
|
@@ -56,7 +56,7 @@ function cama_init_post(obj) {
|
|
56
56
|
window["post_editor_draft_intrval"] = setInterval(function () { if($form.length == 0){ clearInterval(window["post_editor_draft_intrval"]); } else{ App_post.save_draft_ajax(null, true); } }, 1 * 60 * 1000);
|
57
57
|
window.save_draft = App_post.save_draft_ajax;
|
58
58
|
|
59
|
-
if($form.find(".title-post" + class_translate).
|
59
|
+
if($form.find(".title-post" + class_translate).length == 0) class_translate = '';
|
60
60
|
$form.find(".title-post" + class_translate).each(function () {
|
61
61
|
var $this = $(this);
|
62
62
|
if (!$this.hasClass('sluged')) {
|
@@ -108,7 +108,7 @@ window["cama_init_media"] = (media_panel) ->
|
|
108
108
|
dynamicFormData: customFileData,
|
109
109
|
onSuccess: ((files,res_upload,xhr,pd)->
|
110
110
|
if res_upload.search("media_item") >= 0 # success upload
|
111
|
-
media_panel.trigger("add_file", {item: res_upload, selected: $(pd.statusbar).siblings().not('.error_file_upload').
|
111
|
+
media_panel.trigger("add_file", {item: res_upload, selected: $(pd.statusbar).siblings().not('.error_file_upload').length == 0})
|
112
112
|
$(pd.statusbar).remove();
|
113
113
|
else
|
114
114
|
$(pd.statusbar).find(".ajax-file-upload-progress").html("<span style='color: red;'>"+res_upload+"</span>");
|
@@ -158,7 +158,7 @@ class CamaleonCms::Admin::PostsController < CamaleonCms::AdminController
|
|
158
158
|
flash[:error] = @post.errors.full_messages.join(', ')
|
159
159
|
end
|
160
160
|
end
|
161
|
-
redirect_to
|
161
|
+
redirect_to(request.referer || url_for(action: :index, s: params[:s]))
|
162
162
|
end
|
163
163
|
|
164
164
|
# ajax options
|
@@ -100,7 +100,14 @@ class CamaleonCms::CamaleonController < ApplicationController
|
|
100
100
|
# inactive page control
|
101
101
|
if current_site.is_inactive?
|
102
102
|
p = current_site.posts.find(current_site.get_option('page_inactive')).decorate
|
103
|
-
|
103
|
+
if request.original_url.to_s.match /\A#{current_site.the_url}admin(\/|\z)/
|
104
|
+
if cama_current_user.present?
|
105
|
+
cama_logout_user
|
106
|
+
flash[:error] = ('Site is Inactive')
|
107
|
+
end
|
108
|
+
else
|
109
|
+
redirect_to(p.the_url) unless params == {"controller"=>"camaleon_cms/frontend", "action"=>"post", "slug"=>p.the_slug}
|
110
|
+
end
|
104
111
|
end
|
105
112
|
|
106
113
|
# maintenance page and IP's control
|
@@ -57,6 +57,6 @@ module CamaleonCms::FrontendConcern extend ActiveSupport::Concern
|
|
57
57
|
else
|
58
58
|
flash[:comment_submit][:error] = t('camaleon_cms.admin.message.unauthorized')
|
59
59
|
end
|
60
|
-
params[:format] == 'json' ? render(json: flash.discard(:comment_submit).to_hash) : redirect_to(:
|
60
|
+
params[:format] == 'json' ? render(json: flash.discard(:comment_submit).to_hash) : redirect_to(request.referer || @post.the_url(as_path: true))
|
61
61
|
end
|
62
|
-
end
|
62
|
+
end
|
@@ -2,7 +2,7 @@ module CamaleonCms::Admin::BreadcrumbHelper
|
|
2
2
|
# draw the title for the admin admin panel according the breadcrumb
|
3
3
|
def cama_admin_title_draw
|
4
4
|
res = [t("camaleon_cms.admin.sidebar_top.admin_panel")]
|
5
|
-
@breadcrumbs.reverse.slice(0, 2).reverse.each{|b| res << b.name }
|
5
|
+
@breadcrumbs.reverse.slice(0, 2).reverse.each{|b| res << (b.is_a?(Hash) ? b[:name] : b.name) }
|
6
6
|
res.join(" » ")
|
7
7
|
end
|
8
8
|
|
data/lib/camaleon_cms/version.rb
CHANGED
data/spec/dummy/db/schema.rb
CHANGED
@@ -13,12 +13,6 @@
|
|
13
13
|
|
14
14
|
ActiveRecord::Schema.define(version: 20161215202255) do
|
15
15
|
|
16
|
-
create_table "ar_internal_metadata", primary_key: "key", force: :cascade do |t|
|
17
|
-
t.string "value"
|
18
|
-
t.datetime "created_at", null: false
|
19
|
-
t.datetime "updated_at", null: false
|
20
|
-
end
|
21
|
-
|
22
16
|
create_table "comments", force: :cascade do |t|
|
23
17
|
t.string "author"
|
24
18
|
t.string "author_email"
|
@@ -84,17 +78,6 @@ ActiveRecord::Schema.define(version: 20161215202255) do
|
|
84
78
|
add_index "metas", ["object_class"], name: "index_metas_on_object_class"
|
85
79
|
add_index "metas", ["objectid"], name: "index_metas_on_objectid"
|
86
80
|
|
87
|
-
create_table "plugins_attacks", force: :cascade do |t|
|
88
|
-
t.string "path"
|
89
|
-
t.string "browser_key"
|
90
|
-
t.integer "site_id"
|
91
|
-
t.datetime "created_at"
|
92
|
-
end
|
93
|
-
|
94
|
-
add_index "plugins_attacks", ["browser_key"], name: "index_plugins_attacks_on_browser_key"
|
95
|
-
add_index "plugins_attacks", ["path"], name: "index_plugins_attacks_on_path"
|
96
|
-
add_index "plugins_attacks", ["site_id"], name: "index_plugins_attacks_on_site_id"
|
97
|
-
|
98
81
|
create_table "plugins_contact_forms", force: :cascade do |t|
|
99
82
|
t.integer "site_id"
|
100
83
|
t.integer "count"
|
data/spec/spec_helper.rb
CHANGED
@@ -45,9 +45,9 @@ end
|
|
45
45
|
#****** configuration to test using poltergeist *****#
|
46
46
|
require 'capybara/poltergeist'
|
47
47
|
# Note: you need phantomjs 1.9.x which can be downloaded from here: https://code.google.com/archive/p/phantomjs/downloads
|
48
|
-
if File.exist?(File.join(CAMALEON_CMS_ROOT, '
|
48
|
+
if File.exist?(File.join(CAMALEON_CMS_ROOT, 'spec', 'bin', 'phantomjs'))
|
49
49
|
Capybara.register_driver :poltergeist do |app|
|
50
|
-
Capybara::Poltergeist::Driver.new(app, :phantomjs => File.join(CAMALEON_CMS_ROOT, '
|
50
|
+
Capybara::Poltergeist::Driver.new(app, :phantomjs => File.join(CAMALEON_CMS_ROOT, 'spec', 'bin', 'phantomjs').to_s)
|
51
51
|
end
|
52
52
|
end
|
53
53
|
Capybara.javascript_driver = :poltergeist
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: camaleon_cms
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.4.3.
|
4
|
+
version: 2.4.3.13
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Owen Peredo Diaz
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-09-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bcrypt
|
@@ -24,6 +24,20 @@ dependencies:
|
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: json
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 2.0.0
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 2.0.0
|
27
41
|
- !ruby/object:Gem::Dependency
|
28
42
|
name: cancancan
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|