alchemy_cms 7.1.3 → 7.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/app/assets/stylesheets/alchemy/archive.scss +1 -1
- data/app/assets/stylesheets/alchemy/labels.scss +1 -4
- data/app/controllers/alchemy/admin/languages_controller.rb +2 -1
- data/app/controllers/concerns/alchemy/admin/current_language.rb +5 -1
- data/app/javascript/alchemy_admin/sortable_elements.js +11 -6
- data/app/models/alchemy/page/page_elements.rb +11 -2
- data/app/views/alchemy/admin/elements/create.js.erb +1 -3
- data/app/views/alchemy/admin/tags/_tag.html.erb +5 -1
- data/lib/alchemy/controller_actions.rb +4 -17
- data/lib/alchemy/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a6c615cf9ac7a5ea2ca6d9a146cf61aab6511bcfa4277740e8989492288427e9
|
4
|
+
data.tar.gz: 3a35e7708046a45c5abdc50403428c9fe153e95634a97a3ee6dc3552b3401030
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 78fedab87a5984f88f012177c31133570647b7c7816a55ded8f56127fdf54070b6d6367db843214af1d38e45099502e309be950ceeb14bc78580158e5958ef21
|
7
|
+
data.tar.gz: 1d251b4a5ba8c0e0287d314d7c06a343ba83bf068b1afb243b026fa9dae254477c73639b4c5c67f7e96e820124255dd08d0eedb11eff127b1d53553e40e8d77e
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,13 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## 7.1.4 (2024-02-27)
|
4
|
+
|
5
|
+
- [7.1-stable] Merge pull request #2752 from tvdeyen/fix-copy-elements-order [#2754](https://github.com/AlchemyCMS/alchemy_cms/pull/2754) ([alchemycms-bot](https://github.com/alchemycms-bot))
|
6
|
+
- [7.1-stable] Merge pull request #2750 from tvdeyen/fix-sortable-elements [#2751](https://github.com/AlchemyCMS/alchemy_cms/pull/2751) ([alchemycms-bot](https://github.com/alchemycms-bot))
|
7
|
+
- [7.1-stable] Merge pull request #2689 from robinboening/fix_switching_to_default_language [#2746](https://github.com/AlchemyCMS/alchemy_cms/pull/2746) ([alchemycms-bot](https://github.com/alchemycms-bot))
|
8
|
+
- [7.1-stable] Merge pull request #2741 from tvdeyen/fix-svg-thumbnail-size [#2743](https://github.com/AlchemyCMS/alchemy_cms/pull/2743) ([alchemycms-bot](https://github.com/alchemycms-bot))
|
9
|
+
- [7.1-stable] Merge pull request #2735 from tvdeyen/fix-tags [#2736](https://github.com/AlchemyCMS/alchemy_cms/pull/2736) ([alchemycms-bot](https://github.com/alchemycms-bot))
|
10
|
+
|
3
11
|
## 7.1.3 (2024-02-19)
|
4
12
|
|
5
13
|
- Update tinymce to version 6.8.3 [#2727](https://github.com/AlchemyCMS/alchemy_cms/pull/2727) ([depfu](https://github.com/apps/depfu))
|
@@ -38,7 +38,8 @@ module Alchemy
|
|
38
38
|
end
|
39
39
|
|
40
40
|
def switch
|
41
|
-
set_alchemy_language(params[:language_id])
|
41
|
+
@language = set_alchemy_language(params[:language_id])
|
42
|
+
session[:alchemy_language_id] = @language.id
|
42
43
|
do_redirect_to request.referer || alchemy.admin_dashboard_path
|
43
44
|
end
|
44
45
|
|
@@ -12,7 +12,11 @@ module Alchemy
|
|
12
12
|
private
|
13
13
|
|
14
14
|
def load_current_language
|
15
|
-
@current_language =
|
15
|
+
@current_language = if session[:alchemy_language_id].present?
|
16
|
+
set_alchemy_language(session[:alchemy_language_id])
|
17
|
+
else
|
18
|
+
Alchemy::Language.current
|
19
|
+
end
|
16
20
|
if @current_language.nil?
|
17
21
|
flash[:warning] = Alchemy.t("Please create a language first.")
|
18
22
|
redirect_to admin_languages_path
|
@@ -29,12 +29,17 @@ function onSort(event) {
|
|
29
29
|
params.parent_element_id = parentElement.dataset.elementId
|
30
30
|
}
|
31
31
|
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
32
|
+
// Only send the request if the item was moved to a different container
|
33
|
+
// or sorted in the same list. Not on the old list in order to avoid incrementing
|
34
|
+
// the position of the other elements.
|
35
|
+
if (event.target === event.to) {
|
36
|
+
post(Alchemy.routes.order_admin_elements_path, params).then((response) => {
|
37
|
+
const data = response.data
|
38
|
+
Alchemy.growl(data.message)
|
39
|
+
Alchemy.PreviewWindow.refresh()
|
40
|
+
item.updateTitle(data.preview_text)
|
41
|
+
})
|
42
|
+
}
|
38
43
|
}
|
39
44
|
|
40
45
|
function onEnd() {
|
@@ -37,11 +37,20 @@ module Alchemy
|
|
37
37
|
#
|
38
38
|
def copy_elements(source, target)
|
39
39
|
repository = source.draft_version.element_repository
|
40
|
+
elements = repository.not_nested
|
41
|
+
page_version = target.draft_version
|
42
|
+
duplicate_elements(elements.unfixed, repository, page_version) +
|
43
|
+
duplicate_elements(elements.fixed, repository, page_version)
|
44
|
+
end
|
45
|
+
|
46
|
+
private
|
47
|
+
|
48
|
+
def duplicate_elements(elements, repository, page_version)
|
40
49
|
transaction do
|
41
50
|
Element.acts_as_list_no_update do
|
42
|
-
|
51
|
+
elements.each.with_index(1) do |element, position|
|
43
52
|
Alchemy::DuplicateElement.new(element, repository: repository).call(
|
44
|
-
page_version_id:
|
53
|
+
page_version_id: page_version.id,
|
45
54
|
position: position
|
46
55
|
)
|
47
56
|
end
|
@@ -24,9 +24,7 @@
|
|
24
24
|
$element_area.append(element_html);
|
25
25
|
<%- end -%>
|
26
26
|
|
27
|
-
|
28
|
-
Alchemy.SortableElements('[name="fixed-element-<%= @element.id %>"] .nested-elements');
|
29
|
-
<% end %>
|
27
|
+
Alchemy.SortableElements('[data-element-id="<%= @element.id %>"] .nested-elements');
|
30
28
|
|
31
29
|
Alchemy.growl('<%= Alchemy.t(:successfully_added_element) %>');
|
32
30
|
Alchemy.closeCurrentDialog();
|
@@ -2,7 +2,11 @@
|
|
2
2
|
<td class="icon"><%= render_icon(:tag, size: "xl") %></td>
|
3
3
|
<td class="name"><%= tag.name %></td>
|
4
4
|
<td>
|
5
|
-
|
5
|
+
<% tag.taggings.collect(&:taggable).compact.uniq.each do |taggable| %>
|
6
|
+
<span class="label">
|
7
|
+
<%= taggable.class.model_name.human %>
|
8
|
+
</span>
|
9
|
+
<% end %>
|
6
10
|
</td>
|
7
11
|
<td class="count"><%= tag.taggings.count %></td>
|
8
12
|
<td class="tools">
|
@@ -59,17 +59,15 @@ module Alchemy
|
|
59
59
|
Site.current = current_alchemy_site
|
60
60
|
end
|
61
61
|
|
62
|
-
#
|
62
|
+
# Sets the current language for Alchemy.
|
63
63
|
#
|
64
64
|
def set_alchemy_language(lang = nil)
|
65
65
|
@language = if lang
|
66
66
|
lang.is_a?(Language) ? lang : load_alchemy_language_from_id_or_code(lang)
|
67
67
|
else
|
68
|
-
|
69
|
-
load_alchemy_language_from_params ||
|
70
|
-
load_alchemy_language_from_session ||
|
71
|
-
Language.default
|
68
|
+
load_alchemy_language_from_params || Language.default
|
72
69
|
end
|
70
|
+
|
73
71
|
store_current_alchemy_language(@language)
|
74
72
|
end
|
75
73
|
|
@@ -80,26 +78,15 @@ module Alchemy
|
|
80
78
|
end
|
81
79
|
end
|
82
80
|
|
83
|
-
# Load language from session if it's present on current site.
|
84
|
-
# Otherwise return nil so we can load the default language from current site.
|
85
|
-
def load_alchemy_language_from_session
|
86
|
-
if session[:alchemy_language_id].present? && Site.current
|
87
|
-
Site.current.languages.find_by(id: session[:alchemy_language_id])
|
88
|
-
end
|
89
|
-
end
|
90
|
-
|
91
81
|
def load_alchemy_language_from_id_or_code(id_or_code)
|
92
82
|
Language.find_by(id: id_or_code) ||
|
93
83
|
Language.find_by_code(id_or_code)
|
94
84
|
end
|
95
85
|
|
96
|
-
# Stores language
|
97
|
-
#
|
98
|
-
# Also stores language in +Language.current+
|
86
|
+
# Stores language in +Language.current+
|
99
87
|
#
|
100
88
|
def store_current_alchemy_language(language)
|
101
89
|
if language&.id
|
102
|
-
session[:alchemy_language_id] = language.id
|
103
90
|
Language.current = language
|
104
91
|
end
|
105
92
|
end
|
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.1.
|
4
|
+
version: 7.1.4
|
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: 2024-02-
|
16
|
+
date: 2024-02-27 00:00:00.000000000 Z
|
17
17
|
dependencies:
|
18
18
|
- !ruby/object:Gem::Dependency
|
19
19
|
name: actionmailer
|