alchemy_cms 6.0.8 → 6.0.9

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: fd912f837c7ac9042900c8ec5c75e9cf9a1b48ba65ac3130b6096ae7ce7dbc1b
4
- data.tar.gz: 020bdbb64fcf91003f7d4d4ac35290a3160cd0917ebb80b36f9a8c0f42123647
3
+ metadata.gz: 23531a0233f0633efb7c6c17b3bb79eb6a0fd5536e34766aa76840a43c594c9b
4
+ data.tar.gz: 3d8a8f2a8266b3fa5982de4009b9703d3ef3b585e1cb35ed2381daedfd110395
5
5
  SHA512:
6
- metadata.gz: 91764077564dfbd9239073907bf1f0ca0b418c870f91bf26236d6fcefd2074ea55ab38db8be6561ffc07f17fd8c3d3db245b774678125ef0abfa60f08dc9837d
7
- data.tar.gz: 4e62bdd3090475ce33be138e827866fa98abe34a9d8c450359fbc7a269ffd92461f0bef5bf7456fca30adb731c44802c8d8489900303afd2e655330850b7f3df
6
+ metadata.gz: 8ceb3ac0a3f6f833f5c15bfe3bc91d1e42970a03f32c373941d57574405395906fcfa16e373f2cc6db71648a93cfa6e7d37f479dc230f716270aba6539dcc62d
7
+ data.tar.gz: 02d7428a535cef3b642edec8cdfb2cc7ed77360ea5033de128c2da899d28a24819cbe3026b2dd21a98f280faf505caa76745a103800a0401c5d96f42ae31fcd4
data/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
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
+
1
9
  ## 6.0.8 (2022-06-10)
2
10
 
3
11
  - Fix admin page tree links after update [#2348](https://github.com/AlchemyCMS/alchemy_cms/pull/2348) ([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"
@@ -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
 
@@ -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'} %>
@@ -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
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Alchemy
4
- VERSION = "6.0.8"
4
+ VERSION = "6.0.9"
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": "6.0.8",
3
+ "version": "6.0.9",
4
4
  "description": "AlchemyCMS",
5
5
  "browser": "package/admin.js",
6
6
  "files": [
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.8
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-06-10 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