alchemy_cms 8.2.0 → 8.2.1

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.
@@ -2,22 +2,19 @@ module Alchemy
2
2
  module Admin
3
3
  # Renders a locale select tag for switching the backend locale.
4
4
  class LocaleSelect < ViewComponent::Base
5
- attr_reader :name
5
+ attr_reader :name, :auto_submit
6
6
 
7
- def initialize(name = :admin_locale)
7
+ def initialize(name = :admin_locale, auto_submit: true)
8
8
  @name = name
9
+ @auto_submit = auto_submit
9
10
  end
10
11
 
11
12
  def call
12
13
  form_tag(helpers.url_for, method: :get) do
13
- content_tag("alchemy-auto-submit") do
14
- select_tag(
15
- name,
16
- options_for_select(
17
- translations_for_select,
18
- ::I18n.locale
19
- )
20
- )
14
+ if auto_submit
15
+ content_tag("alchemy-auto-submit", locale_select)
16
+ else
17
+ locale_select
21
18
  end
22
19
  end
23
20
  end
@@ -28,6 +25,16 @@ module Alchemy
28
25
 
29
26
  private
30
27
 
28
+ def locale_select
29
+ select_tag(
30
+ name,
31
+ options_for_select(
32
+ translations_for_select,
33
+ ::I18n.locale
34
+ )
35
+ )
36
+ end
37
+
31
38
  def available_locales
32
39
  @_available_locales ||= Alchemy::I18n.available_locales.sort!
33
40
  end
@@ -63,14 +63,11 @@ alchemy-message {
63
63
  }
64
64
  }
65
65
 
66
- h1 {
67
- font-size: var(--font-size_medium);
68
- }
69
-
70
66
  h1,
71
67
  h2,
72
68
  h3 {
73
69
  margin-top: 0;
70
+ font-size: var(--font-size_medium);
74
71
  }
75
72
 
76
73
  a[href] {
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Alchemy
4
- VERSION = "8.2.0"
4
+ VERSION = "8.2.1"
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.2.0
4
+ version: 8.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thomas von Deyen