alchemy_cms 7.4.5 → 7.4.6
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 +4 -4
- data/CHANGELOG.md +6 -0
- data/app/controllers/alchemy/admin/picture_descriptions_controller.rb +5 -1
- data/app/controllers/alchemy/admin/pictures_controller.rb +1 -0
- data/app/controllers/concerns/alchemy/admin/picture_descriptions_form_helper.rb +16 -0
- data/app/javascript/alchemy_admin/components/action.js +2 -0
- data/app/javascript/alchemy_admin/components/growl.js +1 -0
- data/app/views/alchemy/admin/picture_descriptions/_form.html.erb +5 -7
- data/app/views/alchemy/admin/picture_descriptions/edit.html.erb +2 -2
- data/app/views/alchemy/admin/pictures/_form.html.erb +2 -2
- data/app/views/alchemy/admin/pictures/_picture_description_field.html.erb +21 -13
- data/app/views/alchemy/base/500.turbo_stream.erb +3 -0
- data/db/migrate/20250626160259_add_unique_index_to_picture_descriptions.rb +7 -0
- data/lib/alchemy/version.rb +1 -1
- metadata +4 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dac52b8382bc65dd200d1e8c0217e0a53b7e5774f2b074c6a3bc6716da242e41
|
4
|
+
data.tar.gz: ddbd1426fedc2282cb82b3ece15d1d6b1a9553c0da5b7f640b84198599c6eca9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 213cf6190790413cfd04f8e0b6fc9f8c45fe718d2474a5c2aa097cbb455986989491cf149ffcf8d2bad15e0d21fff2c2894d7eb3fedb5f5acab743e38d9c6d53
|
7
|
+
data.tar.gz: b6f588b2940581cd18a33bc1e126d8b128f5ce78c403ec79db66e320605df8088fa84d856efe6e84912d3909e40fed4d7ea5764b68f99c304c04e173fb00ab99
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,11 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## 7.4.6 (2025-27-06)
|
4
|
+
|
5
|
+
- [7.4-stable] Fix multi language picture descriptions [#3293](https://github.com/AlchemyCMS/alchemy_cms/pull/3293) ([alchemycms-bot](https://github.com/alchemycms-bot))
|
6
|
+
- [7.4-stable] Add server error turbo_stream template [#3292](https://github.com/AlchemyCMS/alchemy_cms/pull/3292) ([alchemycms-bot](https://github.com/alchemycms-bot))
|
7
|
+
- [7.4-stable] Remove non visual custom elements after connect [#3291](https://github.com/AlchemyCMS/alchemy_cms/pull/3291) ([alchemycms-bot](https://github.com/alchemycms-bot))
|
8
|
+
|
3
9
|
## 7.4.5 (2025-06-04)
|
4
10
|
|
5
11
|
- [7.4] Fix attachment overlay list overflow [#3261](https://github.com/AlchemyCMS/alchemy_cms/pull/3261) ([tvdeyen](https://github.com/tvdeyen))
|
@@ -1,8 +1,12 @@
|
|
1
1
|
module Alchemy
|
2
2
|
module Admin
|
3
3
|
class PictureDescriptionsController < Alchemy::Admin::ResourcesController
|
4
|
+
include PictureDescriptionsFormHelper
|
5
|
+
|
4
6
|
def edit
|
5
|
-
@picture_description = @picture.descriptions.find_or_initialize_by(
|
7
|
+
@picture_description = @picture.descriptions.find_or_initialize_by(
|
8
|
+
language_id: params[:language_id]
|
9
|
+
)
|
6
10
|
end
|
7
11
|
|
8
12
|
private
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module Alchemy
|
2
|
+
module Admin
|
3
|
+
module PictureDescriptionsFormHelper
|
4
|
+
extend ActiveSupport::Concern
|
5
|
+
|
6
|
+
included do
|
7
|
+
helper_method :description_field_name_prefix
|
8
|
+
end
|
9
|
+
|
10
|
+
def description_field_name_prefix
|
11
|
+
picture_description_counter = @picture.descriptions.index(@picture_description)
|
12
|
+
"picture[descriptions_attributes][#{picture_description_counter}]"
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -1,11 +1,9 @@
|
|
1
|
-
<% field_name_prefix = "picture[descriptions_attributes][#{picture_description_counter}]" %>
|
2
|
-
|
3
1
|
<% if picture_description.persisted? %>
|
4
|
-
<%= hidden_field
|
2
|
+
<%= hidden_field description_field_name_prefix, :id, value: picture_description.id %>
|
5
3
|
<% else %>
|
6
|
-
<%= hidden_field
|
7
|
-
<%= hidden_field
|
4
|
+
<%= hidden_field description_field_name_prefix, :language_id, value: picture_description.language_id %>
|
5
|
+
<%= hidden_field description_field_name_prefix, :picture_id, value: picture_description.picture_id %>
|
8
6
|
<% end %>
|
9
7
|
|
10
|
-
<%= label
|
11
|
-
<%= text_area
|
8
|
+
<%= label description_field_name_prefix, :text, Alchemy::PictureDescription.human_attribute_name(:text), class: "control-label" %>
|
9
|
+
<%= text_area description_field_name_prefix, :text, value: picture_description.text, rows: 5 %>
|
@@ -1,6 +1,6 @@
|
|
1
1
|
<turbo-frame id="picture_descriptions">
|
2
2
|
<%= render "form", {
|
3
|
-
|
4
|
-
|
3
|
+
description_field_name_prefix: description_field_name_prefix,
|
4
|
+
picture_description: @picture_description
|
5
5
|
} %>
|
6
6
|
</turbo-frame>
|
@@ -1,7 +1,7 @@
|
|
1
1
|
<%= turbo_frame_tag(@picture) do %>
|
2
|
-
<%= alchemy_form_for [:admin, @picture] do |f| %>
|
2
|
+
<%= alchemy_form_for [alchemy, :admin, @picture] do |f| %>
|
3
3
|
<%= f.input :name %>
|
4
|
-
<%= render "picture_description_field", f: f %>
|
4
|
+
<%= render "alchemy/admin/pictures/picture_description_field", f: f %>
|
5
5
|
<%= render Alchemy::Admin::TagsAutocomplete.new(additional_class: "input") do %>
|
6
6
|
<%= f.label :tag_list %>
|
7
7
|
<%= f.text_field :tag_list, value: f.object.tag_list.join(",") %>
|
@@ -2,30 +2,38 @@
|
|
2
2
|
<% if Alchemy::Language.published.many? %>
|
3
3
|
<label class="inline-label" style="float: right">
|
4
4
|
<%= Alchemy::Language.model_name.human %>
|
5
|
-
<%=
|
5
|
+
<%= select description_field_name_prefix, :language_id, options_from_collection_for_select(
|
6
6
|
Alchemy::Language.published, :id, ->(l) { l.code.upcase },
|
7
7
|
selected: @picture_description.language_id,
|
8
|
-
),
|
9
|
-
|
8
|
+
),
|
9
|
+
{},
|
10
|
+
id: "picture_description_select",
|
11
|
+
data: {
|
12
|
+
url: alchemy.edit_admin_picture_description_url(
|
13
|
+
id: @picture_description.id || "__ID__",
|
14
|
+
picture_id: @picture
|
15
|
+
)
|
10
16
|
} %>
|
11
17
|
</label>
|
12
18
|
<% end %>
|
13
19
|
|
14
20
|
<turbo-frame id="picture_descriptions">
|
15
21
|
<%= render "alchemy/admin/picture_descriptions/form",
|
16
|
-
|
22
|
+
description_field_name_prefix: description_field_name_prefix,
|
17
23
|
picture_description: @picture_description %>
|
18
24
|
</turbo-frame>
|
19
25
|
</div>
|
20
26
|
|
21
|
-
<script
|
22
|
-
|
27
|
+
<script>
|
28
|
+
(function ($) {
|
29
|
+
const select = $.getElementById("picture_description_select")
|
23
30
|
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
+
if (select) {
|
32
|
+
select.addEventListener("change", () => {
|
33
|
+
const url = new URL(select.dataset.url)
|
34
|
+
url.searchParams.set("language_id", select.value)
|
35
|
+
Turbo.visit(url, { frame: "picture_descriptions" })
|
36
|
+
})
|
37
|
+
}
|
38
|
+
})(document)
|
31
39
|
</script>
|
data/lib/alchemy/version.rb
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: 7.4.
|
4
|
+
version: 7.4.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Thomas von Deyen
|
@@ -801,6 +801,7 @@ files:
|
|
801
801
|
- app/controllers/concerns/alchemy/admin/archive_overlay.rb
|
802
802
|
- app/controllers/concerns/alchemy/admin/crop_action.rb
|
803
803
|
- app/controllers/concerns/alchemy/admin/current_language.rb
|
804
|
+
- app/controllers/concerns/alchemy/admin/picture_descriptions_form_helper.rb
|
804
805
|
- app/controllers/concerns/alchemy/admin/uploader_responses.rb
|
805
806
|
- app/controllers/concerns/alchemy/legacy_page_redirects.rb
|
806
807
|
- app/controllers/concerns/alchemy/site_redirects.rb
|
@@ -1135,6 +1136,7 @@ files:
|
|
1135
1136
|
- app/views/alchemy/attachments/show.html.erb
|
1136
1137
|
- app/views/alchemy/base/403.html.erb
|
1137
1138
|
- app/views/alchemy/base/500.html.erb
|
1139
|
+
- app/views/alchemy/base/500.turbo_stream.erb
|
1138
1140
|
- app/views/alchemy/base/error_notice.html.erb
|
1139
1141
|
- app/views/alchemy/base/error_notice.js.erb
|
1140
1142
|
- app/views/alchemy/base/permission_denied.js.erb
|
@@ -1223,6 +1225,7 @@ files:
|
|
1223
1225
|
- db/migrate/20230505132743_add_indexes_to_alchemy_pictures.rb
|
1224
1226
|
- db/migrate/20231113104432_create_page_mutexes.rb
|
1225
1227
|
- db/migrate/20240314105244_create_alchemy_picture_descriptions.rb
|
1228
|
+
- db/migrate/20250626160259_add_unique_index_to_picture_descriptions.rb
|
1226
1229
|
- eslint.config.js
|
1227
1230
|
- lib/alchemy.rb
|
1228
1231
|
- lib/alchemy/ability_helper.rb
|