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.
@@ -30,7 +30,7 @@ module Alchemy
30
30
 
31
31
  elements.sort_by(&:name).map do |element|
32
32
  {
33
- name: Element.display_name_for(element.name),
33
+ text: Element.display_name_for(element.name),
34
34
  hint: element.hint,
35
35
  icon: element.icon_file,
36
36
  id: element.name
@@ -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">${option.icon} ${option.name}</div>
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, name, hint) => {
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, name })}
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.name
39
+ if (option.id === "") return option.text
38
40
  if (search.term !== "") {
39
- text = hightlightTerm(option.name, search.term)
41
+ text = hightlightTerm(option.text, search.term)
40
42
  } else {
41
- text = option.name
43
+ text = option.text
42
44
  }
43
45
 
44
46
  return formatItem(option.icon, text, option.hint)
@@ -8,7 +8,7 @@
8
8
  margin-left: var(--main-menu-width);
9
9
  padding-right: var(--main-menu-width);
10
10
  z-index: 20;
11
- width: 100vw;
11
+ width: 100%;
12
12
  height: var(--top-menu-height);
13
13
  @extend .disable-user-select;
14
14
  }
@@ -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
- (croppable && !disabled) ? alchemy.crop_admin_ingredient_path(picture_editor.ingredient, {
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
 
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Alchemy
4
- VERSION = "8.1.6"
4
+ VERSION = "8.1.7"
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.6
4
+ version: 8.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thomas von Deyen