alchemy_cms 8.0.0.a → 8.0.0.c

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.
Files changed (216) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +3 -0
  3. data/app/assets/builds/alchemy/admin/page-select.css +1 -1
  4. data/app/assets/builds/alchemy/admin.css +1 -1
  5. data/app/assets/builds/alchemy/dark-theme.css +1 -0
  6. data/app/assets/builds/alchemy/light-theme.css +1 -0
  7. data/app/assets/builds/alchemy/theme.css +1 -0
  8. data/app/assets/builds/alchemy/welcome.css +1 -1
  9. data/app/assets/builds/tinymce/skins/content/alchemy/content.min.css +1 -1
  10. data/app/assets/builds/tinymce/skins/content/alchemy-dark/content.min.css +1 -0
  11. data/app/assets/builds/tinymce/skins/ui/alchemy/skin.min.css +1 -1
  12. data/app/assets/builds/tinymce/skins/ui/alchemy-dark/content.min.css +1 -0
  13. data/app/assets/builds/tinymce/skins/ui/alchemy-dark/skin.min.css +1 -0
  14. data/app/assets/images/alchemy/element_icons/layout-bottom-2-line.svg +1 -0
  15. data/app/assets/images/alchemy/icons-sprite.svg +1 -1
  16. data/app/components/alchemy/admin/element_select.rb +39 -0
  17. data/app/components/alchemy/admin/link_dialog/tabs.rb +1 -1
  18. data/app/components/alchemy/admin/locale_select.rb +38 -0
  19. data/app/components/alchemy/ingredients/datetime_view.rb +4 -2
  20. data/app/controllers/alchemy/admin/attachments_controller.rb +2 -0
  21. data/app/controllers/alchemy/admin/elements_controller.rb +2 -0
  22. data/app/controllers/alchemy/admin/pages_controller.rb +3 -1
  23. data/app/controllers/alchemy/admin/pictures_controller.rb +26 -34
  24. data/app/controllers/alchemy/admin/resources_controller.rb +1 -1
  25. data/app/controllers/alchemy/pages_controller.rb +19 -2
  26. data/app/controllers/concerns/alchemy/admin/resource_filter.rb +1 -0
  27. data/app/decorators/alchemy/ingredient_editor.rb +9 -1
  28. data/app/helpers/alchemy/admin/attachments_helper.rb +5 -5
  29. data/app/helpers/alchemy/admin/base_helper.rb +0 -7
  30. data/app/helpers/alchemy/admin/form_helper.rb +2 -1
  31. data/app/helpers/alchemy/pages_helper.rb +1 -1
  32. data/app/javascript/alchemy_admin/components/auto_submit.js +20 -0
  33. data/app/javascript/alchemy_admin/components/datepicker.js +8 -5
  34. data/app/javascript/alchemy_admin/components/element_editor/delete_element_button.js +3 -2
  35. data/app/javascript/alchemy_admin/components/element_editor.js +25 -15
  36. data/app/javascript/alchemy_admin/components/element_select.js +43 -0
  37. data/app/javascript/alchemy_admin/components/index.js +5 -0
  38. data/app/javascript/alchemy_admin/components/link_buttons.js +6 -2
  39. data/app/javascript/alchemy_admin/components/remote_select.js +5 -1
  40. data/app/javascript/alchemy_admin/components/tinymce.js +93 -16
  41. data/app/javascript/alchemy_admin/dialog.js +1 -1
  42. data/app/javascript/alchemy_admin/file_editors.js +1 -1
  43. data/app/javascript/alchemy_admin/image_loader.js +4 -2
  44. data/app/javascript/alchemy_admin/picture_editors.js +7 -4
  45. data/app/javascript/alchemy_admin/picture_selector.js +4 -4
  46. data/app/jobs/alchemy/delete_picture_job.rb +12 -0
  47. data/app/models/alchemy/attachment.rb +2 -9
  48. data/app/models/alchemy/element.rb +1 -0
  49. data/app/models/alchemy/element_definition.rb +31 -0
  50. data/app/models/alchemy/ingredient.rb +1 -1
  51. data/app/models/alchemy/ingredients/boolean.rb +2 -1
  52. data/app/models/alchemy/language.rb +2 -7
  53. data/app/models/alchemy/page/page_naming.rb +4 -11
  54. data/app/models/alchemy/page/page_natures.rb +16 -11
  55. data/app/models/alchemy/page/publisher.rb +1 -1
  56. data/app/models/alchemy/page.rb +1 -6
  57. data/app/models/alchemy/page_definition.rb +1 -1
  58. data/app/models/alchemy/picture.rb +6 -17
  59. data/app/models/alchemy/resource.rb +15 -2
  60. data/app/models/alchemy/site/layout.rb +1 -0
  61. data/app/models/alchemy/site.rb +1 -6
  62. data/app/models/alchemy/storage_adapter/dragonfly/picture_url.rb +7 -2
  63. data/app/models/alchemy/storage_adapter/dragonfly.rb +24 -2
  64. data/app/models/concerns/alchemy/relatable_resource.rb +28 -0
  65. data/app/stylesheets/alchemy/_custom-properties.scss +162 -0
  66. data/app/stylesheets/alchemy/_mixins.scss +12 -24
  67. data/app/stylesheets/alchemy/_themes.scss +540 -0
  68. data/app/stylesheets/alchemy/admin/archive.scss +28 -8
  69. data/app/stylesheets/alchemy/admin/attachments.scss +10 -33
  70. data/app/stylesheets/alchemy/admin/base.scss +4 -1
  71. data/app/stylesheets/alchemy/admin/buttons.scss +7 -32
  72. data/app/stylesheets/alchemy/admin/dashboard.scss +13 -0
  73. data/app/stylesheets/alchemy/admin/dialogs.scss +17 -7
  74. data/app/stylesheets/alchemy/admin/element-select.scss +11 -0
  75. data/app/stylesheets/alchemy/admin/elements.scss +95 -34
  76. data/app/stylesheets/alchemy/admin/filters.scss +8 -9
  77. data/app/stylesheets/alchemy/admin/flatpickr.scss +12 -27
  78. data/app/stylesheets/alchemy/admin/form_fields.scss +0 -15
  79. data/app/stylesheets/alchemy/admin/forms.scss +3 -8
  80. data/app/stylesheets/alchemy/admin/frame.scss +5 -7
  81. data/app/stylesheets/alchemy/admin/icons.scss +0 -9
  82. data/app/stylesheets/alchemy/admin/image_library.scss +13 -55
  83. data/app/stylesheets/alchemy/admin/navigation.scss +1 -11
  84. data/app/stylesheets/alchemy/admin/node-select.scss +1 -10
  85. data/app/stylesheets/alchemy/admin/nodes.scss +6 -2
  86. data/app/stylesheets/alchemy/admin/notices.scss +5 -4
  87. data/app/stylesheets/alchemy/admin/page-select.scss +16 -0
  88. data/app/stylesheets/alchemy/admin/pagination.scss +1 -8
  89. data/app/stylesheets/alchemy/admin/preview_window.scss +12 -1
  90. data/app/stylesheets/alchemy/admin/resource_info.scss +106 -3
  91. data/app/stylesheets/alchemy/admin/search.scss +1 -1
  92. data/app/stylesheets/alchemy/admin/selects.scss +58 -31
  93. data/app/stylesheets/alchemy/admin/shoelace.scss +32 -62
  94. data/app/stylesheets/alchemy/admin/sitemap.scss +7 -18
  95. data/app/stylesheets/alchemy/admin/tables.scss +3 -3
  96. data/app/stylesheets/alchemy/admin/tags.scss +18 -35
  97. data/app/stylesheets/alchemy/admin/toolbar.scss +0 -6
  98. data/app/stylesheets/alchemy/admin/typography.scss +2 -5
  99. data/app/stylesheets/alchemy/admin.scss +1 -1
  100. data/app/stylesheets/alchemy/dark-theme.scss +5 -0
  101. data/app/stylesheets/alchemy/light-theme.scss +6 -0
  102. data/app/stylesheets/alchemy/theme.scss +13 -0
  103. data/app/stylesheets/tinymce/skins/content/alchemy/content.scss +8 -8
  104. data/app/stylesheets/tinymce/skins/content/alchemy-dark/content.scss +70 -0
  105. data/app/stylesheets/tinymce/skins/ui/alchemy/skin.scss +28 -43
  106. data/app/stylesheets/tinymce/skins/ui/alchemy-dark/content.scss +1 -0
  107. data/app/stylesheets/tinymce/skins/ui/alchemy-dark/skin.scss +3784 -0
  108. data/app/views/alchemy/admin/attachments/_files_list.html.erb +20 -10
  109. data/app/views/alchemy/admin/attachments/assign.js.erb +4 -3
  110. data/app/views/alchemy/admin/attachments/show.html.erb +55 -43
  111. data/app/views/alchemy/admin/crop.html.erb +1 -1
  112. data/app/views/alchemy/admin/dashboard/index.html.erb +1 -1
  113. data/app/views/alchemy/admin/dashboard/info.html.erb +36 -6
  114. data/app/views/alchemy/admin/elements/_form.html.erb +9 -9
  115. data/app/views/alchemy/admin/elements/_header.html.erb +12 -10
  116. data/app/views/alchemy/admin/ingredients/_picture_fields.html.erb +1 -1
  117. data/app/views/alchemy/admin/nodes/_form.html.erb +5 -1
  118. data/app/views/alchemy/admin/pages/info.html.erb +1 -1
  119. data/app/views/alchemy/admin/partials/_search_form.html.erb +1 -0
  120. data/app/views/alchemy/admin/pictures/_archive.html.erb +13 -23
  121. data/app/views/alchemy/admin/pictures/_archive_overlay.html.erb +1 -6
  122. data/app/views/alchemy/admin/pictures/_form.html.erb +10 -5
  123. data/app/views/alchemy/admin/pictures/_infos.html.erb +21 -52
  124. data/app/views/alchemy/admin/pictures/_library_sidebar.html.erb +7 -0
  125. data/app/views/alchemy/admin/pictures/_picture.html.erb +15 -16
  126. data/app/views/alchemy/admin/pictures/_picture_to_assign.html.erb +20 -16
  127. data/app/views/alchemy/admin/pictures/_sorting_select.html.erb +13 -0
  128. data/app/views/alchemy/admin/pictures/_tag_list.html.erb +1 -1
  129. data/app/views/alchemy/admin/pictures/edit_multiple.html.erb +1 -6
  130. data/app/views/alchemy/admin/pictures/index.html.erb +3 -12
  131. data/app/views/alchemy/admin/pictures/show.html.erb +17 -14
  132. data/app/views/alchemy/admin/pictures/update.turbo_stream.erb +1 -1
  133. data/app/views/alchemy/admin/resources/_filter_bar.html.erb +5 -15
  134. data/app/views/alchemy/admin/resources/_resource_usage_info.html.erb +36 -0
  135. data/app/views/alchemy/admin/styleguide/index.html.erb +118 -66
  136. data/app/views/alchemy/admin/uploader/_button.html.erb +1 -1
  137. data/app/views/alchemy/base/error_notice.html.erb +1 -1
  138. data/app/views/alchemy/ingredients/_page_editor.html.erb +0 -1
  139. data/app/views/alchemy/ingredients/_richtext_editor.html.erb +0 -1
  140. data/app/views/alchemy/ingredients/_select_editor.html.erb +1 -2
  141. data/app/views/layouts/alchemy/admin.html.erb +25 -23
  142. data/config/locales/alchemy.en.yml +26 -8
  143. data/db/migrate/20250905140323_add_created_at_index_to_pictures_and_attachments.rb +14 -0
  144. data/lib/alchemy/configuration/base_option.rb +18 -5
  145. data/lib/alchemy/configuration/boolean_option.rb +2 -5
  146. data/lib/alchemy/configuration/collection_option.rb +69 -0
  147. data/lib/alchemy/configuration/configuration_option.rb +35 -0
  148. data/lib/alchemy/configuration/pathname_option.rb +12 -0
  149. data/lib/alchemy/configuration.rb +44 -6
  150. data/lib/alchemy/configurations/format_matchers.rb +1 -1
  151. data/lib/alchemy/configurations/importmap.rb +11 -0
  152. data/lib/alchemy/configurations/mailer.rb +2 -2
  153. data/lib/alchemy/configurations/main.rb +148 -3
  154. data/lib/alchemy/configurations/page_cache.rb +19 -0
  155. data/lib/alchemy/configurations/uploader.rb +2 -2
  156. data/lib/alchemy/deprecation.rb +1 -1
  157. data/lib/alchemy/engine.rb +43 -21
  158. data/lib/alchemy/install/tasks.rb +0 -12
  159. data/lib/alchemy/name_conversions.rb +6 -0
  160. data/lib/alchemy/tasks/tidy.rb +18 -0
  161. data/lib/alchemy/test_support/config_stubbing.rb +13 -4
  162. data/lib/alchemy/test_support/factories/language_factory.rb +8 -4
  163. data/lib/alchemy/test_support/factories/page_factory.rb +1 -0
  164. data/lib/alchemy/test_support/factories/picture_factory.rb +1 -0
  165. data/lib/alchemy/test_support/relatable_resource_examples.rb +58 -0
  166. data/lib/alchemy/tinymce.rb +0 -1
  167. data/lib/alchemy/version.rb +1 -1
  168. data/lib/alchemy.rb +18 -171
  169. data/lib/generators/alchemy/install/install_generator.rb +21 -10
  170. data/lib/generators/alchemy/install/templates/alchemy.rb.tt +88 -13
  171. data/lib/tasks/alchemy/assets.rake +1 -1
  172. data/lib/tasks/alchemy/tidy.rake +6 -0
  173. data/lib/tasks/alchemy/usage.rake +2 -0
  174. data/vendor/assets/stylesheets/tinymce/skins/content/dark/content.min.css +1 -0
  175. data/vendor/assets/stylesheets/tinymce/skins/content/default/content.min.css +1 -0
  176. data/vendor/assets/stylesheets/tinymce/skins/ui/oxide/skin.min.css +1 -0
  177. data/vendor/assets/stylesheets/tinymce/skins/ui/oxide-dark/content.min.css +1 -0
  178. data/vendor/assets/stylesheets/tinymce/skins/ui/oxide-dark/skin.min.css +1 -0
  179. data/vendor/javascript/clipboard.min.js +1 -1
  180. data/vendor/javascript/cropperjs.min.js +1 -1
  181. data/vendor/javascript/handlebars.min.js +3 -3
  182. data/vendor/javascript/jquery.min.js +1 -1
  183. data/vendor/javascript/select2.min.js +3 -3
  184. data/vendor/javascript/shoelace.min.js +92 -76
  185. data/vendor/javascript/sortable.min.js +2 -2
  186. data/vendor/javascript/tinymce.min.js +1 -1
  187. data/vendor/javascript/ungap-custom-elements.min.js +2 -2
  188. metadata +51 -36
  189. data/CHANGELOG.md +0 -2100
  190. data/CODE_OF_CONDUCT.md +0 -13
  191. data/CONTRIBUTING.md +0 -73
  192. data/Gemfile +0 -78
  193. data/Rakefile +0 -102
  194. data/SECURITY.md +0 -13
  195. data/alchemy_cms.gemspec +0 -97
  196. data/app/assets/builds/alchemy/custom-properties.css +0 -1
  197. data/app/helpers/alchemy/admin/elements_helper.rb +0 -25
  198. data/app/stylesheets/alchemy/custom-properties.css +0 -244
  199. data/bin/importmap +0 -4
  200. data/bin/rails +0 -9
  201. data/bin/rspec +0 -3
  202. data/bin/setup +0 -30
  203. data/bin/start +0 -17
  204. data/bun.lockb +0 -0
  205. data/bundles/remixicon.mjs +0 -153
  206. data/bundles/shoelace.js +0 -12
  207. data/bundles/tinymce.js +0 -22
  208. data/eslint.config.js +0 -18
  209. data/lib/alchemy/configuration/class_set_option.rb +0 -46
  210. data/lib/alchemy/configuration/integer_list_option.rb +0 -13
  211. data/lib/alchemy/configuration/list_option.rb +0 -22
  212. data/lib/alchemy/configuration/string_list_option.rb +0 -13
  213. data/lib/alchemy/upgrader/.keep +0 -0
  214. data/lib/alchemy/upgrader/tasks/.keep +0 -0
  215. data/rollup.config.mjs +0 -108
  216. data/vitest.config.js +0 -21
