alchemy_cms 7.1.3 → 7.1.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 63a8036fd5b9c389fabfe14c5df6536ed7855e0718bb8163a61140bbf83673fc
4
- data.tar.gz: 3921217db9ef5fcd38376239462db3d782de236cc360a15cf4539152346f70fd
3
+ metadata.gz: 96768643fc124e7d3faf032a61ec6b1cb2d737a5582f146990a63809f5f12814
4
+ data.tar.gz: 8bc4f8f2d7c4416562ee1259601919f48867b91b4479130d24975c900ecc561b
5
5
  SHA512:
6
- metadata.gz: 8f9198b7c07c9e961f39692f09e69b9534f9a5670e201590cc921588cc170a427091d12715f92626d1084dad5918d208e69872e3912bcb705b4784ee3724d34b
7
- data.tar.gz: 5574bfca4fa4472e32920d22fab485399492ac7c5b19922c18bb5826ef872375cc10069a7dc1d443af9b91dcc358856c26c13ae5c9383a7e843cabc0c978dd4b
6
+ metadata.gz: 2b79394f97b700fa5e59fa242c50d9b296b3de5abcd8e35d483a609fc7d44329ab0e5cdc9d350f8e2891fea81a2f5627fe1a2a08436d1fb3f56ef3e22d209f08
7
+ data.tar.gz: 5e018ef946f2185733751c6d2e4e62248ce2af578c2cefec7417932b1d8153522ec6f0c684451989291c6a1361a49193295e6c4ae1f3218fbe9c5398d76bb565
data/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # Changelog
2
2
 
3
+ ## 7.1.5 (2024-02-29)
4
+
5
+ - [7.1-stable] Fix taggable uniqueness in tags admin table [#2764](https://github.com/AlchemyCMS/alchemy_cms/pull/2764) ([alchemycms-bot](https://github.com/alchemycms-bot))
6
+ - [7.1-stable] Fix datepicker in resource forms [#2762](https://github.com/AlchemyCMS/alchemy_cms/pull/2762) ([alchemycms-bot](https://github.com/alchemycms-bot))
7
+
8
+ ## 7.1.4 (2024-02-27)
9
+
10
+ - [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))
11
+ - [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))
12
+ - [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))
13
+ - [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))
14
+ - [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))
15
+
3
16
  ## 7.1.3 (2024-02-19)
4
17
 
5
18
  - Update tinymce to version 6.8.3 [#2727](https://github.com/AlchemyCMS/alchemy_cms/pull/2727) ([depfu](https://github.com/apps/depfu))
@@ -74,7 +74,7 @@
74
74
  background: $thumbnail-background;
75
75
  }
76
76
 
77
- &[src$=".svg"]:not([src*="alchemy/missing-image"]) {
77
+ &[src*=".svg"]:not([src*="alchemy/missing-image"]) {
78
78
  width: var(--picture-width);
79
79
  max-height: var(--picture-height);
80
80
  }
@@ -1,6 +1,3 @@
1
1
  .label {
2
- @include label-base(
3
- $margin: $default-margin/2 0,
4
- $padding: $default-padding 2*$default-padding $default-padding
5
- );
2
+ @include label-base($margin: 0, $padding: 0 2 * $default-padding);
6
3
  }
@@ -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 = Alchemy::Language.current
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
- post(Alchemy.routes.order_admin_elements_path, params).then((response) => {
33
- const data = response.data
34
- Alchemy.growl(data.message)
35
- Alchemy.PreviewWindow.refresh()
36
- item.updateTitle(data.preview_text)
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
- repository.not_nested.each.with_index(1) do |element, position|
51
+ elements.each.with_index(1) do |element, position|
43
52
  Alchemy::DuplicateElement.new(element, repository: repository).call(
44
- page_version_id: target.draft_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
- <% if @element.fixed? %>
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
- <%= tag.taggings.collect(&:taggable).collect { |t| t.class.model_name.human }.uniq.join(', ') %>
5
+ <% tag.taggings.collect(&:taggable).compact.uniq(&:class).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
- # Try to find and stores current language for Alchemy.
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
- # find the best language and remember it for later
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's id in the session.
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
@@ -40,7 +40,7 @@ module Alchemy
40
40
  }.merge(options[:input_html] || {})
41
41
 
42
42
  date_field = input attribute_name, as: :string, input_html: input_options
43
- template.content_tag("alchemy-datepicker", date_field, type: type)
43
+ template.content_tag("alchemy-datepicker", date_field, "input-type" => type)
44
44
  end
45
45
 
46
46
  # Renders a simple_form input that displays a richtext editor
@@ -107,12 +107,7 @@ module Alchemy
107
107
  when "boolean"
108
108
  options
109
109
  when "date", "time", "datetime"
110
- options.merge(
111
- as: "string",
112
- input_html: {
113
- data: {datepicker_type: input_type}
114
- }
115
- )
110
+ options.merge(as: input_type)
116
111
  when "text"
117
112
  options.merge(as: "text", input_html: {rows: 4})
118
113
  else
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Alchemy
4
- VERSION = "7.1.3"
4
+ VERSION = "7.1.5"
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: 7.1.3
4
+ version: 7.1.5
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-19 00:00:00.000000000 Z
16
+ date: 2024-02-29 00:00:00.000000000 Z
17
17
  dependencies:
18
18
  - !ruby/object:Gem::Dependency
19
19
  name: actionmailer