alchemy_cms 8.2.0 → 8.2.2
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 +4 -4
- data/app/assets/builds/alchemy/admin.css +1 -1
- data/app/assets/builds/alchemy/alchemy_admin.min.js +1 -1
- data/app/assets/builds/alchemy/alchemy_admin.min.js.map +1 -1
- data/app/components/alchemy/admin/locale_select.rb +17 -10
- data/app/javascript/alchemy_admin/components/picture_thumbnail.js +0 -1
- data/app/stylesheets/alchemy/admin/archive.scss +2 -2
- data/app/stylesheets/alchemy/admin/images.scss +2 -2
- data/app/stylesheets/alchemy/admin/notices.scss +1 -4
- data/app/views/alchemy/admin/pictures/_filter_and_size_bar.html.erb +3 -3
- data/app/views/alchemy/admin/pictures/_picture_to_assign.html.erb +1 -1
- data/lib/alchemy/version.rb +1 -1
- metadata +1 -1
|
@@ -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
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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
|
|
@@ -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 %>
|
data/lib/alchemy/version.rb
CHANGED