camaleon_cms 2.4.3.1 → 2.4.3.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/controllers/camaleon_cms/admin/posts_controller.rb +1 -1
- data/app/decorators/camaleon_cms/application_decorator.rb +2 -2
- data/app/decorators/camaleon_cms/site_decorator.rb +1 -1
- data/app/helpers/camaleon_cms/uploader_helper.rb +1 -1
- data/app/uploaders/camaleon_cms_local_uploader.rb +1 -1
- data/app/views/camaleon_cms/default_theme/partials/_cama_posts_entries.json.jbuilder +2 -2
- data/app/views/layouts/camaleon_cms/admin/_header.html.erb +1 -1
- data/lib/camaleon_cms/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 309565425b7415af401d6ea4a5238345397f9766
|
4
|
+
data.tar.gz: b97b8586392c7c6694d99053b02deb200baababc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8e5b72a18704f4dba361c8a64fabefc1c6f3d065a33745f73dd35c2c75879d397fe0a2e15df9165475d93844e880ec17a65b8e5cc3c094a08efc75d705eefc92
|
7
|
+
data.tar.gz: 6133cee060a592483e03afe30d1769a8378d1fa4e724489bd014e8f2111a352ef8e425bcf0a214860bc5355f1db5b172cb9739bd8c2264800b1f8554e3ce84a5
|
data/README.md
CHANGED
@@ -39,7 +39,7 @@
|
|
39
39
|
* Add the gem in your Gemfile
|
40
40
|
|
41
41
|
```
|
42
|
-
gem "camaleon_cms", '>= 2.4.3.
|
42
|
+
gem "camaleon_cms", '>= 2.4.3.2' # Stable versions 2.3.6, 2.2.1, 2.1.1, 2.1.0
|
43
43
|
# gem "camaleon_cms", github: 'owen2345/camaleon-cms' # current development version
|
44
44
|
```
|
45
45
|
* Only Rails 5 support
|
@@ -184,7 +184,7 @@ class CamaleonCms::Admin::PostsController < CamaleonCms::AdminController
|
|
184
184
|
def get_post_data(is_create = false)
|
185
185
|
post_data = params.require(:post).permit!
|
186
186
|
post_data[:user_id] = cama_current_user.id if is_create
|
187
|
-
post_data[:status]
|
187
|
+
post_data[:status] = 'pending' if post_data[:status] == 'published' && cannot?(:publish_post, @post_type)
|
188
188
|
post_data[:data_tags] = params[:tags].to_s
|
189
189
|
post_data[:data_categories] = params[:categories] || []
|
190
190
|
post_data
|
@@ -43,12 +43,12 @@ class CamaleonCms::ApplicationDecorator < Draper::Decorator
|
|
43
43
|
|
44
44
|
# get the locale for current decorator
|
45
45
|
def get_locale(locale = nil)
|
46
|
-
locale || @_deco_locale || (h.cama_get_i18n_frontend rescue
|
46
|
+
locale || @_deco_locale || (h.cama_get_i18n_frontend rescue nil) || I18n.locale
|
47
47
|
end
|
48
48
|
|
49
49
|
# return the current locale prefixed to add in frontend routes
|
50
50
|
def _calc_locale(_l)
|
51
|
-
_l = (_l || @_deco_locale || (h.cama_get_i18n_frontend rescue
|
51
|
+
_l = (_l || @_deco_locale || (h.cama_get_i18n_frontend rescue nil) || I18n.locale).to_s
|
52
52
|
"_#{_l}"
|
53
53
|
end
|
54
54
|
end
|
@@ -177,7 +177,7 @@ class CamaleonCms::SiteDecorator < CamaleonCms::TermTaxonomyDecorator
|
|
177
177
|
def the_admin_url
|
178
178
|
host = object.main_site? ? object.slug : (object.slug.include?(".") ? object.slug : "#{object.slug}.#{Cama::Site.main_site.slug}")
|
179
179
|
port = (host.split(":")[1] rescue nil)
|
180
|
-
h.cama_url_to_fixed("cama_admin_dashboard_url", host: host, port: port, locale:
|
180
|
+
h.cama_url_to_fixed("cama_admin_dashboard_url", host: host, port: port, locale: nil)
|
181
181
|
end
|
182
182
|
|
183
183
|
# check if current user can manage sites
|
@@ -221,7 +221,7 @@ module CamaleonCms::UploaderHelper
|
|
221
221
|
saved = true
|
222
222
|
elsif uploaded_io.is_a?(String) && (uploaded_io.start_with?("http://") || uploaded_io.start_with?("https://"))
|
223
223
|
return {error: "#{ct("file_format_error")} (#{args[:formats]})"} unless cama_uploader.class.validate_file_format(uploaded_io, args[:formats])
|
224
|
-
uploaded_io = Rails.public_path.join(uploaded_io.sub(current_site.the_url(locale:
|
224
|
+
uploaded_io = Rails.public_path.join(uploaded_io.sub(current_site.the_url(locale: nil), '')).to_s if uploaded_io.include?(current_site.the_url(locale: nil)) # local file
|
225
225
|
_tmp_name = uploaded_io.split("/").last.split('?').first; args[:name] = args[:name] || _tmp_name
|
226
226
|
uploaded_io = open(uploaded_io)
|
227
227
|
end
|
@@ -41,7 +41,7 @@ class CamaleonCmsLocalUploader < CamaleonCmsUploader
|
|
41
41
|
res = {
|
42
42
|
"name" => File.basename(file_path),
|
43
43
|
"key" => parse_key(file_path),
|
44
|
-
"url" => is_dir ? '' : (is_private_uploader? ? url_path.sub("#{@root_folder}/", '') : File.join(@current_site.decorate.the_url(locale:
|
44
|
+
"url" => is_dir ? '' : (is_private_uploader? ? url_path.sub("#{@root_folder}/", '') : File.join(@current_site.decorate.the_url(locale: nil, skip_relative_url_root: true), url_path)),
|
45
45
|
"is_folder" => is_dir,
|
46
46
|
"size" => is_dir ? 0 : File.size(file_path).round(2),
|
47
47
|
"format" => is_dir ? 'folder' : self.class.get_file_format(file_path),
|
@@ -1,8 +1,8 @@
|
|
1
1
|
json.current_page posts.current_page
|
2
2
|
json.per_page posts.per_page
|
3
3
|
json.total_entries posts.total_entries
|
4
|
-
json.previous_page url_for(
|
5
|
-
json.next_page url_for(
|
4
|
+
json.previous_page url_for(page: posts.previous_page, only_path: false) if posts.previous_page.present?
|
5
|
+
json.next_page url_for(page: posts.next_page, only_path: false) if posts.next_page.present?
|
6
6
|
json.entries posts.decorate do |post|
|
7
7
|
json.partial! partial: 'partials/cama_post_entry', locals:{ post: post }
|
8
8
|
end
|
@@ -16,7 +16,7 @@
|
|
16
16
|
<div class="navbar-custom-menu">
|
17
17
|
<ul class="nav navbar-nav">
|
18
18
|
<%= r = {html: ""}; hooks_run("admin_notifications", r); raw(r[:html]); %>
|
19
|
-
<li><a target="_blank" href="<%= current_site.the_url(locale:
|
19
|
+
<li><a target="_blank" href="<%= current_site.the_url(locale: nil) %>"><i class="fa fa-eye"></i> <%= t("camaleon_cms.common.visit") %></a></li>
|
20
20
|
<li class="dropdown user user-menu">
|
21
21
|
<a href="#" class="dropdown-toggle" data-toggle="dropdown" data-intro2='<%= t("camaleon_cms.admin.intro.profile") %>' data-position='left'>
|
22
22
|
<img src="<%= cama_current_user.the_avatar %>" class="user-image" alt="User Image">
|
data/lib/camaleon_cms/version.rb
CHANGED
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.2
|
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-03
|
11
|
+
date: 2017-04-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bcrypt
|