@@ -60,16 +60,26 @@
60
60
  object: attachment,
61
61
  file_attribute: 'file' %>
62
62
  <% end %>
63
- <% table.with_action(:destroy, Alchemy.t(:delete_file)) do |attachment| %>
64
- <%= link_to_confirm_dialog render_icon(:minus),
65
- Alchemy.t(:confirm_to_delete_file),
66
- alchemy.admin_attachment_path(
67
- id: attachment,
68
- q: search_filter_params[:q],
69
- page: params[:page],
70
- per_page: params[:per_page]
71
- ),
72
- class: "icon_button" %>
63
+ <% table.with_action(:destroy) do |attachment| %>
64
+ <% if attachment.deletable? %>
65
+ <sl-tooltip content="<%= Alchemy.t(:delete_file) %>">
66
+ <%= link_to_confirm_dialog render_icon(:minus),
67
+ Alchemy.t(:confirm_to_delete_file),
68
+ alchemy.admin_attachment_path(
69
+ id: attachment,
70
+ q: search_filter_params[:q],
71
+ page: params[:page],
72
+ per_page: params[:per_page]
73
+ ),
74
+ class: "icon_button" %>
75
+ </sl-tooltip>
76
+ <% else %>
77
+ <sl-tooltip content="<%= Alchemy.t(:in_use) %>">
78
+ <button class="icon_button disabled">
79
+ <%= render_icon(:minus) %>
80
+ </button>
81
+ </sl-tooltip>
82
+ <% end %>
73
83
  <% end %>
