alchemy_cms 6.0.6 → 6.0.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +18 -0
- data/Gemfile +1 -9
- data/app/assets/javascripts/alchemy/alchemy.link_dialog.js.coffee +1 -1
- data/app/assets/stylesheets/alchemy/selects.scss +0 -4
- data/app/controllers/alchemy/admin/essence_videos_controller.rb +1 -0
- data/app/controllers/alchemy/admin/pages_controller.rb +2 -0
- data/app/models/alchemy/eager_loading.rb +1 -0
- data/app/models/alchemy/ingredients/video.rb +1 -0
- data/app/models/alchemy/page.rb +11 -0
- data/app/models/alchemy/picture/transformations.rb +2 -2
- data/app/services/alchemy/delete_elements.rb +1 -0
- data/app/views/alchemy/admin/dashboard/_locked_pages.html.erb +1 -1
- data/app/views/alchemy/admin/essence_videos/edit.html.erb +1 -0
- data/app/views/alchemy/admin/ingredients/_video_fields.html.erb +1 -0
- data/app/views/alchemy/admin/pages/update.js.erb +1 -1
- data/app/views/alchemy/essences/_essence_video_view.html.erb +1 -0
- data/app/views/alchemy/ingredients/_video_view.html.erb +1 -0
- data/config/locales/alchemy.en.yml +4 -0
- data/db/migrate/20220514072456_restrict_on_delete_page_id_foreign_key_from_alchemy_nodes.rb +13 -0
- data/db/migrate/20220622130905_add_playsinline_to_alchemy_essence_videos.rb +9 -0
- data/lib/alchemy/page_layout.rb +8 -6
- data/lib/alchemy/version.rb +1 -1
- data/lib/tasks/alchemy/thumbnails.rake +9 -0
- data/package.json +1 -1
- data/vendor/assets/stylesheets/alchemy_admin/select2.scss +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 23531a0233f0633efb7c6c17b3bb79eb6a0fd5536e34766aa76840a43c594c9b
|
4
|
+
data.tar.gz: 3d8a8f2a8266b3fa5982de4009b9703d3ef3b585e1cb35ed2381daedfd110395
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8ceb3ac0a3f6f833f5c15bfe3bc91d1e42970a03f32c373941d57574405395906fcfa16e373f2cc6db71648a93cfa6e7d37f479dc230f716270aba6539dcc62d
|
7
|
+
data.tar.gz: 02d7428a535cef3b642edec8cdfb2cc7ed77360ea5033de128c2da899d28a24819cbe3026b2dd21a98f280faf505caa76745a103800a0401c5d96f42ae31fcd4
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,21 @@
|
|
1
|
+
## 6.0.9 (2022-07-25)
|
2
|
+
|
3
|
+
- Allow Site managers to remove page locks [#2360](https://github.com/AlchemyCMS/alchemy_cms/pull/2360) ([mamhoff](https://github.com/mamhoff))
|
4
|
+
- Add tags to Alchemy::EagerLoading [#2359](https://github.com/AlchemyCMS/alchemy_cms/pull/2359) ([mamhoff](https://github.com/mamhoff))
|
5
|
+
- Delete Gutentag Taggings in Alchemy::DeleteElements [#2358](https://github.com/AlchemyCMS/alchemy_cms/pull/2358) ([mamhoff](https://github.com/mamhoff))
|
6
|
+
- Fix PictureTransformations#inferred_sizes_from_string [#2356](https://github.com/AlchemyCMS/alchemy_cms/pull/2356) ([mamhoff](https://github.com/mamhoff))
|
7
|
+
- add playsinline attribute to ingredient and essence [#2351](https://github.com/AlchemyCMS/alchemy_cms/pull/2351) ([pascalbetz](https://github.com/pascalbetz))
|
8
|
+
|
9
|
+
## 6.0.8 (2022-06-10)
|
10
|
+
|
11
|
+
- Fix admin page tree links after update [#2348](https://github.com/AlchemyCMS/alchemy_cms/pull/2348) ([tvdeyen](https://github.com/tvdeyen))
|
12
|
+
- Fix initial selection of internal page link select [#2346](https://github.com/AlchemyCMS/alchemy_cms/pull/2346) ([tvdeyen](https://github.com/tvdeyen))
|
13
|
+
|
14
|
+
## 6.0.7 (2022-06-04)
|
15
|
+
|
16
|
+
- Eagerly generate thumbs for srcset images in task as well [#2344](https://github.com/AlchemyCMS/alchemy_cms/pull/2344) ([tvdeyen](https://github.com/tvdeyen))
|
17
|
+
- 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))
|
18
|
+
|
1
19
|
## 6.0.6 (2022-05-30)
|
2
20
|
|
3
21
|
- Add task to eagerly generate ingredients pictures thumbnails [#2342](https://github.com/AlchemyCMS/alchemy_cms/pull/2342) ([tvdeyen](https://github.com/tvdeyen))
|
data/Gemfile
CHANGED
@@ -4,15 +4,7 @@ source "https://rubygems.org"
|
|
4
4
|
gemspec
|
5
5
|
|
6
6
|
rails_version = ENV.fetch("RAILS_VERSION", 7.0).to_f
|
7
|
-
|
8
|
-
# https://github.com/rails/rails/pull/44691
|
9
|
-
if rails_version.to_s.match?(/6.1/)
|
10
|
-
gem "rails", git: "https://github.com/rails/rails", branch: "6-1-stable"
|
11
|
-
elsif rails_version.to_s.match?(/7.0/)
|
12
|
-
gem "rails", git: "https://github.com/rails/rails", branch: "7-0-stable"
|
13
|
-
else
|
14
|
-
gem "rails", "~> #{rails_version}.0"
|
15
|
-
end
|
7
|
+
gem "rails", "~> #{rails_version}.0"
|
16
8
|
|
17
9
|
if ENV["DB"].nil? || ENV["DB"] == "sqlite"
|
18
10
|
gem "sqlite3", "~> 1.4.1"
|
@@ -94,7 +94,7 @@ class window.Alchemy.LinkDialog extends Alchemy.Dialog
|
|
94
94
|
urlname = $element.val()
|
95
95
|
$.get Alchemy.routes.api_pages_path,
|
96
96
|
q:
|
97
|
-
urlname_eq: urlname.replace(/^\/([a-z]{2}(-[A-Z]{2})?\/)
|
97
|
+
urlname_eq: urlname.replace(/^\/([a-z]{2}(-[A-Z]{2})?\/)?(.+?)\/?$/, '$3')
|
98
98
|
page: 1
|
99
99
|
per_page: 1,
|
100
100
|
(data) =>
|
@@ -145,6 +145,8 @@ module Alchemy
|
|
145
145
|
# Remove page from clipboard
|
146
146
|
clipboard = get_clipboard("pages")
|
147
147
|
clipboard.delete_if { |item| item["id"] == @page.id.to_s }
|
148
|
+
else
|
149
|
+
flash[:warning] = @page.errors.full_messages.to_sentence
|
148
150
|
end
|
149
151
|
|
150
152
|
respond_to do |format|
|
data/app/models/alchemy/page.rb
CHANGED
@@ -129,6 +129,11 @@ module Alchemy
|
|
129
129
|
before_create -> { versions.build },
|
130
130
|
if: -> { versions.none? }
|
131
131
|
|
132
|
+
before_destroy if: -> { nodes.any? } do
|
133
|
+
errors.add(:nodes, :still_present)
|
134
|
+
throw(:abort)
|
135
|
+
end
|
136
|
+
|
132
137
|
before_save :set_language_code,
|
133
138
|
if: -> { language.present? }
|
134
139
|
|
@@ -565,6 +570,12 @@ module Alchemy
|
|
565
570
|
locker.try(:name) || Alchemy.t("unknown")
|
566
571
|
end
|
567
572
|
|
573
|
+
# Key hint translations by page layout, rather than the default name.
|
574
|
+
#
|
575
|
+
def hint_translation_attribute
|
576
|
+
page_layout
|
577
|
+
end
|
578
|
+
|
568
579
|
# Menus (aka. root nodes) this page is attached to
|
569
580
|
#
|
570
581
|
def menus
|
@@ -98,10 +98,10 @@ module Alchemy
|
|
98
98
|
ratio = image_file_width.to_f / image_file_height
|
99
99
|
|
100
100
|
if sizes[:width].zero?
|
101
|
-
sizes[:width] =
|
101
|
+
sizes[:width] = (sizes[:height] * ratio).round.to_i
|
102
102
|
end
|
103
103
|
if sizes[:height].zero?
|
104
|
-
sizes[:height] =
|
104
|
+
sizes[:height] = (sizes[:width] / ratio).round.to_i
|
105
105
|
end
|
106
106
|
|
107
107
|
sizes
|
@@ -36,7 +36,7 @@
|
|
36
36
|
<% end %>
|
37
37
|
</td>
|
38
38
|
<td>
|
39
|
-
<% if current_alchemy_user.id == page.locked_by %>
|
39
|
+
<% if (current_alchemy_user.id == page.locked_by) || can?(:manage, Alchemy::Site.current) %>
|
40
40
|
<%= form_tag(alchemy.unlock_admin_page_path(page, :redirect_to => alchemy.admin_dashboard_url)) do %>
|
41
41
|
<button class="icon_button small" title="<%= Alchemy.t(:explain_unlocking) %>">
|
42
42
|
<%= render_icon(:times, size: 'xs') %>
|
@@ -4,5 +4,6 @@
|
|
4
4
|
<%= f.input :controls, as: :boolean %>
|
5
5
|
<%= f.input :loop, as: :boolean %>
|
6
6
|
<%= f.input :muted, as: :boolean %>
|
7
|
+
<%= f.input :playsinline, as: :boolean %>
|
7
8
|
<%= f.input :preload, collection: %w(auto none metadata),
|
8
9
|
include_blank: false, input_html: {class: 'alchemy_selectbox'} %>
|
@@ -18,7 +18,7 @@
|
|
18
18
|
<% else -%>
|
19
19
|
|
20
20
|
if (page) {
|
21
|
-
var page_html = "<%= j render('page', page: @page) %>"
|
21
|
+
var page_html = "<%= j render('page', page: @page) %>".replace(/__ID__/g, "<%= @page.id %>");;
|
22
22
|
var compiler = Handlebars.compile(page_html);
|
23
23
|
var tree = <%== @tree.to_json %>;
|
24
24
|
page.outerHTML = compiler(tree.pages[0]);
|
@@ -5,6 +5,7 @@
|
|
5
5
|
autoplay: content.essence.autoplay,
|
6
6
|
loop: content.essence.loop,
|
7
7
|
muted: content.essence.muted,
|
8
|
+
playsinline: content.essence.playsinline,
|
8
9
|
preload: content.essence.preload.presence,
|
9
10
|
width: content.essence.width.presence,
|
10
11
|
height: content.essence.height.presence do %>
|
@@ -777,6 +777,10 @@ en:
|
|
777
777
|
attributes:
|
778
778
|
pages:
|
779
779
|
still_present: "are still attached to this language. Please remove them first."
|
780
|
+
alchemy/page:
|
781
|
+
attributes:
|
782
|
+
nodes:
|
783
|
+
still_present: "are still attached to this page. Please remove them first."
|
780
784
|
models:
|
781
785
|
gutentag/tag:
|
782
786
|
one: Tag
|
@@ -0,0 +1,13 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
class RestrictOnDeletePageIdForeignKeyFromAlchemyNodes < ActiveRecord::Migration[6.0]
|
4
|
+
def up
|
5
|
+
remove_foreign_key :alchemy_nodes, :alchemy_pages
|
6
|
+
add_foreign_key :alchemy_nodes, :alchemy_pages, column: :page_id, on_delete: :restrict
|
7
|
+
end
|
8
|
+
|
9
|
+
def down
|
10
|
+
remove_foreign_key :alchemy_nodes, :alchemy_pages
|
11
|
+
add_foreign_key :alchemy_nodes, :alchemy_pages, column: :page_id, on_delete: :cascade
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,9 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
class AddPlaysinlineToAlchemyEssenceVideos < ActiveRecord::Migration[6.0]
|
4
|
+
def change
|
5
|
+
return if column_exists?(:alchemy_essence_videos, :playsinline)
|
6
|
+
|
7
|
+
add_column :alchemy_essence_videos, :playsinline, :boolean, default: false, null: false
|
8
|
+
end
|
9
|
+
end
|
data/lib/alchemy/page_layout.rb
CHANGED
@@ -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.
|
@@ -151,11 +151,13 @@ module Alchemy
|
|
151
151
|
#
|
152
152
|
def read_definitions_file
|
153
153
|
if File.exist?(layouts_file_path)
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
154
|
+
Array.wrap(
|
155
|
+
YAML.safe_load(
|
156
|
+
ERB.new(File.read(layouts_file_path)).result,
|
157
|
+
permitted_classes: YAML_PERMITTED_CLASSES,
|
158
|
+
aliases: true,
|
159
|
+
) || []
|
160
|
+
)
|
159
161
|
else
|
160
162
|
raise LoadError, "Could not find page_layouts.yml file! Please run `rails generate alchemy:install`"
|
161
163
|
end
|
data/lib/alchemy/version.rb
CHANGED
@@ -6,6 +6,7 @@ namespace :alchemy do
|
|
6
6
|
task thumbnails: [
|
7
7
|
"alchemy:generate:picture_thumbnails",
|
8
8
|
"alchemy:generate:essence_picture_thumbnails",
|
9
|
+
"alchemy:generate:ingredient_picture_thumbnails",
|
9
10
|
]
|
10
11
|
|
11
12
|
desc "Generates thumbnails for Alchemy Pictures."
|
@@ -31,6 +32,10 @@ namespace :alchemy do
|
|
31
32
|
essence_pictures.find_each do |essence_picture|
|
32
33
|
puts essence_picture.picture_url
|
33
34
|
puts essence_picture.thumbnail_url
|
35
|
+
|
36
|
+
essence_picture.settings.fetch(:srcset, []).each do |src|
|
37
|
+
puts essence_picture.picture_url(src)
|
38
|
+
end
|
34
39
|
end
|
35
40
|
|
36
41
|
puts "Done!"
|
@@ -55,6 +60,10 @@ namespace :alchemy do
|
|
55
60
|
ingredient_pictures.find_each do |ingredient_picture|
|
56
61
|
puts ingredient_picture.picture_url
|
57
62
|
puts ingredient_picture.thumbnail_url
|
63
|
+
|
64
|
+
ingredient_picture.settings.fetch(:srcset, []).each do |src|
|
65
|
+
puts ingredient_picture.picture_url(src)
|
66
|
+
end
|
58
67
|
end
|
59
68
|
|
60
69
|
puts "Done!"
|
data/package.json
CHANGED
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: 6.0.
|
4
|
+
version: 6.0.9
|
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-
|
16
|
+
date: 2022-07-25 00:00:00.000000000 Z
|
17
17
|
dependencies:
|
18
18
|
- !ruby/object:Gem::Dependency
|
19
19
|
name: actionmailer
|
@@ -1293,6 +1293,8 @@ files:
|
|
1293
1293
|
- db/migrate/20210506135919_create_essence_audios.rb
|
1294
1294
|
- db/migrate/20210506140258_create_essence_videos.rb
|
1295
1295
|
- db/migrate/20210508091432_create_alchemy_ingredients.rb
|
1296
|
+
- db/migrate/20220514072456_restrict_on_delete_page_id_foreign_key_from_alchemy_nodes.rb
|
1297
|
+
- db/migrate/20220622130905_add_playsinline_to_alchemy_essence_videos.rb
|
1296
1298
|
- lib/alchemy.rb
|
1297
1299
|
- lib/alchemy/ability_helper.rb
|
1298
1300
|
- lib/alchemy/admin/locale.rb
|