alchemy_cms 8.1.8 → 8.1.10

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.
@@ -161,7 +161,7 @@ module Alchemy
161
161
  end
162
162
 
163
163
  def form_field_counter
164
- element.definition.ingredients.index { |i| i.role == role }
164
+ ingredient.id
165
165
  end
166
166
 
167
167
  # Renders the translated role of ingredient.
@@ -30,6 +30,9 @@ module Alchemy
30
30
 
31
31
  def destroy
32
32
  if @language.destroy
33
+ if session[:alchemy_language_id] == @language.id
34
+ session.delete(:alchemy_language_id)
35
+ end
33
36
  flash[:notice] = Alchemy.t("Language successfully removed")
34
37
  else
35
38
  flash[:warning] = @language.errors.full_messages.to_sentence
@@ -164,7 +164,7 @@ module Alchemy
164
164
  private
165
165
 
166
166
  def form_field_counter
167
- element.ingredient_definitions.index { _1.role == role }
167
+ id
168
168
  end
169
169
  end
170
170
  end
@@ -44,7 +44,6 @@ export default class PictureThumbnail extends HTMLElement {
44
44
  if (alt) {
45
45
  this.image.alt = alt
46
46
  }
47
- this.image.loading = "lazy"
48
47
  }
49
48
 
50
49
  start(src) {
@@ -13,6 +13,7 @@ module Alchemy::Language::Code
13
13
 
14
14
  module ClassMethods
15
15
  def find_by_code(code)
16
+ return unless code.respond_to?(:split)
16
17
  codes = code.split("-")
17
18
  codes << "" if codes.length == 1
18
19
  on_current_site.find_by(
@@ -40,7 +40,7 @@ module Alchemy
40
40
  connection.request(request)
41
41
  end
42
42
 
43
- def uri = "https://www.alchemy-cms.com/update-check"
43
+ def uri = "https://app.alchemy-cms.com/update-check"
44
44
 
45
45
  def content_type = Marcel::EXTENSIONS["json"]
46
46
 
@@ -75,8 +75,8 @@ alchemy-uploader {
75
75
  }
76
76
 
77
77
  img {
78
- max-width: 100%;
79
- max-height: 100%;
78
+ max-width: var(--picture-width);
79
+ max-height: var(--picture-height);
80
80
 
81
81
  &:not([src*="alchemy/missing-image"]) {
82
82
  background: var(--thumbnail-background);
@@ -1,11 +1,11 @@
1
1
  alchemy-picture-thumbnail {
2
2
  &[loading] {
3
- img {
3
+ > img {
4
4
  opacity: 0;
5
5
  }
6
6
  }
7
7
 
8
- img {
8
+ > img {
9
9
  opacity: 1;
10
10
  transition: opacity var(--transition-duration);
11
11
  }
@@ -22,7 +22,7 @@
22
22
  search_filter_params.merge(
23
23
  size: "small",
24
24
  form_field_id: @form_field_id
25
- )
25
+ ).to_h
26
26
  ),
27
27
  class: "icon_button"
28
28
  ) %>
@@ -34,7 +34,7 @@
34
34
  search_filter_params.merge(
35
35
  size: "medium",
36
36
  form_field_id: @form_field_id
37
- )
37
+ ).to_h
38
38
  ),
39
39
  class: "icon_button"
40
40
  ) %>
@@ -46,7 +46,7 @@
46
46
  search_filter_params.merge(
47
47
  size: "large",
48
48
  form_field_id: @form_field_id
49
- )
49
+ ).to_h
50
50
  ),
51
51
  class: "icon_button"
52
52
  ) %>
@@ -10,7 +10,7 @@
10
10
  onclick: '$(self).attr("href", "#").off("click"); return false',
11
11
  method: 'put',
12
12
  ) do %>
13
- <%= render Alchemy::Admin::PictureThumbnail.new(picture_to_assign) %>
13
+ <%= render Alchemy::Admin::PictureThumbnail.new(picture_to_assign, size: size) %>
14
14
  <% end %>
15
15
  </sl-tooltip>
16
16
  <% else %>
@@ -68,6 +68,8 @@ module Alchemy
68
68
  ).to_h
69
69
  end
70
70
 
71
+ delegate :to_json, to: :to_h
72
+
71
73
  class << self
72
74
  def defined_configurations = []
73
75
 
@@ -80,7 +80,8 @@ module Alchemy
80
80
 
81
81
  def load_alchemy_language_from_id_or_code(id_or_code)
82
82
  Language.find_by(id: id_or_code) ||
83
- Language.find_by_code(id_or_code)
83
+ Language.find_by_code(id_or_code) ||
84
+ Language.default
84
85
  end
85
86
 
86
87
  # Stores language in +Current.language+
@@ -63,13 +63,12 @@ module Alchemy
63
63
 
64
64
  def remove_duplicate_legacy_urls
65
65
  puts "\n## Removing duplicate legacy URLs"
66
- sql = <<~SQL
67
- DELETE FROM alchemy_legacy_page_urls A USING alchemy_legacy_page_urls B
68
- WHERE A.page_id = B.page_id
69
- AND A.urlname = B.urlname
70
- AND A.id < B.id
71
- SQL
72
- count = ActiveRecord::Base.connection.exec_delete(sql)
66
+ keep_ids = Alchemy::LegacyPageUrl
67
+ .select("MAX(id)")
68
+ .group(:page_id, :urlname)
69
+ count = Alchemy::LegacyPageUrl
70
+ .where.not(id: keep_ids)
71
+ .delete_all
73
72
  log "Deleted #{count} duplicate legacy URLs"
74
73
  end
75
74
 
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Alchemy
4
- VERSION = "8.1.8"
4
+ VERSION = "8.1.10"
5
5
 
6
6
  def self.version
7
7
  VERSION
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: 8.1.8
4
+ version: 8.1.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thomas von Deyen
@@ -646,6 +646,8 @@ files:
646
646
  - app/assets/builds/alchemy/admin.css
647
647
  - app/assets/builds/alchemy/admin/page-select.css
648
648
  - app/assets/builds/alchemy/admin/print.css
649
+ - app/assets/builds/alchemy/alchemy_admin.min.js
650
+ - app/assets/builds/alchemy/alchemy_admin.min.js.map
649
651
  - app/assets/builds/alchemy/dark-theme.css
650
652
  - app/assets/builds/alchemy/light-theme.css
651
653
  - app/assets/builds/alchemy/preview.min.js