74
84
  <% table.with_action(:edit, Alchemy.t(:rename_file)) do |attachment| %>
75
85
  <%= link_to_dialog render_icon(:edit),
@@ -5,10 +5,11 @@
5
5
  $form_field.parent().find("> .file_name").text("<%= @attachment.name %>")
6
6
  $form_field.parent().find("> .file_icon").html("<%= j render_icon(@attachment.icon_css_class) %>")
7
7
  $form_field.parent().find("> .remove_file_link").removeClass("hidden")
8
- Alchemy.closeCurrentDialog(function() {
9
- var elementEditor = $form_field[0].closest("alchemy-element-editor")
8
+ Alchemy.closeCurrentDialog(() => {
9
+ const field = $form_field[0]
10
+ const elementEditor = field.closest("alchemy-element-editor")
10
11
  if (elementEditor) {
11
- elementEditor.setDirty()
12
+ elementEditor.setDirty(field)
12
13
  }
13
14
  })
14
15
  })()
@@ -1,45 +1,57 @@
1
- <div class="resource_info">
2
- <div class="value">
3
- <label>
4
- <%= render_icon @attachment.icon_css_class %>
5
- </label>
6
- <p><%= @attachment.file_name %></p>
7
- </div>
8
- <div class="value with-icon">
9
- <label><%= Alchemy::Attachment.human_attribute_name(:url) %></label>
10
- <p><%= @attachment.url %></p>
11
- <alchemy-clipboard-button
12
- content="<%= @attachment.url %>"
13
- success-text="<%= Alchemy.t("Copied to clipboard") %>"
14
- class="icon_button--right"
15
- ></alchemy-clipboard-button>
16
- </div>
17
- <div class="value with-icon">
18
- <label><%= Alchemy::Attachment.human_attribute_name(:download_url) %></label>
19
- <p><%= @attachment.url(download: true) %></p>
20
- <alchemy-clipboard-button
21
- content="<%= @attachment.url(download: true) %>"
22
- success-text="<%= Alchemy.t("Copied to clipboard") %>"
23
- class="icon_button--right"
24
- ></alchemy-clipboard-button>
25
- </div>
26
- </div>
1
+ <div class="resource-details">
2
+ <aside>
3
+ <div class="resource_info">
4
+ <div class="value">
5
+ <label>
6
+ <%= render_icon @attachment.icon_css_class %>
7
+ </label>
8
+ <p><%= @attachment.file_name %></p>
9
+ </div>
10
+ <div class="value with-icon">
11
+ <label><%= Alchemy::Attachment.human_attribute_name(:url) %></label>
12
+ <p><%= @attachment.url %></p>
13
+ <alchemy-clipboard-button
14
+ content="<%= @attachment.url %>"
15
+ success-text="<%= Alchemy.t("Copied to clipboard") %>"
16
+ class="icon_button--right"
17
+ ></alchemy-clipboard-button>
18
+ </div>
19
+ <div class="value with-icon">
20
+ <label><%= Alchemy::Attachment.human_attribute_name(:download_url) %></label>
21
+ <p><%= @attachment.url(download: true) %></p>
22
+ <alchemy-clipboard-button
23
+ content="<%= @attachment.url(download: true) %>"
24
+ success-text="<%= Alchemy.t("Copied to clipboard") %>"
25
+ class="icon_button--right"
26
+ ></alchemy-clipboard-button>
27
+ </div>
28
+ </div>
27
29
 
