alchemy_cms 6.0.6 → 6.0.9

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 alchemy_cms might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ac4238ff0e22f613444f1ae9124a20bf4e884f2f7c4f8fe05c1e8d0bd147cad7
4
- data.tar.gz: 02e2877398db81eb4c58a1afbad4c0355020da0fb7505c895d493d40a93223d7
3
+ metadata.gz: 23531a0233f0633efb7c6c17b3bb79eb6a0fd5536e34766aa76840a43c594c9b
4
+ data.tar.gz: 3d8a8f2a8266b3fa5982de4009b9703d3ef3b585e1cb35ed2381daedfd110395
5
5
  SHA512:
6
- metadata.gz: 2bacfe8d1e126cc3a3e31f5dfdb1346efb1398adf33dac32e4e58731bcfd11580d51544797a59d563361ee28c5d4a37a76a7659b7534651a574c7903820cc994
7
- data.tar.gz: '04198e8f916fd87a5a1587129b86480cde12cbab889acfa2baaf23a34ed966292cc24312c1b731648c556e27fc3045b0a5b56d43ab6124abacbcb33cdf05fab2'
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
- # Necessary until a new 6.1.5 version has been released
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) =>
@@ -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;
@@ -24,6 +24,7 @@ module Alchemy
24
24
  :controls,
25
25
  :loop,
26
26
  :muted,
27
+ :playsinline,
27
28
  :preload,
28
29
  :attachment_id
29
30
  )
@@ -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|
@@ -25,6 +25,7 @@ module Alchemy
25
25
  elements: [
26
26
  :page,
27
27
  :touchable_pages,
28
+ :tags,
28
29
  {
29
30
  ingredients: :related_object,
30
31
  contents: :essence,
@@ -12,6 +12,7 @@ module Alchemy
12
12
  :height,
13
13
  :loop,
14
14
  :muted,
15
+ :playsinline,
15
16
  :preload,
16
17
  :width
17
18
 
@@ -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] = image_file_width * ratio
101
+ sizes[:width] = (sizes[:height] * ratio).round.to_i
102
102
  end
103
103
  if sizes[:height].zero?
104
- sizes[:height] = image_file_width / ratio
104
+ sizes[:height] = (sizes[:width] / ratio).round.to_i
105
105
  end
106
106
 
107
107
  sizes
@@ -21,6 +21,7 @@ module Alchemy
21
21
  class_name.constantize.where(id: ids).delete_all
22
22
  end
23
23
  contents.delete_all
24
+ Gutentag::Tagging.where(taggable: elements).delete_all
24
25
  delete_elements
25
26
  end
26
27
 
@@ -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') %>
@@ -5,6 +5,7 @@
5
5
  <%= f.input :controls %>
6
6
  <%= f.input :loop %>
7
7
  <%= f.input :muted %>
8
+ <%= f.input :playsinline %>
8
9
  <%= f.input :preload, collection: %w(auto none metadata),
9
10
  include_blank: false, input_html: {class: 'alchemy_selectbox'} %>
10
11
  <%= f.submit Alchemy.t(:save) %>
@@ -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 %>
@@ -4,6 +4,7 @@
4
4
  autoplay: video_view.autoplay,
5
5
  loop: video_view.loop,
6
6
  muted: video_view.muted,
7
+ playsinline: video_view.playsinline,
7
8
  preload: video_view.preload.presence,
8
9
  width: video_view.width.presence,
9
10
  height: video_view.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
@@ -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
- YAML.safe_load(
155
- ERB.new(File.read(layouts_file_path)).result,
156
- permitted_classes: YAML_PERMITTED_CLASSES,
157
- aliases: true,
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
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Alchemy
4
- VERSION = "6.0.6"
4
+ VERSION = "6.0.9"
5
5
 
6
6
  def self.version
7
7
  VERSION
@@ -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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alchemy_cms/admin",
3
- "version": "6.0.6",
3
+ "version": "6.0.9",
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: 6.0.6
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-05-30 00:00:00.000000000 Z
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