alchemy_cms 7.0.7 → 7.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/app/controllers/alchemy/admin/resources_controller.rb +5 -5
- data/app/controllers/alchemy/messages_controller.rb +4 -4
- data/app/models/alchemy/element/element_ingredients.rb +2 -2
- data/app/models/alchemy/ingredient.rb +3 -3
- data/app/models/alchemy/ingredient_validator.rb +2 -2
- data/app/models/alchemy/page.rb +1 -1
- data/app/models/concerns/alchemy/picture_thumbnails.rb +1 -1
- data/app/views/alchemy/admin/elements/_add_nested_element_form.html.erb +5 -5
- data/lib/alchemy/resource.rb +2 -2
- data/lib/alchemy/resources_helper.rb +3 -3
- data/lib/alchemy/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4e20dfb7c8a1477928f962a4494fb7f3856a84a718a90474d21604617cfa6999
|
4
|
+
data.tar.gz: d4f9e69df4d2ce7916a778e16102eb235c1d92b51a617df339ed33afb45e4cf0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8cbafabbd80e853cf661a7ec3b88777c21d4a445ccd6076683780cc0da0c7164b7747a9504ceebf44bd35207dc969d302d158680c6feffe78da34118c12351de
|
7
|
+
data.tar.gz: ebcdcd1bc921de896168dd5acc71f87f6f3a05c28fea381da3fad15e0245400c61956c1062b2a89444a333e458f5db196fdc97f6d252f0ef1f7152105de50e9a
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,10 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## 7.0.8 (2023-12-28)
|
4
|
+
|
5
|
+
- [7.0-stable] Merge pull request #2658 from tvdeyen/fix-contactform-mailer [#2660](https://github.com/AlchemyCMS/alchemy_cms/pull/2660) ([alchemycms-bot](https://github.com/alchemycms-bot))
|
6
|
+
- [7.0] Fix humanization for add nested element button [#2659](https://github.com/AlchemyCMS/alchemy_cms/pull/2659) ([tvdeyen](https://github.com/tvdeyen))
|
7
|
+
|
3
8
|
## 7.0.7 (2023-11-28)
|
4
9
|
|
5
10
|
- [7.0] Disable Turbolinks on menubar [#2622](https://github.com/AlchemyCMS/alchemy_cms/pull/2622) ([tvdeyen](https://github.com/tvdeyen))
|
@@ -34,16 +34,16 @@ module Alchemy
|
|
34
34
|
respond_to do |format|
|
35
35
|
format.html do
|
36
36
|
items = items.page(params[:page] || 1).per(items_per_page)
|
37
|
-
instance_variable_set("@#{resource_handler.resources_name}", items)
|
37
|
+
instance_variable_set(:"@#{resource_handler.resources_name}", items)
|
38
38
|
end
|
39
39
|
format.csv do
|
40
|
-
instance_variable_set("@#{resource_handler.resources_name}", items)
|
40
|
+
instance_variable_set(:"@#{resource_handler.resources_name}", items)
|
41
41
|
end
|
42
42
|
end
|
43
43
|
end
|
44
44
|
|
45
45
|
def new
|
46
|
-
instance_variable_set("@#{resource_handler.resource_name}", resource_handler.model.new)
|
46
|
+
instance_variable_set(:"@#{resource_handler.resource_name}", resource_handler.model.new)
|
47
47
|
end
|
48
48
|
|
49
49
|
def show
|
@@ -54,7 +54,7 @@ module Alchemy
|
|
54
54
|
end
|
55
55
|
|
56
56
|
def create
|
57
|
-
instance_variable_set("@#{resource_handler.resource_name}", resource_handler.model.new(resource_params))
|
57
|
+
instance_variable_set(:"@#{resource_handler.resource_name}", resource_handler.model.new(resource_params))
|
58
58
|
resource_instance_variable.save
|
59
59
|
render_errors_or_redirect(
|
60
60
|
resource_instance_variable,
|
@@ -169,7 +169,7 @@ module Alchemy
|
|
169
169
|
end
|
170
170
|
|
171
171
|
def load_resource
|
172
|
-
instance_variable_set("@#{resource_handler.resource_name}", resource_handler.model.find(params[:id]))
|
172
|
+
instance_variable_set(:"@#{resource_handler.resource_name}", resource_handler.model.find(params[:id]))
|
173
173
|
end
|
174
174
|
|
175
175
|
def authorize_resource
|
@@ -77,15 +77,15 @@ module Alchemy
|
|
77
77
|
end
|
78
78
|
|
79
79
|
def mail_to
|
80
|
-
@element.
|
80
|
+
@element.value_for(:mail_to) || mailer_config["mail_to"]
|
81
81
|
end
|
82
82
|
|
83
83
|
def mail_from
|
84
|
-
@element.
|
84
|
+
@element.value_for(:mail_from) || mailer_config["mail_from"]
|
85
85
|
end
|
86
86
|
|
87
87
|
def subject
|
88
|
-
@element.
|
88
|
+
@element.value_for(:subject) || mailer_config["subject"]
|
89
89
|
end
|
90
90
|
|
91
91
|
def redirect_to_success_page
|
@@ -104,7 +104,7 @@ module Alchemy
|
|
104
104
|
end
|
105
105
|
|
106
106
|
def success_page
|
107
|
-
@_success_page ||= @element.
|
107
|
+
@_success_page ||= @element.value_for(:success_page)
|
108
108
|
end
|
109
109
|
|
110
110
|
def success_page_urlname
|
@@ -158,8 +158,8 @@ module Alchemy
|
|
158
158
|
"#{name}.#{role}.#{error}",
|
159
159
|
scope: "ingredient_validations",
|
160
160
|
default: [
|
161
|
-
"fields.#{role}.#{error}"
|
162
|
-
"errors.#{error}"
|
161
|
+
:"fields.#{role}.#{error}",
|
162
|
+
:"errors.#{error}"
|
163
163
|
],
|
164
164
|
field: Alchemy::Ingredient.translated_label_for(role, name)
|
165
165
|
)
|
@@ -45,14 +45,14 @@ module Alchemy
|
|
45
45
|
# @param [String] The class name of the related object
|
46
46
|
def related_object_alias(name, class_name:)
|
47
47
|
alias_method name, :related_object
|
48
|
-
alias_method "#{name}=", :related_object=
|
48
|
+
alias_method :"#{name}=", :related_object=
|
49
49
|
|
50
50
|
# Somehow Rails STI does not allow us to use `alias_method` for the related_object_id
|
51
|
-
define_method "#{name}_id" do
|
51
|
+
define_method :"#{name}_id" do
|
52
52
|
related_object_id
|
53
53
|
end
|
54
54
|
|
55
|
-
define_method "#{name}_id=" do |id|
|
55
|
+
define_method :"#{name}_id=" do |id|
|
56
56
|
self.related_object_id = id
|
57
57
|
self.related_object_type = class_name
|
58
58
|
end
|
@@ -51,10 +51,10 @@ module Alchemy
|
|
51
51
|
validations.each do |validation|
|
52
52
|
if validation.respond_to?(:keys)
|
53
53
|
validation.map do |key, value|
|
54
|
-
send("validate_#{key}", value)
|
54
|
+
send(:"validate_#{key}", value)
|
55
55
|
end
|
56
56
|
else
|
57
|
-
send("validate_#{validation}")
|
57
|
+
send(:"validate_#{validation}")
|
58
58
|
end
|
59
59
|
end
|
60
60
|
end
|
data/app/models/alchemy/page.rb
CHANGED
@@ -168,7 +168,7 @@ module Alchemy
|
|
168
168
|
def fix_crop_values
|
169
169
|
%i[crop_from crop_size].each do |crop_value|
|
170
170
|
if public_send(crop_value).is_a?(String)
|
171
|
-
public_send("#{crop_value}=", normalize_crop_value(crop_value))
|
171
|
+
public_send(:"#{crop_value}=", normalize_crop_value(crop_value))
|
172
172
|
end
|
173
173
|
end
|
174
174
|
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
<%= content_tag :div, class: 'add-nested-element', data: { element_id: element.id } do %>
|
2
2
|
<% if element.expanded? || element.fixed? %>
|
3
|
-
<% if element.nestable_elements.length == 1 &&
|
4
|
-
(nestable_element = element.nestable_elements.first) &&
|
3
|
+
<% if element.nestable_elements.length == 1 &&
|
4
|
+
(nestable_element = element.nestable_elements.first) &&
|
5
5
|
Alchemy::Element.all_from_clipboard_for_parent_element(get_clipboard("elements"), element).none?
|
6
6
|
%>
|
7
7
|
<%= form_for [:admin, Alchemy::Element.new(name: nestable_element)],
|
@@ -10,11 +10,11 @@
|
|
10
10
|
<%= f.hidden_field :page_version_id, value: element.page_version_id %>
|
11
11
|
<%= f.hidden_field :parent_element_id, value: element.id %>
|
12
12
|
<button class="button add-nestable-element-button" data-alchemy-button>
|
13
|
-
<%= Alchemy.t(:add_nested_element, name: Alchemy.t(nestable_element, scope: 'element_names')) %>
|
13
|
+
<%= Alchemy.t(:add_nested_element, name: Alchemy.t(nestable_element.to_sym, scope: 'element_names')) %>
|
14
14
|
</button>
|
15
15
|
<% end %>
|
16
16
|
<% else %>
|
17
|
-
<%= link_to_dialog (nestable_element ? Alchemy.t(:add_nested_element, name: Alchemy.t(nestable_element, scope: 'element_names')) : Alchemy.t("New Element")),
|
17
|
+
<%= link_to_dialog (nestable_element ? Alchemy.t(:add_nested_element, name: Alchemy.t(nestable_element.to_sym, scope: 'element_names')) : Alchemy.t("New Element")),
|
18
18
|
alchemy.new_admin_element_path(
|
19
19
|
parent_element_id: element.id,
|
20
20
|
page_version_id: element.page_version_id
|
@@ -24,4 +24,4 @@
|
|
24
24
|
}, class: "button add-nestable-element-button" %>
|
25
25
|
<% end %>
|
26
26
|
<% end %>
|
27
|
-
<% end %>
|
27
|
+
<% end %>
|
data/lib/alchemy/resource.rb
CHANGED
@@ -108,7 +108,7 @@ module Alchemy
|
|
108
108
|
def initialize(controller_path, module_definition = nil, custom_model = nil)
|
109
109
|
@controller_path = controller_path
|
110
110
|
@module_definition = module_definition
|
111
|
-
@model =
|
111
|
+
@model = custom_model || guess_model_from_controller_path
|
112
112
|
if model.respond_to?(:alchemy_resource_relations)
|
113
113
|
if !model.respond_to?(:reflect_on_all_associations)
|
114
114
|
raise MissingActiveRecordAssociation
|
@@ -320,7 +320,7 @@ module Alchemy
|
|
320
320
|
model.alchemy_resource_relations.each do |name, options|
|
321
321
|
relation_name = name.to_s.gsub(/_id$/, "") # ensure that we don't have an id
|
322
322
|
association = association_from_relation_name(relation_name)
|
323
|
-
foreign_key = association.options[:foreign_key] || "#{association.name}_id"
|
323
|
+
foreign_key = association.options[:foreign_key] || :"#{association.name}_id"
|
324
324
|
collection = options[:collection] || resource_relation_class(association).all
|
325
325
|
resource_relations[foreign_key] = options.merge(
|
326
326
|
model_association: association,
|
@@ -14,11 +14,11 @@ module Alchemy
|
|
14
14
|
end
|
15
15
|
|
16
16
|
def resource_instance_variable
|
17
|
-
instance_variable_get("@#{resource_handler.resource_name}")
|
17
|
+
instance_variable_get(:"@#{resource_handler.resource_name}")
|
18
18
|
end
|
19
19
|
|
20
20
|
def resources_instance_variable
|
21
|
-
instance_variable_get("@#{resource_handler.resources_name}")
|
21
|
+
instance_variable_get(:"@#{resource_handler.resources_name}")
|
22
22
|
end
|
23
23
|
|
24
24
|
def resource_url_proxy
|
@@ -46,7 +46,7 @@ module Alchemy
|
|
46
46
|
end
|
47
47
|
|
48
48
|
def edit_resource_path(resource = nil, options = {})
|
49
|
-
path_segments =
|
49
|
+
path_segments = resource_scope + [resource] || resource_handler.resource_array
|
50
50
|
edit_polymorphic_path path_segments, options
|
51
51
|
end
|
52
52
|
|
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.0.
|
4
|
+
version: 7.0.8
|
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: 2023-
|
16
|
+
date: 2023-12-28 00:00:00.000000000 Z
|
17
17
|
dependencies:
|
18
18
|
- !ruby/object:Gem::Dependency
|
19
19
|
name: actionmailer
|
@@ -1449,7 +1449,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
1449
1449
|
version: '0'
|
1450
1450
|
requirements:
|
1451
1451
|
- ImageMagick (libmagick), v6.6 or greater.
|
1452
|
-
rubygems_version: 3.
|
1452
|
+
rubygems_version: 3.5.3
|
1453
1453
|
signing_key:
|
1454
1454
|
specification_version: 4
|
1455
1455
|
summary: A powerful, userfriendly and flexible CMS for Rails
|