28
- <% case @attachment.file_mime_type %>
29
- <% when *Alchemy::Filetypes::IMAGE_FILE_TYPES %>
30
- <div class="attachment_preview_container image-preview">
31
- <%= image_tag(@attachment.url, class: "full_width") %>
32
- </div>
33
- <% when *Alchemy::Filetypes::AUDIO_FILE_TYPES %>
34
- <div class="attachment_preview_container player-preview">
35
- <%= audio_tag(@attachment.url, preload: "none", controls: true, class: "full_width") %>
36
- </div>
37
- <% when *Alchemy::Filetypes::VIDEO_FILE_TYPES %>
38
- <div class="attachment_preview_container player-preview">
39
- <%= video_tag(@attachment.url, preload: "metadata", controls: true, class: "full_width") %>
30
+ <hr>
31
+
32
+ <%= render "alchemy/admin/resources/resource_usage_info",
33
+ assignments: @assignments,
34
+ resource_name: :attachment %>
35
+ </aside>
36
+
37
+ <%# We need to use the `tag` helper for the div to be really empty for
38
+ the CSS `:empty` selector to work in order to hide this div if there is no preview %>
39
+ <%= tag.div(class: "resource-preview") do %>
40
+ <% case @attachment.file_mime_type %>
41
+ <% when *Alchemy::Filetypes::IMAGE_FILE_TYPES %>
42
+ <div class="attachment_preview_container">
43
+ <%= image_tag(@attachment.url) %>
44
+ </div>
45
+ <% when *Alchemy::Filetypes::AUDIO_FILE_TYPES %>
46
+ <div class="attachment_preview_container">
47
+ <%= audio_tag(@attachment.url, preload: "metadata", controls: true) %>
48
+ </div>
49
+ <% when *Alchemy::Filetypes::VIDEO_FILE_TYPES %>
50
+ <div class="attachment_preview_container">
51
+ <%= video_tag(@attachment.url, preload: "metadata", controls: true) %>
52
+ </div>
53
+ <% when "application/pdf" %>
54
+ <iframe src="<%= @attachment.url %>" frameborder="0"></iframe>
55
+ <% end %>
56
+ <% end %>
40
57
  </div>
41
- <% when "application/pdf" %>
42
- <iframe src="<%= @attachment.url %>" frameborder=0 class="full-iframe">
43
- Your browser does not support frames.
44
- </iframe>
45
- <% end %>
@@ -12,7 +12,7 @@
12
12
  </div>
13
13
  <form>
14
14
  <%= button_tag Alchemy.t(:apply), type: 'submit' %>
15
- <%= button_tag Alchemy.t('Reset Imagemask'), class: 'reset_mask', type: 'reset' %>
15
+ <%= button_tag Alchemy.t('Reset Imagemask'), class: 'reset_mask secondary', type: 'reset' %>
16
16
  </form>
17
17
  </div>
18
18
  <% end %>
@@ -7,7 +7,7 @@
7
7
  title: Alchemy.t(:info),
8
8
  dialog_options: {
9
9
  title: Alchemy.t(:info),
10
- size: "420x435"
10
+ size: "420x380"
11
11
  },
12
12
  if_permitted_to: [:info, :alchemy_admin_dashboard],
13
13
  hotkey: 'alt+i'
