alchemy_cms 5.3.5 → 5.3.8

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: 2a2374c679c6d6962c9bb32d48f8f444def421fb927302b87f705a85e9e21d85
4
- data.tar.gz: d3a682ccdf288d777e87f145b15121fa51d4008d3992ba39abb16e417e2ca1bb
3
+ metadata.gz: 9df1280121647518564fa377e3d89b039f1661d0a02dc1cdd695c992e99d19e9
4
+ data.tar.gz: a53fdd7e2eba3ec9c71a19668e30671308ca0f2d021bdb518114163cd0b742cf
5
5
  SHA512:
6
- metadata.gz: 1d40a29752e354e66b2186290cb229a2d0b89b77b258258c5488f4b8e6f56ffc7714bd6824e89e05a9075c53a3294c75eb5ebe70148c12d0b3fae84781f70a33
7
- data.tar.gz: 1ddecd199116f699e351384bb460c39bb3203a71fa41a3d6e3319b8ad8107500049f1e37894f9a14f3e955930ae98e2dcc2d1458fff128dac2178b9d94cbeabc
6
+ metadata.gz: 5c6ac637ddf39da330066dca6907715b194298b2f4d07331c33b87615631ac05e41d766a8ce32a4d2ab5764799642a3f90a1e6baad2f78eaca4f861d120372ae
7
+ data.tar.gz: f669e22a899f8f4f0db6454b987cf9454bf167833f8c5081e9b25d05914b9c18ca2c6f8781a643e1d2934116ac3317fdc31a9372a58b3670fc3bba5463440ad8
data/CHANGELOG.md CHANGED
@@ -1,3 +1,16 @@
1
+ ## 5.3.8 (2022-09-02)
2
+
3
+ - Fix author edit_content permissions [#2364](https://github.com/AlchemyCMS/alchemy_cms/pull/2364) ([tvdeyen](https://github.com/tvdeyen))
4
+
5
+ ## 5.3.7 (2022-06-10)
6
+
7
+ - Fix admin page tree links after update [#2348](https://github.com/AlchemyCMS/alchemy_cms/pull/2348) ([tvdeyen](https://github.com/tvdeyen))
8
+ - Fix initial selection of internal page link select [#2346](https://github.com/AlchemyCMS/alchemy_cms/pull/2346) ([tvdeyen](https://github.com/tvdeyen))
9
+
10
+ ## 5.3.6 (2022-06-04)
11
+
12
+ - Use HashWithIndifferentAccess for Page definition. Key hint translation by page_layout [#2343](https://github.com/AlchemyCMS/alchemy_cms/pull/2343) ([dbwinger](https://github.com/dbwinger))
13
+
1
14
  ## 5.3.5 (2022-04-26)
2
15
 
3
16
  - Add thumbnail processor to support resizing on animated GIFs [#2316](https://github.com/AlchemyCMS/alchemy_cms/pull/2316) ([kulturbande](https://github.com/kulturbande))
@@ -87,7 +87,7 @@ class window.Alchemy.LinkDialog extends Alchemy.Dialog
87
87
  urlname = $element.val()
88
88
  $.get Alchemy.routes.api_pages_path,
89
89
  q:
90
- urlname_eq: urlname.replace(/^\/([a-z]{2}(-[A-Z]{2})?\/)?/, '')
90
+ urlname_eq: urlname.replace(/^\/([a-z]{2}(-[A-Z]{2})?\/)?(.+?)\/?$/, '$3')
91
91
  page: 1
92
92
  per_page: 1,
93
93
  (data) =>
@@ -42,10 +42,6 @@ select {
42
42
  font-weight: normal;
43
43
  text-align: left;
44
44
 
45
- .select2-chosen {
46
- overflow: visible;
47
- }
48
-
49
45
  .select2-arrow {
50
46
  top: 0;
51
47
  width: $form-field-height;
@@ -8,14 +8,9 @@ module Alchemy
8
8
  # Returns all pages as json object
9
9
  #
10
10
  def index
11
- # Fix for cancancan not able to merge multiple AR scopes for logged in users
12
- if can? :edit_content, Alchemy::Page
13
- @pages = Alchemy::Page.all
14
- else
15
- language = Alchemy::Language.find_by(id: params[:language_id]) || Alchemy::Language.current
16
- @pages = Alchemy::Page.accessible_by(current_ability, :index)
17
- @pages = @pages.where(language: language)
18
- end
11
+ language = Alchemy::Language.find_by(id: params[:language_id]) || Alchemy::Language.current
12
+ @pages = Alchemy::Page.accessible_by(current_ability, :index)
13
+ @pages = @pages.where(language: language)
19
14
  @pages = @pages.includes(*page_includes)
20
15
  @pages = @pages.ransack(params[:q]).result
21
16
 
@@ -523,6 +523,12 @@ module Alchemy
523
523
  locker.try(:name) || Alchemy.t("unknown")
524
524
  end
525
525
 
526
+ # Key hint translations by page layout, rather than the default name.
527
+ #
528
+ def hint_translation_attribute
529
+ page_layout
530
+ end
531
+
526
532
  # Menus (aka. root nodes) this page is attached to
527
533
  #
528
534
  def menus
@@ -23,7 +23,7 @@
23
23
  <% else -%>
24
24
 
25
25
  if (page) {
26
- var page_html = "<%= j render('page', page: @page) %>";
26
+ var page_html = "<%= j render('page', page: @page) %>".replace(/__ID__/g, "<%= @page.id %>");;
27
27
  var compiler = Handlebars.compile(page_html);
28
28
  var tree = <%== @tree.to_json %>;
29
29
  page.outerHTML = compiler(tree.pages[0]);
data/lib/alchemy/hints.rb CHANGED
@@ -37,19 +37,23 @@ module Alchemy
37
37
  def hint
38
38
  hint = definition["hint"]
39
39
  if hint == true
40
- Alchemy.t(name, scope: hint_translation_scope)
40
+ Alchemy.t(hint_translation_attribute, scope: hint_translation_scope)
41
41
  else
42
42
  hint
43
43
  end
44
44
  end
45
45
 
46
- # Returns true if the element has a hint
46
+ # Returns true if the element has a hint defined
47
47
  def has_hint?
48
- hint.present?
48
+ !!definition[:hint]
49
49
  end
50
50
 
51
51
  private
52
52
 
53
+ def hint_translation_attribute
54
+ name
55
+ end
56
+
53
57
  def hint_translation_scope
54
58
  "#{self.class.model_name.to_s.demodulize.downcase}_hints"
55
59
  end
@@ -8,7 +8,7 @@ module Alchemy
8
8
  # They are defined in +config/alchemy/page_layout.yml+ file.
9
9
  #
10
10
  def all
11
- @definitions ||= read_definitions_file
11
+ @definitions ||= read_definitions_file.map(&:with_indifferent_access)
12
12
  end
13
13
 
14
14
  # Add additional page definitions to collection.
@@ -164,7 +164,11 @@ module Alchemy
164
164
  #
165
165
  def read_definitions_file
166
166
  if File.exist?(layouts_file_path)
167
- YAML.safe_load(ERB.new(File.read(layouts_file_path)).result, YAML_WHITELIST_CLASSES, [], true) || []
167
+ Array.wrap(
168
+ YAML.safe_load(
169
+ ERB.new(File.read(layouts_file_path)).result, YAML_WHITELIST_CLASSES, [], true
170
+ ) || []
171
+ )
168
172
  else
169
173
  raise LoadError, "Could not find page_layouts.yml file! Please run `rails generate alchemy:install`"
170
174
  end
@@ -103,24 +103,26 @@ module Alchemy
103
103
  ]
104
104
 
105
105
  # Controller actions
106
- can :leave, :alchemy_admin
107
- can [:info, :help], :alchemy_admin_dashboard
108
- can :manage, :alchemy_admin_clipboard
109
- can :index, :trash
110
- can :edit, :alchemy_admin_layoutpages
111
- can :tree, :alchemy_admin_pages
106
+ can :leave, :alchemy_admin
107
+ can [:info, :help], :alchemy_admin_dashboard
108
+ can :manage, :alchemy_admin_clipboard
109
+ can :index, :trash
110
+ can :edit, :alchemy_admin_layoutpages
111
+ can :tree, :alchemy_admin_pages
112
112
 
113
113
  # Resources
114
- can [:read, :download], Alchemy::Attachment
115
- can :manage, Alchemy::Content
116
- can :manage, Alchemy::Element
117
- can :manage, Alchemy::EssenceFile
118
- can :manage, Alchemy::EssencePicture
119
- can :manage, Alchemy::LegacyPageUrl
120
- can :manage, Alchemy::Node
121
- can :read, Alchemy::Picture
114
+ can [:read, :download], Alchemy::Attachment
115
+ can :manage, Alchemy::Content
116
+ can :manage, Alchemy::Element
117
+ can :manage, Alchemy::EssenceFile
118
+ can :manage, Alchemy::EssencePicture
119
+ can :manage, Alchemy::LegacyPageUrl
120
+ can :manage, Alchemy::Node
121
+ can :read, Alchemy::Picture
122
122
  can [:read, :autocomplete], Alchemy::Tag
123
- can(:edit_content, Alchemy::Page) { |p| p.editable_by?(@user) }
123
+ can :edit_content, Alchemy::Page, Alchemy::Page.all do |page|
124
+ page.editable_by?(@user)
125
+ end
124
126
  end
125
127
  end
126
128
 
@@ -169,7 +171,7 @@ module Alchemy
169
171
  can :manage, Alchemy::Picture
170
172
  can :manage, Alchemy::Attachment
171
173
  can :manage, Alchemy::Tag
172
- can :index, Alchemy::Language
174
+ can :index, Alchemy::Language
173
175
  end
174
176
  end
175
177
 
@@ -184,14 +186,14 @@ module Alchemy
184
186
  alchemy_editor_rules
185
187
 
186
188
  # Navigation
187
- can :index, [:alchemy_admin_sites, :alchemy_admin_styleguide]
189
+ can :index, [:alchemy_admin_sites, :alchemy_admin_styleguide]
188
190
 
189
191
  # Controller actions
190
192
  can [:info, :update_check], :alchemy_admin_dashboard
191
193
 
192
194
  # Resources
193
- can :manage, Alchemy::Language
194
- can :manage, Alchemy::Site
195
+ can :manage, Alchemy::Language
196
+ can :manage, Alchemy::Site
195
197
  end
196
198
  end
197
199
 
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Alchemy
4
- VERSION = "5.3.5"
4
+ VERSION = "5.3.8"
5
5
 
6
6
  def self.version
7
7
  VERSION
data/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alchemy_cms/admin",
3
- "version": "5.3.4",
3
+ "version": "5.3.8",
4
4
  "description": "AlchemyCMS",
5
5
  "browser": "package/admin.js",
6
6
  "files": [
@@ -64,7 +64,7 @@ html[dir="rtl"] .select2-container .select2-choice {
64
64
  }
65
65
 
66
66
  .select2-container.select2-allowclear .select2-choice .select2-chosen {
67
- margin-right: 42px;
67
+ margin-right: 38px;
68
68
  }
69
69
 
70
70
  .select2-container .select2-choice > .select2-chosen {
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: alchemy_cms
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.3.5
4
+ version: 5.3.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thomas von Deyen
@@ -13,7 +13,7 @@ authors:
13
13
  autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
- date: 2022-04-26 00:00:00.000000000 Z
16
+ date: 2022-09-02 00:00:00.000000000 Z
17
17
  dependencies:
18
18
  - !ruby/object:Gem::Dependency
19
19
  name: active_model_serializers
@@ -1278,7 +1278,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
1278
1278
  version: '0'
1279
1279
  requirements:
1280
1280
  - ImageMagick (libmagick), v6.6 or greater.
1281
- rubygems_version: 3.1.6
1281
+ rubygems_version: 3.3.7
1282
1282
  signing_key:
1283
1283
  specification_version: 4
1284
1284
  summary: A powerful, userfriendly and flexible CMS for Rails