alchemy_cms 7.0.2 → 7.0.4

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c4828c1eaebd1d74c37372855818011e7e07a284accefd1b597314ec5d811841
4
- data.tar.gz: 9722020245707a9399fd18fe1385c7ad2afdc224d4819a713392dd173709e4fe
3
+ metadata.gz: 93dd8ab84830c6ec88582d2feda99f8bb943914a8a7d3207d8c1af62d2372827
4
+ data.tar.gz: 026a78195b0d4293ab3d60bcc1fedea70fe5db864a3a48fbf2245d8cb3f31b0d
5
5
  SHA512:
6
- metadata.gz: ffc68ea09c5f5a4c1a377a7c2c726c353f8e94d6c863e635c18f86893b4b37ef90aba8da716977fb1ffb0f6e8ca52aebed5d23568cfb4bc16efce9ba148beaed
7
- data.tar.gz: 2c63d6722d652e8cfe5f243d840ee1df85f024f780981c6d38dbbb960d39ccd04d1426aefc65602868bbf2b71563e4407136f675f4067728f43f1b029f8c84c1
6
+ metadata.gz: 6474da80a9a5a7b655c97f3c20f5bc22b2b60ab61caff5b77f7cd75b11292bc761371ea01eb79e5a3c9c9c22cbc732fbb70bd8f406fc38e3b58fa753e3923ed6
7
+ data.tar.gz: 71fedd3b8f934fce52224bb6e89f74d9e2a587066ce819bf0b90a078bc5bf7b7c1eb956dfb5de909a79b67bd1c05f4d55ad69019a715438f8951902813efe5c4
data/.standard.yml CHANGED
@@ -1,3 +1,4 @@
1
1
  parallel: true
2
2
  ignore:
3
3
  - "spec/dummy/**/*"