@@ -1,12 +1,42 @@
1
+ <div class="logo">
2
+ <svg
3
+ xmlns="http://www.w3.org/2000/svg"
4
+ viewBox="0 0 267 91"
5
+ >
6
+ <path
7
+ d="M261.749 29.77h-9.812l-.72 2.738a193.53 193.53 0 0 0-.802 3.217c-.334-1.384-.604-2.5-.767-3.162l-.685-2.792H234.075c-1.102-.371-2.338-.564-3.705-.564-2.537 0-4.557.864-6.104 1.934-1.406-1.15-3.402-1.934-6.221-1.934-1.341 0-2.524.242-3.564.625l-.006-.061H201.334v4.17c-2.345-3.051-5.884-4.735-10.401-4.735-4.196 0-8.831 1.936-11.655 6.784-1.194-3.746-3.896-6.784-9.557-6.784-1.385 0-2.626.24-3.727.617v-12.19l-4.204.623-6.934 1.027-3.132.464v10.324a22.109 22.109 0 0 0-6.086-.864c-5.96 0-9.341 2.652-11.128 4.876-.108.133-.2.284-.303.422V17.633l-4.207.623-6.933 1.027-3.131.464v24.04l-5.118-18.709-.739-2.701H99.863l-.745 2.686L95.854 36.8 80.915 21.597a2.922 2.922 0 0 0-2.823-.776l-18.554 4.875a2.918 2.918 0 0 0-.634-.981L39.437 4.906a2.927 2.927 0 0 0-2.826-.777L9.797 11.173a2.92 2.92 0 0 0-2.073 2.054L.372 40.078a2.922 2.922 0 0 0 .735 2.818L20.6 62.705a2.921 2.921 0 0 0 2.822.774l9.259-2.43-3.051 11.1a2.921 2.921 0 0 0 .735 2.821l10.94 11.122a2.92 2.92 0 0 0 2.822.778l15.08-3.953a2.919 2.919 0 0 0 2.077-2.055l3.536-12.978.316.324a2.928 2.928 0 0 0 2.064.872c.254.001.508-.031.761-.098l20.839-5.48H103.275l.72-2.733.82-3.121h3.794l.822 3.122.718 2.732h24.059v-4.307c.07.092.133.194.207.282 1.729 2.119 5.001 4.643 10.76 4.643 2.735 0 4.945-.705 6.55-1.415v.797H180.119v-4.383c2.392 3.007 5.737 4.495 9.134 4.885-1.602 1.106-3.095 2.759-4.467 4.952-2.161 3.454-3.211 6.441-3.211 9.137 0 2.014.524 3.774 1.562 5.236 1.388 1.967 3.57 3.053 6.143 3.053.226 0 .384-.016.896-.073.142-.014.243-.025.312-.03 1.014-.043 2.078-.446 4.047-1.521.468-.248.973-.622 2.077-1.656.966 3.029 2.97 3.501 4.119 3.501 2.479 0 4.354-1.665 4.575-4.057.007-.045.041-.233.189-.649.774 1.335 2.059 2.415 4.188 2.415 2.658 0 4.791-2.088 6.555-4.378.065.155.132.312.203.47 1.794 4.082 4.646 4.694 6.185 4.694.76 0 1.52-.168 2.307-.503.228.213.463.419.726.605a6.818 6.818 0 0 0 3.993 1.302c2.273 0 4.515-.764 6.661-2.274 3.357-2.369 4.061-5.111 4.061-6.996 0-2.266-1.092-4.215-3.014-5.406a4.177 4.177 0 0 0 2.142-1.312c.918 1.27 1.794 2.475 2.303 3.129l1.917 2.468 2.74-1.503.268-.144c2.382-1.291 7.335-3.979 9.847-12.048l8.677-27.888 1.479-4.759h-4.984z"
8
+ fill="transparent"
9
+ />
10
+ <path
11
+ fill="currentColor"
12
+ d="M102.705 26.102h8.626l9.245 33.793h-7.549l-1.541-5.856h-9.448l-1.541 5.856h-7.189l9.397-33.793zm.411 23.008h7.291c-1.282-5.857-2.925-12.841-3.594-16.487-.719 3.647-2.362 10.63-3.697 16.487zm27.472 10.786h-6.931V22.969l6.931-1.026v37.953zm22.187-1.748c-.977.409-3.545 2.364-7.549 2.364-6.883 0-10.682-4.314-10.682-13.405 0-9.554 3.953-14.176 11.143-14.176 2.878 0 5.239.719 6.163 1.079l-.822 5.083c-.666-.256-2.517-.822-4.365-.822-3.388 0-4.981 2.62-4.981 8.579 0 6.061 1.747 8.267 4.775 8.267 2.108 0 4.008-1.128 4.726-1.386l1.592 4.417zm2.671-35.179l6.931-1.026v14.943h.105c.717-.667 3.079-3.954 7.291-3.954 4.826 0 6.728 2.979 6.728 9.193v17.771h-6.934V43.819c0-3.801-.616-4.879-2.721-4.879-2.107 0-3.853 2.157-4.47 2.876v18.079h-6.931V22.969zm44.73 35.026c-.771.514-3.956 2.518-9.038 2.518-5.957 0-10.785-3.852-10.785-13.097 0-9.811 4.775-14.484 10.63-14.484 5.854 0 9.963 3.646 9.963 12.273 0 1.851-.257 3.339-.309 3.597h-13.401c.05 4.571 2.311 6.469 5.235 6.469 2.773 0 5.086-1.231 6.319-1.795l1.386 4.519zm-12.941-13.509h7.034c0-5.237-1.437-6.624-3.338-6.624-1.798 0-3.646 1.643-3.696 6.624zm17.82-10.989h6.107l.31 3.543c.772-.925 2.722-4.109 6.624-4.109 2.98 0 4.828 1.027 5.598 4.057.874-1.181 3.03-4.057 6.728-4.057 4.468 0 6.37 2.517 6.37 9.141v17.823h-6.883V42.637c0-2.311-.358-3.697-2.158-3.697-1.797 0-3.183 2.054-3.543 2.876v18.079h-6.625V42.637c0-2.311-.358-3.697-2.157-3.697-1.796 0-3.131 2.003-3.542 2.876v18.079h-6.828V33.497zm56.744 0l-8.679 27.887c-2.156 6.934-6.213 8.886-8.37 10.067-.718-.926-2.414-3.287-3.081-4.213.771-.668 4.467-2.566 5.546-6.778l-8.318-26.963h7.239c.771 3.132 3.545 14.688 4.314 19.002.821-4.417 3.545-15.87 4.367-19.002h6.982z"
13
+ />
14
+ <g>
15
+ <path
16
+ fill="currentColor"
17
+ d="M193.986 68.011c.319 0 .667.193 1.031.578.897.95 1.506 1.125 2.353.546.367-.254.548-.633.508-1.05-.054-.799-.66-1.456-1.799-1.957-.818-.364-1.438-.541-1.896-.541-2.436.013-4.74 1.736-6.854 5.116-1.807 2.889-2.722 5.389-2.722 7.435 0 1.336.326 2.474.969 3.379.796 1.128 1.983 1.701 3.526 1.701.029 0 .213-.016.555-.054.268-.028.427-.045.47-.046.306 0 .867-.139 2.703-1.14.226-.117.704-.468 2.439-2.166 1.932-1.896 2.285-2.549 2.366-2.884.084-.275.01-.583-.22-.921-.238-.344-.523-.518-.838-.518a.786.786 0 0 0-.708.429c-.872 1.35-1.932 2.444-3.146 3.266-1.295.868-2.615 1.308-3.923 1.308-.778 0-1.671-.234-1.671-2.074 0-1.427.742-3.47 2.211-6.08 1.621-2.872 3.183-4.327 4.646-4.327zm30.25 10.553c-.354 0-.695.247-1.103.798-.301.408-.535.409-.654.408-.259-.01-1.135-.388-1.441-4.977l-.305-4.414c-.25-1.795-.915-2.704-1.979-2.704-.68 0-1.78.545-4.245 4.804a46.07 46.07 0 0 1-2.457 3.695c-.936 1.256-1.511 1.87-1.856 2.171-.082-.436-.124-.979-.124-1.635 0-.533.027-1.253.081-2.143.055-.995.089-1.633.101-1.925.039-2.004-.251-3.293-.885-3.941a1.569 1.569 0 0 0-1.157-.483c-1.114 0-2.453 1.26-4.214 3.968-.44.683-1.144 1.88-2.093 3.565.149-2.311.529-4.59 1.141-6.795.071-.267.054-.669-.433-1.089-.33-.287-.703-.436-1.107-.436-.863 0-1.277 1.173-1.539 2.19-.313 1.16-.526 2.592-.635 4.245-.119 1.754-.181 3.891-.181 6.36 0 .357.075.868.233 1.577.203.807.5 1.631 1.17 1.631.813 0 1.32-.423 1.381-1.157.113-1.165 1.095-3.422 2.918-6.71 1.54-2.804 2.334-3.953 2.701-4.42 0 .089 0 .194-.005.32-.15 3.265-.211 5.245-.182 5.886.105 2.516.823 3.792 2.139 3.792 1.21 0 2.685-1.261 4.636-3.968.255-.355 2.324-3.588 3.537-5.488.234-.37.414-.648.545-.854.012.086.021.184.031.293.052.55.064 1.329.038 2.328v2.002c.01 1.115.313 2.354.903 3.685.812 1.851 1.907 2.786 3.252 2.786.459 0 .972-.164 1.575-.502.819-.475 1.234-1.083 1.234-1.804.001-.652-.392-1.059-1.021-1.059zm6.628-4.902c-2.19 0-2.468-.365-2.475-.365 0-.874.821-2.04 2.372-3.37 1.809-1.556 2.828-1.882 3.366-1.882.036 0 .073.003.123.006.072.004.298.046.826.328.721.386.872.415 1.009.415.727 0 1.163-.494 1.163-1.324 0-.631-.425-1.187-1.268-1.647-.651-.35-1.201-.517-1.684-.517-1.572 0-3.401 1.039-5.592 3.175-2.195 2.138-3.262 3.892-3.262 5.361 0 .738.509 1.313 1.518 1.711.65.258 1.33.402 2.023.432l3.86.141c.473.023.891.157 1.28.407.556.367.619.737.619.983 0 .86-1.161 1.629-2.133 2.122-1.358.688-2.57 1.035-3.598 1.035-.625 0-.625-.247-.625-.444 0-.104.017-.197.054-.283.126-.3.213-.694.266-1.218l.035-.339-.312-.132c-.656-.279-1.311.032-1.813.841-.316.495-.47.93-.47 1.33 0 .904.4 1.646 1.192 2.199a3.557 3.557 0 0 0 2.134.712c1.598 0 3.218-.569 4.811-1.693 1.794-1.263 2.701-2.733 2.701-4.371.002-2.398-2.057-3.613-6.12-3.613z"
18
+ />
19
+ </g>
20
+ <g fill-rule="evenodd" clip-rule="evenodd" fill="currentColor">
21
+ <path
22
+ d="M47.632 51.588L23.382 57.956 5.754 40.043 12.401 15.762 36.65 9.393 54.254 27.305z"
23
+ />
24
+ <path
25
+ d="M57.42 79.029L43.781 82.603 33.888 72.543 37.632 58.91 51.244 55.334 61.138 65.395z"
26
+ />
27
+ <path
28
+ d="M86.963 59.079L67.775 64.128 53.829 49.94 59.066 30.726 78.277 25.679 92.223 39.865z"
29
+ />
30
+ </g>
31
+ </svg>
32
+ Version <%= @alchemy_version %>
33
+ </div>
34
+
1
35
  <p class="center">
