alchemy_cms 7.0.3 → 7.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.standard.yml +1 -0
- data/CHANGELOG.md +6 -0
- data/app/models/alchemy/node.rb +1 -1
- data/app/models/concerns/alchemy/picture_thumbnails.rb +4 -0
- data/app/views/alchemy/admin/leave.html.erb +10 -8
- data/app/views/layouts/alchemy/admin.html.erb +7 -0
- data/lib/alchemy/test_support/having_picture_thumbnails_examples.rb +20 -0
- data/lib/alchemy/version.rb +1 -1
- data/lib/alchemy.rb +19 -0
- 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: 93dd8ab84830c6ec88582d2feda99f8bb943914a8a7d3207d8c1af62d2372827
|
4
|
+
data.tar.gz: 026a78195b0d4293ab3d60bcc1fedea70fe5db864a3a48fbf2245d8cb3f31b0d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6474da80a9a5a7b655c97f3c20f5bc22b2b60ab61caff5b77f7cd75b11292bc761371ea01eb79e5a3c9c9c22cbc732fbb70bd8f406fc38e3b58fa753e3923ed6
|
7
|
+
data.tar.gz: 71fedd3b8f934fce52224bb6e89f74d9e2a587066ce819bf0b90a078bc5bf7b7c1eb956dfb5de909a79b67bd1c05f4d55ad69019a715438f8951902813efe5c4
|
data/.standard.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,11 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## 7.0.4 (2023-10-04)
|
4
|
+
|
5
|
+
- [7.0-stable] Merge pull request #2588 from tvdeyen/admin-js-imports [#2589](https://github.com/AlchemyCMS/alchemy_cms/pull/2589) ([alchemycms-bot](https://github.com/alchemycms-bot))
|
6
|
+
- [7.0-stable] Merge pull request #2586 from AlchemyCMS/fix-leave-dialog [#2587](https://github.com/AlchemyCMS/alchemy_cms/pull/2587) ([alchemycms-bot](https://github.com/alchemycms-bot))
|
7
|
+
- [7.0-stable] Merge pull request #2556 from mamhoff/fix-nan-ratio-error [#2580](https://github.com/AlchemyCMS/alchemy_cms/pull/2580) ([alchemycms-bot](https://github.com/alchemycms-bot))
|
8
|
+
|
3
9
|
## 7.0.3 (2023-08-29)
|
4
10
|
|
5
11
|
- [7.0-stable] Merge pull request #2571 from tvdeyen/fix-non-stupid-digest-assets [#2572](https://github.com/AlchemyCMS/alchemy_cms/pull/2572) ([github-actions](https://github.com/apps/github-actions))
|
data/app/models/alchemy/node.rb
CHANGED
@@ -52,7 +52,7 @@ module Alchemy
|
|
52
52
|
#
|
53
53
|
def read_definitions_file
|
54
54
|
if ::File.exist?(definitions_file_path)
|
55
|
-
::YAML.
|
55
|
+
::YAML.safe_load_file(definitions_file_path) || []
|
56
56
|
else
|
57
57
|
raise LoadError, "Could not find menus.yml file! Please run `rails generate alchemy:install`"
|
58
58
|
end
|
@@ -115,6 +115,8 @@ module Alchemy
|
|
115
115
|
return nil unless settings[:crop] && settings[:size]
|
116
116
|
|
117
117
|
mask = inferred_dimensions_from_string(settings[:size])
|
118
|
+
return if mask.nil?
|
119
|
+
|
118
120
|
zoom = thumbnail_zoom_factor(mask)
|
119
121
|
return nil if zoom.zero?
|
120
122
|
|
@@ -150,6 +152,8 @@ module Alchemy
|
|
150
152
|
width, height = dimensions_from_string(string)
|
151
153
|
ratio = image_file_width.to_f / image_file_height.to_i
|
152
154
|
|
155
|
+
return if ratio.nan?
|
156
|
+
|
153
157
|
if width.zero? && ratio.is_a?(Float)
|
154
158
|
width = height * ratio
|
155
159
|
end
|
@@ -1,11 +1,13 @@
|
|
1
1
|
<%= render_message do %>
|
2
2
|
<%= Alchemy.t("You are about to leave Alchemy") %>
|
3
3
|
<% end %>
|
4
|
-
<
|
5
|
-
<
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
4
|
+
<div data-turbo="false">
|
5
|
+
<p class="buttons">
|
6
|
+
<label><%= Alchemy.t("Do you want to") %></label>
|
7
|
+
<%= link_to Alchemy.t('stay logged in'), alchemy.root_path, class: 'button secondary' %>
|
8
|
+
</p>
|
9
|
+
<%= form_tag Alchemy.logout_path, method: Alchemy.logout_method, class: 'buttons' do %>
|
10
|
+
<label><%= Alchemy.t('or to completely') %></label>
|
11
|
+
<%= button_tag Alchemy.t(:logout), autofocus: true %>
|
12
|
+
<% end %>
|
13
|
+
</div>
|
@@ -35,6 +35,13 @@
|
|
35
35
|
<%= render 'alchemy/admin/partials/routes' %>
|
36
36
|
<%= javascript_include_tag('alchemy/admin/all', 'data-turbo-track' => true) %>
|
37
37
|
<%= javascript_importmap_tags("alchemy_admin", importmap: Alchemy.importmap) %>
|
38
|
+
<% if Alchemy.admin_js_imports.any? %>
|
39
|
+
<script type="module">
|
40
|
+
<% Alchemy.admin_js_imports.each do |path| %>
|
41
|
+
import "<%= path %>"
|
42
|
+
<% end %>
|
43
|
+
</script>
|
44
|
+
<% end %>
|
38
45
|
<%= yield :javascript_includes %>
|
39
46
|
</head>
|
40
47
|
<%= content_tag :body, id: 'alchemy', class: alchemy_body_class do %>
|
@@ -385,6 +385,26 @@ RSpec.shared_examples_for "having picture thumbnails" do
|
|
385
385
|
size: "160x120"
|
386
386
|
)
|
387
387
|
end
|
388
|
+
|
389
|
+
context "with settings indicating free height" do
|
390
|
+
let(:settings) do
|
391
|
+
{
|
392
|
+
crop: true,
|
393
|
+
size: "800x"
|
394
|
+
}
|
395
|
+
end
|
396
|
+
|
397
|
+
it "returns default thumbnail options" do
|
398
|
+
is_expected.to eq(
|
399
|
+
crop: true,
|
400
|
+
crop_from: nil,
|
401
|
+
crop_size: nil,
|
402
|
+
flatten: true,
|
403
|
+
format: "jpg",
|
404
|
+
size: "160x120"
|
405
|
+
)
|
406
|
+
end
|
407
|
+
end
|
388
408
|
end
|
389
409
|
end
|
390
410
|
|
data/lib/alchemy/version.rb
CHANGED
data/lib/alchemy.rb
CHANGED
@@ -43,6 +43,25 @@ module Alchemy
|
|
43
43
|
@_preview_sources = Array(sources)
|
44
44
|
end
|
45
45
|
|
46
|
+
# Additional JS modules to be imported in the Alchemy admin UI
|
47
|
+
#
|
48
|
+
# Be sure to also pin the modules with +Alchemy.importmap+.
|
49
|
+
#
|
50
|
+
# == Example
|
51
|
+
#
|
52
|
+
# Alchemy.importmap.pin "flatpickr/de",
|
53
|
+
# to: "https://ga.jspm.io/npm:flatpickr@4.6.13/dist/l10n/de.js"
|
54
|
+
#
|
55
|
+
# Alchemy.admin_js_imports << "flatpickr/de"
|
56
|
+
#
|
57
|
+
def self.admin_js_imports
|
58
|
+
@_admin_js_imports ||= Set.new
|
59
|
+
end
|
60
|
+
|
61
|
+
def self.admin_js_imports=(sources)
|
62
|
+
@_admin_js_imports = Set[sources]
|
63
|
+
end
|
64
|
+
|
46
65
|
# Define page publish targets
|
47
66
|
#
|
48
67
|
# A publish target is a ActiveJob that gets performed
|
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.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: 2023-
|
16
|
+
date: 2023-10-04 00:00:00.000000000 Z
|
17
17
|
dependencies:
|
18
18
|
- !ruby/object:Gem::Dependency
|
19
19
|
name: actionmailer
|