4
+ ruby_version: 3.0
data/CHANGELOG.md CHANGED
@@ -1,5 +1,16 @@
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
+
9
+ ## 7.0.3 (2023-08-29)
10
+
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))
12
+ - Increase minimum Rails version to v6.1 [#2541](https://github.com/AlchemyCMS/alchemy_cms/pull/2541) ([sascha-karnatz](https://github.com/sascha-karnatz))
13
+
3
14
  ## 7.0.2 (2023-07-31)
4
15
 
5
16
  - [7.0] Fix DOM ids and labels of ingredient editors [#2538](https://github.com/AlchemyCMS/alchemy_cms/pull/2538) ([tvdeyen](https://github.com/tvdeyen))
data/alchemy_cms.gemspec CHANGED
@@ -29,7 +29,7 @@ Gem::Specification.new do |gem|
29
29
  activesupport
30
30
  railties
31
31
  ].each do |rails_gem|
32
- gem.add_runtime_dependency rails_gem, [">= 6.0", "< 7.1"]
32
+ gem.add_runtime_dependency rails_gem, [">= 6.1", "< 7.1"]
33
33
  end
34
34
 
35
35
  gem.add_runtime_dependency "active_model_serializers", ["~> 0.10.0"]
@@ -52,7 +52,7 @@ module Alchemy
52
52
  #
53
53
  def read_definitions_file
54
54
  if ::File.exist?(definitions_file_path)
55
- ::YAML.safe_load(File.read(definitions_file_path)) || []
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
- <p class="buttons">
5
- <label><%= Alchemy.t("Do you want to") %></label>
6
- <%= link_to Alchemy.t('stay logged in'), alchemy.root_path, class: 'button secondary' %>
7
- </p>
8
- <%= form_tag Alchemy.logout_path, method: Alchemy.logout_method, class: 'buttons' do %>
9
- <label><%= Alchemy.t('or to completely') %></label>
10
- <%= button_tag Alchemy.t(:logout), autofocus: true %>
11
- <% end %>
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
 
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Alchemy
4
- VERSION = "7.0.2"
4
+ VERSION = "7.0.4"
5
5
 
6
6
  def self.version
7
7
  VERSION
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
@@ -19,7 +19,7 @@ module NonStupidDigestAssets
19
19
  def whitelisted_assets(assets)
20
20
  assets.select do |logical_path, _digest_path|
21
21
  whitelist.any? do |item|
22
- item =~ logical_path
22
+ /#{item}/ =~ logical_path
23
23
  end
24
24
  end
25
25
  end
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.2
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-07-31 00:00:00.000000000 Z
16
+ date: 2023-10-04 00:00:00.000000000 Z
17
17
  dependencies:
18
18
  - !ruby/object:Gem::Dependency
19
19
  name: actionmailer
@@ -21,7 +21,7 @@ dependencies:
21
21
  requirements:
22
22
  - - ">="
23
23
  - !ruby/object:Gem::Version
24
- version: '6.0'
24
+ version: '6.1'
25
25
  - - "<"
26
26
  - !ruby/object:Gem::Version
27
27
  version: '7.1'
@@ -31,7 +31,7 @@ dependencies:
31
31
  requirements:
32
32
  - - ">="
33
33
  - !ruby/object:Gem::Version
34
- version: '6.0'
34
+ version: '6.1'
35
35
  - - "<"
36
36
  - !ruby/object:Gem::Version
37
37
  version: '7.1'
@@ -41,7 +41,7 @@ dependencies:
41
41
  requirements:
42
42
  - - ">="
43
43
  - !ruby/object:Gem::Version
44
- version: '6.0'
44
+ version: '6.1'
45
45
  - - "<"
46
46
  - !ruby/object:Gem::Version
47
47
  version: '7.1'
@@ -51,7 +51,7 @@ dependencies:
51
51
  requirements:
52
52
  - - ">="
53
53
  - !ruby/object:Gem::Version
54
- version: '6.0'
54
+ version: '6.1'
55
55
  - - "<"
56
56
  - !ruby/object:Gem::Version
57
57
  version: '7.1'
@@ -61,7 +61,7 @@ dependencies:
61
61
  requirements:
62
62
  - - ">="
63
63
  - !ruby/object:Gem::Version
64
- version: '6.0'
64
+ version: '6.1'
65
65
  - - "<"
66
66
  - !ruby/object:Gem::Version
67
67
  version: '7.1'
@@ -71,7 +71,7 @@ dependencies:
71
71
  requirements:
72
72
  - - ">="
73
73
  - !ruby/object:Gem::Version
74
- version: '6.0'
74
+ version: '6.1'
75
75
  - - "<"
76
76
  - !ruby/object:Gem::Version
77
77
  version: '7.1'
@@ -81,7 +81,7 @@ dependencies:
81
81
  requirements:
82
82
  - - ">="
83
83
  - !ruby/object:Gem::Version
84
- version: '6.0'
84
+ version: '6.1'
85
85
  - - "<"
86
86
  - !ruby/object:Gem::Version
87
87
  version: '7.1'
@@ -91,7 +91,7 @@ dependencies:
91
91
  requirements:
92
92
  - - ">="
93
93
  - !ruby/object:Gem::Version
94
- version: '6.0'
94
+ version: '6.1'
95
95
  - - "<"
96
96
  - !ruby/object:Gem::Version
97
97
  version: '7.1'
@@ -101,7 +101,7 @@ dependencies:
101
101
  requirements:
102
102
  - - ">="
103
103
  - !ruby/object:Gem::Version
104
- version: '6.0'
104
+ version: '6.1'
105
105
  - - "<"
106
106
  - !ruby/object:Gem::Version
107
107
  version: '7.1'
@@ -111,7 +111,7 @@ dependencies:
111
111
  requirements:
112
112
  - - ">="
113
113
  - !ruby/object:Gem::Version
114
- version: '6.0'
114
+ version: '6.1'
115
115
  - - "<"
116
116
  - !ruby/object:Gem::Version
117
117
  version: '7.1'
@@ -121,7 +121,7 @@ dependencies:
121
121
  requirements:
122
122
  - - ">="
123
123
  - !ruby/object:Gem::Version
124
- version: '6.0'
124
+ version: '6.1'
125
125
  - - "<"
126
126
  - !ruby/object:Gem::Version
127
127
  version: '7.1'
@@ -131,7 +131,7 @@ dependencies:
131
131
  requirements:
132
132
  - - ">="
133
133
  - !ruby/object:Gem::Version
134
- version: '6.0'
134
+ version: '6.1'
135
135
  - - "<"
136
136
  - !ruby/object:Gem::Version
137
137
  version: '7.1'
@@ -141,7 +141,7 @@ dependencies:
141
141
  requirements:
142
142
  - - ">="
143
143
  - !ruby/object:Gem::Version
144
- version: '6.0'
144
+ version: '6.1'
145
145
  - - "<"
146
146
  - !ruby/object:Gem::Version
147
147
  version: '7.1'
@@ -151,7 +151,7 @@ dependencies:
151
151
  requirements:
152
152
  - - ">="
153
153
  - !ruby/object:Gem::Version
154
- version: '6.0'
154
+ version: '6.1'
155
155
  - - "<"
156
156
  - !ruby/object:Gem::Version
157
157
  version: '7.1'
@@ -161,7 +161,7 @@ dependencies:
161
161
  requirements:
162
162
  - - ">="
163
163
  - !ruby/object:Gem::Version
164
- version: '6.0'
164
+ version: '6.1'
165
165
  - - "<"
166
166
  - !ruby/object:Gem::Version
167
167
  version: '7.1'
@@ -171,7 +171,7 @@ dependencies:
171
171
  requirements:
172
172
  - - ">="
173
173
  - !ruby/object:Gem::Version
174
- version: '6.0'
174
+ version: '6.1'
175
175
  - - "<"
176
176
  - !ruby/object:Gem::Version
177
177
  version: '7.1'