2
- <%= image_tag('alchemy/alchemy-logo.svg', width: 267, height: 91) %>
3
- </p>
4
- <h2 class="center">
5
- v<%= @alchemy_version %><br>
6
36
  <small>
7
- Ruby v<%= RUBY_VERSION %>, Rails v<%= Rails.version %>
37
+ Ruby <%= RUBY_VERSION %>, Rails <%= Rails.version %>
8
38
  </small>
9
- </h2>
39
+ </p>
10
40
 
11
41
  <% if can?(:update_check, :alchemy_admin_dashboard) %>
12
42
  <alchemy-update-check url="<%= alchemy.update_check_path %>">
@@ -6,15 +6,15 @@
6
6
  <%= turbo_frame_tag @element do %>
7
7
  <%= alchemy_form_for [:admin, @element], remote: false do |form| %>
8
8
  <%= form.hidden_field :page_version_id %>
9
- <%= form.input :name,
10
- label: Alchemy.t(:element_of_type),
11
- collection: elements_for_select(@elements),
12
- prompt: Alchemy.t(:select_element),
13
- selected: (@elements.first if @elements.count == 1),
14
- input_html: {is: 'alchemy-select', autofocus: true} %>
15
- <% if @elements.count == 1 %>
16
- <%= form.hidden_field :name, value: @elements.first.name %>
17
- <% end %>
9
+ <div class="input">
10
+ <%= form.label(:name, class: "control-label required") do %>
11
+ <%= Alchemy.t(:element_of_type) %><abbr>*</abbr>
12
+ <% end %>
13
+ <%= render Alchemy::Admin::ElementSelect.new(
14
+ @elements,
15
+ field_name: form.field_name(:name)
16
+ ) %>
17
+ </div>
18
18
  <%= form.hidden_field :parent_element_id, value: @parent_element.try(:id) %>
19
19
  <%= form.submit Alchemy.t(:add) %>
20
20
  <%- end -%>
@@ -5,7 +5,10 @@
5
5
  <% elsif element.deprecated? %>
6
6
  <%= hint_with_tooltip element.deprecation_notice %>
7
7
  <% else %>
8
- <%= render_icon('draggable', style: false, class: 'element', fixed_width: false) %>
8
+ <span class="icon element">
9
+ <%= element.definition.icon_file %>
10
+ </span>
11
+ <%= render_icon(:draggable, style: false, fixed_width: false) %>
9
12
  <% end %>
10
13
  </span>
11
14
  <span class="element-title">
@@ -21,14 +24,13 @@
21
24
  <%= Alchemy.t(:element_hidden) %>
22
25
  </span>
23
26
  </span>
24
- <%= button_tag({
25
- title: Alchemy.t(element.folded? ? :show_element_content : :hide_element_content),
26
- class: "element-toggle"
27
- }) do %>
28
- <% if element.compact? %>
29
- <%= render_icon "more-2" %>
30
- <% else %>
31
- <%= render_icon element.folded? ? "arrow-left-s" : "arrow-down-s" %>
27
+ <sl-tooltip content="<%= Alchemy.t(element.folded? ? :show_element_content : :hide_element_content) %>">
28
+ <%= button_tag(class: "element-toggle") do %>
29
+ <% if element.compact? %>
30
+ <%= render_icon "more-2" %>
31
+ <% else %>
32
+ <%= render_icon element.folded? ? "arrow-left-s" : "arrow-down-s" %>
33
+ <% end %>
32
34
  <% end %>
33
- <% end %>
35
+ </sl-tooltip>
34
36
  </div>
@@ -15,7 +15,7 @@
15
15
  then css_classes
16
16
  else
17
17
  css_classes.map do |klass|
18
- [Alchemy.t(klass, scope: "picture_ingredients.css_classes", default: picture_editor.css_class.camelcase), klass]
18
+ [Alchemy.t(klass, scope: "picture_ingredients.css_classes", default: ingredient.css_class&.camelcase), klass]
19
19
  end
20
20
  end %>
21
21
  <%= f.input :css_class, collection: css_classes_collection, include_blank: false %>
@@ -16,7 +16,11 @@
16
16
  <%= render Alchemy::Admin::PageSelect.new(node.page, allow_clear: true, query_params: {contentpages: true}) do %>
17
17
  <%= f.input :page_id, label: Alchemy::Page.model_name.human %>
18
18
  <% end %>
19
- <%= f.input :url, input_html: { disabled: node.page }, hint: Alchemy.t(:node_url_hint) %>
19
+ <%= f.input :url, as: :string, input_html: {
20
+ disabled: node.page,
21
+ pattern: '/.*|[a-zA-Z][\w\+\-\.]*://.+',
22
+ title: Alchemy.t(:node_url_hint)
23
+ }, hint: Alchemy.t(:node_url_hint) %>
20
24
  <%= f.input :title %>
21
25
  <%= f.input :nofollow %>
22
26
  <%= f.input :external %>
@@ -15,7 +15,7 @@
15
15
  </div>
16
16
  <div class="value">
17
17
  <label><%= Alchemy::Page.human_attribute_name(:urlname) %></label>
