alchemy_cms 8.1.6 → 8.1.7
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/components/alchemy/admin/element_select.rb +1 -1
- data/app/javascript/alchemy_admin/components/element_select.js +8 -6
- data/app/stylesheets/alchemy/admin/navigation.scss +1 -1
- data/app/views/alchemy/ingredients/shared/_picture_tools.html.erb +3 -2
- data/lib/alchemy/version.rb +1 -1
- metadata +1 -1
|
@@ -2,17 +2,19 @@ import { hightlightTerm } from "alchemy_admin/components/remote_select"
|
|
|
2
2
|
|
|
3
3
|
const formatSelection = (option) => {
|
|
4
4
|
return `
|
|
5
|
-
<div class="element-select-name"
|
|
5
|
+
<div class="element-select-name">
|
|
6
|
+
${option.icon}<span>${option.text}</span>
|
|
7
|
+
</div>
|
|
6
8
|
`
|
|
7
9
|
}
|
|
8
10
|
|
|
9
|
-
const formatItem = (icon,
|
|
11
|
+
const formatItem = (icon, text, hint) => {
|
|
10
12
|
const description = hint
|
|
11
13
|
? `<div class="element-select-description">${hint}</div>`
|
|
12
14
|
: ""
|
|
13
15
|
return `
|
|
14
16
|
<div class="element-select-item">
|
|
15
|
-
${formatSelection({ icon,
|
|
17
|
+
${formatSelection({ icon, text })}
|
|
16
18
|
${description}
|
|
17
19
|
</div>
|
|
18
20
|
`
|
|
@@ -34,11 +36,11 @@ class ElementSelect extends HTMLElement {
|
|
|
34
36
|
formatResult: (option, _el, search) => {
|
|
35
37
|
let text
|
|
36
38
|
|
|
37
|
-
if (option.id === "") return option.
|
|
39
|
+
if (option.id === "") return option.text
|
|
38
40
|
if (search.term !== "") {
|
|
39
|
-
text = hightlightTerm(option.
|
|
41
|
+
text = hightlightTerm(option.text, search.term)
|
|
40
42
|
} else {
|
|
41
|
-
text = option.
|
|
43
|
+
text = option.text
|
|
42
44
|
}
|
|
43
45
|
|
|
44
46
|
return formatItem(option.icon, text, option.hint)
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
<% linkable = picture_editor.settings[:linkable] != false %>
|
|
2
2
|
<% croppable = picture_editor.allow_image_cropping? %>
|
|
3
|
+
<% crop_configured = !!picture_editor.settings[:crop] %>
|
|
3
4
|
<% disabled = cannot?(:edit, picture_editor.ingredient) %>
|
|
4
5
|
|
|
5
6
|
<%= content_tag "sl-tooltip", content: Alchemy.t("Edit Picturemask"), placement: "top-start", disabled: !croppable || disabled do %>
|
|
6
7
|
<%= link_to_dialog render_icon(:crop),
|
|
7
|
-
(
|
|
8
|
+
(crop_configured && !disabled) ? alchemy.crop_admin_ingredient_path(picture_editor.ingredient, {
|
|
8
9
|
crop_from_form_field_id: picture_editor.form_field_id(:crop_from),
|
|
9
10
|
crop_size_form_field_id: picture_editor.form_field_id(:crop_size),
|
|
10
11
|
picture_id: picture_editor.picture&.id
|
|
@@ -14,7 +15,7 @@
|
|
|
14
15
|
image_loader: false,
|
|
15
16
|
padding: false
|
|
16
17
|
}, {
|
|
17
|
-
class: "crop_link icon_button"
|
|
18
|
+
class: ["crop_link icon_button", ("disabled" unless croppable)].compact.join(" ")
|
|
18
19
|
} %>
|
|
19
20
|
<% end %>
|
|
20
21
|
|
data/lib/alchemy/version.rb
CHANGED