18
- <p><%= "/#{@page.urlname}" %></p>
18
+ <p><%= @page.url_path %></p>
19
19
  </div>
20
20
  <div class="value">
21
21
  <label><%= Alchemy.t(:page_status) %></label>
@@ -8,6 +8,7 @@
8
8
  <%= render_icon('search') %>
9
9
  </button>
10
10
  <%= f.search_field resource_handler.search_field_name,
11
+ value: params.dig(:q, resource_handler.search_field_name),
11
12
  class: 'search_input_field',
12
13
  placeholder: Alchemy.t(:search) %>
13
14
  <%= link_to render_icon(:times, size: '1x'), url,
@@ -1,23 +1,19 @@
1
- <div id="library_sidebar">
2
- <%= render 'filter_bar' if resource_has_filters %>
1
+ <%= render "library_sidebar" %>
3
2
 
4
- <% if Alchemy::Picture.tag_counts.any? %>
5
- <div class="tag-list with_filter_bar<%= ' filtered' if search_filter_params[:tagged_with].present? %>">
6
- <%= render 'tag_list' %>
7
- </div>
8
- <% end %>
9
- </div>
3
+ <% forwarded_params = search_filter_params.merge(
4
+ page: params[:page],
5
+ size: @size.presence
6
+ ).to_h %>
10
7
 
11
- <%= form_tag delete_multiple_admin_pictures_path, method: :delete do %>
8
+ <%= form_tag delete_multiple_admin_pictures_path(forwarded_params), method: :delete do %>
12
9
  <div class="selected_item_tools hidden">
13
10
  <h3><%= Alchemy.t(:edit_selected_pictures) %></h3>
14
11
  <%= link_to(
15
12
  render_icon(:edit, size: '1x') + Alchemy.t("Edit"),
16
- edit_multiple_admin_pictures_path,
13
+ edit_multiple_admin_pictures_path(forwarded_params),
17
14
  class: 'button with_icon',
18
15
  title: Alchemy.t('Edit multiple pictures'),
19
- id: 'edit_multiple_pictures',
20
- style: 'float: none'
16
+ id: 'edit_multiple_pictures'
21
17
  ) %>
22
18
  <%= button_tag render_icon("delete-bin-2", size: '1x') + Alchemy.t("Delete"),
23
19
  'data-turbo-confirm': Alchemy.t(:confirm_to_delete_images_from_server),
@@ -25,27 +21,21 @@
25
21
  &nbsp;<%= Alchemy.t(:or) %>&nbsp;
26
22
  <%= link_to(
27
23
  render_icon(:close) + Alchemy.t("Clear selection"),
28
- admin_pictures_path(
29
- q: search_filter_params[:q],
30
- tagged_with: search_filter_params[:tagged_with],
31
- size: @size,
32
- filter: search_filter_params[:filter]
33
- ),
34
- class: 'secondary button with_icon',
35
- style: 'float: none'
24
+ admin_pictures_path(forwarded_params),
25
+ class: 'secondary button with_icon'
36
26
  ) %>
37
27
  </div>
38
- <% if @pictures.blank? and @recent_pictures.blank? and search_filter_params[:q].blank? %>
28
+ <% if @pictures.blank? && @recent_pictures.blank? && search_filter_params[:q].blank? %>
39
29
  <%= render_message do %>
40
30
  <%= Alchemy.t(:no_images_in_archive) %>
41
31
  <% end %>
42
- <% elsif @pictures.blank? and @recent_pictures.blank? %>
32
+ <% elsif @pictures.blank? && @recent_pictures.blank? %>
43
33
  <%= render_message do %>
44
34
  <%= Alchemy.t(:no_search_results) %>
45
35
  <% end %>
46
36
  <% else %>
47
37
  <div id="pictures" class="picture-size--<%= @size %>">
48
- <%= render partial: 'picture', collection: @pictures %>
38
+ <%= render partial: "picture", collection: @pictures, locals: {picture_offset: picture_offset} %>
49
39
  </div>
50
40
  <% end %>
51
41
  <% end %>
@@ -2,12 +2,7 @@
2
2
  <%= render 'filter_and_size_bar' %>
3
3
  </div>
4
4
  <div id="assign_image_list" class="with_padding<%= search_filter_params[:tagged_with].present? ? ' filtered' : '' %>">
5
- <div id="library_sidebar">
6
- <%= render 'filter_bar' if resource_has_filters %>
7
- <div class="tag-list">
8
- <%= render 'tag_list' %>
9
- </div>
10
- </div>
5
+ <%= render "library_sidebar" %>
11
6
  <% if @pictures.empty? %>
12
7
  <%= render_message do %>
13
8
  <% if search_filter_params.empty? %>
@@ -1,5 +1,14 @@
1
1
  <%= turbo_frame_tag(@picture) do %>
2
- <%= alchemy_form_for [alchemy, :admin, @picture] do |f| %>
2
+ <%= alchemy_form_for @picture,
3
+ url: alchemy.admin_picture_path(
4
+ @picture,
5
+ search_filter_params.merge(
6
+ size: @size,
7
+ picture_index: picture_index
8
+ ).to_h
9
+ ),
10
+ remote: false,
11
+ class: "picture-form" do |f| %>
3
12
  <%= f.input :name %>
4
13
  <%= render "alchemy/admin/pictures/picture_description_field", f: f %>
5
14
  <%= render Alchemy::Admin::TagsAutocomplete.new(additional_class: "input") do %>
@@ -7,10 +16,6 @@
7
16
  <%= f.text_field :tag_list, value: f.object.tag_list.join(",") %>
8
17
  <small class="hint"><%= Alchemy.t('Please seperate the tags with commata') %></small>
9
18
  <% end %>
10
- <%= hidden_field_tag :q, search_filter_params[:q] %>
11
- <%= hidden_field_tag :size, @size %>
12
- <%= hidden_field_tag :tagged_with, search_filter_params[:tagged_with] %>
13
- <%= hidden_field_tag :filter, search_filter_params[:filter] %>
14
19
  <%= f.submit Alchemy.t(:save) %>
15
20
  <% end %>
16
21
  <% end %>
@@ -1,55 +1,24 @@
1
- <div class="resource_info">
2
- <div class="picture-file-infos">
3
- <div class="value">
4
- <label><%= Alchemy::Picture.human_attribute_name(:image_file_name) %></label>
5
- <p><%= @picture.image_file_name %></p>
6
- </div>
7
- <div class="value">
8
- <label><%= Alchemy::Picture.human_attribute_name(:image_file_dimensions) %></label>
9
- <p><%= @picture.image_file_dimensions %>px</p>
10
- </div>
11
- <div class="value">
12
- <label><%= Alchemy::Picture.human_attribute_name(:image_file_size) %></label>
13
- <p><%= number_to_human_size @picture.image_file_size %></p>
14
- </div>
1
+ <div class="resource_info file-infos">
2
+ <div class="value">
3
+ <label><%= Alchemy::Picture.human_attribute_name(:image_file_name) %></label>
4
+ <p><%= @picture.image_file_name %></p>
15
5
  </div>
16
- </div>
17
-
18
- <div class="picture-usage-info resource_info">
19
- <h3>
20
- <%= Alchemy.t(:this_picture_is_used_on_these_pages) %>
21
- </h3>
22
- <div id="pictures_page_list">
23
- <% if @assignments.any? %>
24
- <ul>
25
- <% @assignments.group_by(&:page).each do |page, picture_ingredients| %>
26
- <% if page %>
27
- <li>
28
- <h3>
29
- <%= render_icon 'file' %>
30
- <p><%= link_to page.name, edit_admin_page_path(page) %></p>
31
- </h3>
32
- <ul class="list">
33
- <% picture_ingredients.group_by(&:element).each do |element, picture_ingredients| %>
34
- <li class="<%= cycle('even', 'odd') %>">
35
- <% page_link = link_to element.display_name_with_preview_text,
36
- edit_admin_page_path(page, anchor: "element_#{element.id}") %>
37
- <% ingredients = picture_ingredients.map { |p| Alchemy::IngredientEditor.new(p).translated_role }.to_sentence %>
38
- <%= render_icon('draggable', style: false) %>
39
- <p>
40
- <%== Alchemy.t(:pictures_in_page, page: page_link, pictures: ingredients) %>
41
- </p>
42
- </li>
43
- <% end %>
44
- </ul>
45
- </li>
46
- <% end %>
47
- <% end %>
48
- </ul>
49
- <% else %>
50
- <%= render_message do %>
51
- <%= Alchemy.t(:picture_not_in_use_yet) %>
52
- <% end %>
53
- <% end %>
6
+ <div class="value">
7
+ <label><%= Alchemy::Picture.human_attribute_name(:image_file_dimensions) %></label>
8
+ <p><%= @picture.image_file_dimensions %>px</p>
9
+ </div>
10
+ <div class="value">
11
+ <label><%= Alchemy::Picture.human_attribute_name(:image_file_size) %></label>
12
+ <p><%= number_to_human_size @picture.image_file_size %></p>
13
+ </div>
14
+ <div class="value">
15
+ <label><%= Alchemy::Picture.human_attribute_name(:created_at) %></label>
16
+ <p><%= l(@picture.created_at, format: :"alchemy.default") %></p>
54
17
  </div>
55
18
  </div>
19
+
20
+ <hr>
21
+
22
+ <%= render "alchemy/admin/resources/resource_usage_info",
23
+ assignments: @assignments,
24
+ resource_name: :picture %>
@@ -0,0 +1,7 @@
1
+ <div id="library_sidebar">
2
+ <%= render "sorting_select" %>
3
+ <%= render "filter_bar" if resource_has_filters %>
4
+ <div class="tag-list">
5
+ <%= render "tag_list" %>
6
+ </div>
7
+ </div>
@@ -3,35 +3,34 @@
3
3
  <%= check_box_tag "picture_ids[]", picture.id %>
4
4
  </span>
5
5
  <% if picture.deletable? && can?(:destroy, picture) %>
6
- <span class="picture_tool delete">
6
+ <div class="picture_tool delete">
7
7
  <sl-tooltip content="<%= Alchemy.t('Delete image') %>">
8
8
  <%= link_to_confirm_dialog(
9
9
  render_icon("delete-bin-2"),
10
10
  Alchemy.t(:confirm_to_delete_image_from_server),
11
11
  alchemy.admin_picture_path(
12
- id: picture,
13
- q: search_filter_params[:q],
14
- page: params[:page],
15
- tagged_with: search_filter_params[:tagged_with],
16
- size: @size,
17
- filter: search_filter_params[:filter]
12
+ picture,
13
+ search_filter_params.merge(
14
+ page: params[:page],
15
+ size: @size.presence
16
+ ).to_h
18
17
  )
19
18
  ) -%>
20
19
  </sl-tooltip>
21
- </span>
20
+ </div>
22
21
  <% end %>
23
22
  <% picture_url = picture.thumbnail_url(size: preview_size(@size)) %>
24
- <% image = image_tag(picture_url || "alchemy/missing-image.svg", alt: picture.name) %>
25
- <% if can?(:edit, picture) && picture_url %>
23
+ <% image = picture_url ? image_tag(picture_url, alt: picture.name) : '<alchemy-icon name="file-damage"></alchemy-icon>'.html_safe %>
24
+ <% if can?(:edit, picture) %>
25
+ <% picture_index ||= picture_offset + picture_iteration.index %>
26
26
  <%= link_to(
27
27
  image,
28
28
  alchemy.admin_picture_path(
29
- id: picture,
30
- q: search_filter_params[:q],
31
- page: params[:page],
32
- tagged_with: search_filter_params[:tagged_with],
33
- size: @size,
34
- filter: search_filter_params[:filter]
29
+ picture,
30
+ search_filter_params.merge(
31
+ picture_index: picture_index.to_i + 1,
32
+ size: @size.presence
33
+ ).to_h
35
34
  ),
36
35
  class: 'thumbnail_background'
37
36
  ) %>
@@ -1,20 +1,24 @@
1
1
  <div class="picture_thumbnail" name="<%= picture_to_assign.name %>" id="assignable_<%= picture_to_assign.id %>">
2
- <sl-tooltip content="<%= Alchemy.t(:assign_image) %>">
3
- <%= link_to(
4
- image_tag(
5
- picture_to_assign.thumbnail_url(size: preview_size(size)) || "alchemy/missing-image.svg",
6
- alt: picture_to_assign.name
7
- ),
8
- alchemy.assign_admin_picture_path(
9
- id: picture_to_assign.id,
10
- form_field_id: @form_field_id
11
- ),
12
- remote: true,
13
- onclick: '$(self).attr("href", "#").off("click"); return false',
14
- method: 'put',
15
- class: 'thumbnail_background'
16
- ) %>
17
- </sl-tooltip>
2
+ <% if picture_to_assign.image_file %>
3
+ <sl-tooltip content="<%= Alchemy.t(:assign_image) %>">
4
+ <%= link_to(
5
+ image_tag(
6
+ picture_to_assign.thumbnail_url(size: preview_size(size)),
7
+ alt: picture_to_assign.name
8
+ ),
9
+ alchemy.assign_admin_picture_path(
10
+ id: picture_to_assign.id,
11
+ form_field_id: @form_field_id
12
+ ),
13
+ remote: true,
14
+ onclick: '$(self).attr("href", "#").off("click"); return false',
15
+ method: 'put',
16
+ class: 'thumbnail_background'
17
+ ) %>
18
+ </sl-tooltip>
19
+ <% else %>
20
+ <alchemy-icon name="file-damage"></alchemy-icon>
21
+ <% end %>
18
22
  <div class="picture_name" title="<%= picture_to_assign.name %>">
19
23
  <%= picture_to_assign.name %>
20
24
  </div>