alchemy_cms 8.0.10 → 8.1.0

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 (283) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +14 -10
  3. data/app/assets/builds/alchemy/admin.css +1 -1
  4. data/app/assets/builds/alchemy/dark-theme.css +1 -1
  5. data/app/assets/builds/alchemy/light-theme.css +1 -1
  6. data/app/assets/builds/alchemy/preview.min.js +1 -1
  7. data/app/assets/builds/alchemy/theme.css +1 -1
  8. data/app/{views/alchemy/admin/elements/_element.html.erb → components/alchemy/admin/element_editor.html.erb} +34 -29
  9. data/app/components/alchemy/admin/element_editor.rb +115 -0
  10. data/app/components/alchemy/admin/element_select.rb +12 -9
  11. data/app/components/alchemy/admin/ingredient_editor.rb +54 -0
  12. data/app/components/alchemy/admin/list_filter.rb +16 -5
  13. data/app/components/alchemy/admin/page_node.html.erb +214 -0
  14. data/app/components/alchemy/admin/page_node.rb +70 -0
  15. data/app/components/alchemy/admin/picture_thumbnail.rb +36 -0
  16. data/app/components/alchemy/admin/publish_page_button.html.erb +15 -0
  17. data/app/components/alchemy/admin/publish_page_button.rb +54 -0
  18. data/app/{helpers/alchemy/admin/tags_helper.rb → components/alchemy/admin/tags_list.rb} +19 -11
  19. data/app/components/alchemy/admin/toolbar_button.rb +17 -13
  20. data/app/components/alchemy/ingredients/audio_editor.rb +8 -0
  21. data/app/components/alchemy/ingredients/base_editor.rb +222 -0
  22. data/app/components/alchemy/ingredients/boolean_editor.rb +21 -0
  23. data/app/components/alchemy/ingredients/color_editor.rb +80 -0
  24. data/app/components/alchemy/ingredients/color_view.rb +13 -0
  25. data/app/components/alchemy/ingredients/datetime_editor.rb +28 -0
  26. data/app/components/alchemy/ingredients/file_editor.rb +69 -0
  27. data/app/components/alchemy/ingredients/headline_editor.rb +88 -0
  28. data/app/components/alchemy/ingredients/html_editor.rb +11 -0
  29. data/app/components/alchemy/ingredients/link_editor.rb +29 -0
  30. data/app/components/alchemy/ingredients/node_editor.rb +23 -0
  31. data/app/components/alchemy/ingredients/number_editor.rb +28 -0
  32. data/app/components/alchemy/ingredients/page_editor.rb +19 -0
  33. data/app/components/alchemy/ingredients/picture_editor.rb +81 -0
  34. data/app/components/alchemy/ingredients/richtext_editor.rb +31 -0
  35. data/app/components/alchemy/ingredients/select_editor.rb +37 -0
  36. data/app/components/alchemy/ingredients/select_view.rb +7 -0
  37. data/app/components/alchemy/ingredients/text_editor.rb +41 -0
  38. data/app/components/alchemy/ingredients/video_editor.rb +8 -0
  39. data/app/controllers/alchemy/admin/attachments_controller.rb +8 -6
  40. data/app/controllers/alchemy/admin/base_controller.rb +7 -18
  41. data/app/controllers/alchemy/admin/clipboard_controller.rb +15 -11
  42. data/app/controllers/alchemy/admin/dashboard_controller.rb +2 -2
  43. data/app/controllers/alchemy/admin/elements_controller.rb +34 -32
  44. data/app/controllers/alchemy/admin/ingredients_controller.rb +1 -0
  45. data/app/controllers/alchemy/admin/layoutpages_controller.rb +2 -1
  46. data/app/controllers/alchemy/admin/legacy_page_urls_controller.rb +1 -1
  47. data/app/controllers/alchemy/admin/nodes_controller.rb +24 -1
  48. data/app/controllers/alchemy/admin/pages_controller.rb +36 -42
  49. data/app/controllers/alchemy/admin/pictures_controller.rb +2 -5
  50. data/app/controllers/alchemy/admin/resources_controller.rb +1 -1
  51. data/app/controllers/alchemy/api/ingredients_controller.rb +1 -1
  52. data/app/controllers/alchemy/api/pages_controller.rb +5 -3
  53. data/app/controllers/alchemy/base_controller.rb +6 -6
  54. data/app/controllers/alchemy/pages_controller.rb +12 -6
  55. data/app/controllers/concerns/alchemy/admin/archive_overlay.rb +0 -1
  56. data/app/controllers/concerns/alchemy/admin/clipboard.rb +57 -0
  57. data/app/controllers/concerns/alchemy/admin/uploader_responses.rb +2 -2
  58. data/app/controllers/concerns/alchemy/site_redirects.rb +1 -1
  59. data/app/decorators/alchemy/ingredient_editor.rb +37 -4
  60. data/app/helpers/alchemy/admin/base_helper.rb +10 -6
  61. data/app/helpers/alchemy/admin/ingredients_helper.rb +6 -3
  62. data/app/helpers/alchemy/base_helper.rb +1 -1
  63. data/app/helpers/alchemy/pages_helper.rb +1 -1
  64. data/app/javascript/alchemy_admin/components/action.js +5 -1
  65. data/app/javascript/alchemy_admin/components/color_select.js +73 -0
  66. data/app/javascript/alchemy_admin/components/element_editor/delete_element_button.js +11 -3
  67. data/app/javascript/alchemy_admin/components/element_editor/publish_element_button.js +7 -2
  68. data/app/javascript/alchemy_admin/components/element_editor.js +11 -12
  69. data/app/javascript/alchemy_admin/components/element_select.js +39 -17
  70. data/app/javascript/alchemy_admin/components/elements_window.js +0 -2
  71. data/app/javascript/alchemy_admin/components/file_editor.js +26 -0
  72. data/app/javascript/alchemy_admin/components/index.js +9 -0
  73. data/app/javascript/alchemy_admin/components/list_filter.js +57 -8
  74. data/app/javascript/alchemy_admin/components/message.js +9 -3
  75. data/app/javascript/alchemy_admin/components/page_node.js +119 -0
  76. data/app/javascript/alchemy_admin/{page_publication_fields.js → components/page_publication_fields.js} +9 -8
  77. data/app/javascript/alchemy_admin/{picture_editors.js → components/picture_editor.js} +30 -45
  78. data/app/javascript/alchemy_admin/components/picture_thumbnail.js +107 -0
  79. data/app/javascript/alchemy_admin/components/publish_page_button.js +41 -0
  80. data/app/javascript/alchemy_admin/components/select.js +3 -1
  81. data/app/javascript/alchemy_admin/components/sitemap.js +210 -0
  82. data/app/javascript/alchemy_admin/{sortable_elements.js → components/sortable_elements.js} +22 -25
  83. data/app/javascript/alchemy_admin/components/tinymce.js +10 -5
  84. data/app/javascript/alchemy_admin/components/uploader.js +30 -0
  85. data/app/javascript/alchemy_admin/image_overlay.js +0 -2
  86. data/app/javascript/alchemy_admin/initializer.js +0 -3
  87. data/app/javascript/alchemy_admin/link_dialog.js +1 -6
  88. data/app/javascript/alchemy_admin/templates/compiled.js +1 -1
  89. data/app/javascript/alchemy_admin/utils/ajax.js +15 -3
  90. data/app/javascript/alchemy_admin.js +0 -6
  91. data/app/models/alchemy/attachment.rb +4 -4
  92. data/app/models/alchemy/element/definitions.rb +1 -2
  93. data/app/models/alchemy/element/element_ingredients.rb +6 -2
  94. data/app/models/alchemy/element.rb +54 -13
  95. data/app/models/alchemy/element_definition.rb +4 -1
  96. data/app/models/alchemy/elements_repository.rb +6 -0
  97. data/app/models/alchemy/folded_page.rb +2 -2
  98. data/app/models/alchemy/ingredient.rb +38 -1
  99. data/app/models/alchemy/ingredient_definition.rb +4 -1
  100. data/app/models/alchemy/ingredient_validator.rb +6 -2
  101. data/app/models/alchemy/ingredients/color.rb +10 -0
  102. data/app/models/alchemy/ingredients/headline.rb +2 -17
  103. data/app/models/alchemy/ingredients/picture.rb +4 -4
  104. data/app/models/alchemy/ingredients/select.rb +19 -0
  105. data/app/models/alchemy/node.rb +28 -1
  106. data/app/models/alchemy/page/page_naming.rb +0 -7
  107. data/app/models/alchemy/page/page_natures.rb +7 -3
  108. data/app/models/alchemy/page/page_scopes.rb +13 -1
  109. data/app/models/alchemy/page/publisher.rb +14 -2
  110. data/app/models/alchemy/page.rb +102 -23
  111. data/app/models/alchemy/page_definition.rb +4 -1
  112. data/app/models/alchemy/page_version.rb +22 -6
  113. data/app/models/alchemy/picture.rb +10 -11
  114. data/app/models/alchemy/picture_variant.rb +1 -3
  115. data/app/models/alchemy/resource.rb +1 -1
  116. data/app/models/alchemy/storage_adapter/active_storage.rb +14 -2
  117. data/app/models/alchemy/storage_adapter/dragonfly.rb +12 -0
  118. data/app/models/alchemy/storage_adapter.rb +2 -0
  119. data/app/models/concerns/alchemy/picture_thumbnails.rb +4 -4
  120. data/app/models/concerns/alchemy/publishable.rb +54 -0
  121. data/app/serializers/alchemy/page_tree_serializer.rb +11 -31
  122. data/app/services/alchemy/copy_page.rb +17 -0
  123. data/app/services/alchemy/duplicate_element.rb +1 -1
  124. data/app/services/alchemy/page_tree_preloader.rb +105 -0
  125. data/app/services/alchemy/update_checks/alchemy_app.rb +1 -1
  126. data/app/stylesheets/alchemy/_extends.scss +3 -9
  127. data/app/stylesheets/alchemy/_mixins.scss +3 -1
  128. data/app/stylesheets/alchemy/_themes.scss +19 -10
  129. data/app/stylesheets/alchemy/admin/archive.scss +1 -0
  130. data/app/stylesheets/alchemy/admin/base.scss +5 -2
  131. data/app/stylesheets/alchemy/admin/buttons.scss +3 -3
  132. data/app/stylesheets/alchemy/admin/element-select.scss +18 -0
  133. data/app/stylesheets/alchemy/admin/elements.scss +123 -23
  134. data/app/stylesheets/alchemy/admin/errors.scss +1 -1
  135. data/app/stylesheets/alchemy/admin/flash.scss +6 -4
  136. data/app/stylesheets/alchemy/admin/images.scss +9 -5
  137. data/app/stylesheets/alchemy/admin/list_filter.scss +4 -4
  138. data/app/stylesheets/alchemy/admin/navigation.scss +1 -1
  139. data/app/stylesheets/alchemy/admin/notices.scss +1 -2
  140. data/app/stylesheets/alchemy/admin/selects.scss +36 -21
  141. data/app/stylesheets/alchemy/admin/shoelace.scss +14 -1
  142. data/app/stylesheets/alchemy/admin/sitemap.scss +11 -3
  143. data/app/stylesheets/alchemy/admin/tags.scss +3 -1
  144. data/app/stylesheets/alchemy/admin/toolbar.scss +1 -1
  145. data/app/views/alchemy/_edit_mode.html.erb +1 -1
  146. data/app/views/alchemy/_menubar.html.erb +1 -1
  147. data/app/views/alchemy/admin/attachments/_archive_overlay.html.erb +35 -31
  148. data/app/views/alchemy/admin/attachments/_library_sidebar.html.erb +6 -0
  149. data/app/views/alchemy/admin/attachments/_overlay_file_list.html.erb +1 -1
  150. data/app/views/alchemy/admin/attachments/_replace_button.html.erb +1 -8
  151. data/app/views/alchemy/admin/attachments/_sorting_select.html.erb +13 -0
  152. data/app/views/alchemy/admin/attachments/_tag_list.html.erb +2 -3
  153. data/app/views/alchemy/admin/attachments/index.html.erb +5 -11
  154. data/app/views/alchemy/admin/attachments/show.html.erb +1 -1
  155. data/app/views/alchemy/admin/clipboard/_button.html.erb +1 -0
  156. data/app/views/alchemy/admin/clipboard/index.html.erb +4 -5
  157. data/app/views/alchemy/admin/clipboard/insert.turbo_stream.erb +1 -1
  158. data/app/views/alchemy/admin/crop.html.erb +5 -7
  159. data/app/views/alchemy/admin/dashboard/widgets/_locked_pages.html.erb +1 -1
  160. data/app/views/alchemy/admin/elements/_add_nested_element_form.html.erb +6 -6
  161. data/app/views/alchemy/admin/elements/_fixed_element.html.erb +1 -1
  162. data/app/views/alchemy/admin/elements/_footer.html.erb +7 -1
  163. data/app/views/alchemy/admin/elements/_header.html.erb +5 -5
  164. data/app/views/alchemy/admin/elements/_toolbar.html.erb +33 -8
  165. data/app/views/alchemy/admin/elements/create.turbo_stream.erb +10 -10
  166. data/app/views/alchemy/admin/elements/index.html.erb +29 -16
  167. data/app/views/alchemy/admin/elements/new.html.erb +2 -2
  168. data/app/views/alchemy/admin/ingredients/update.turbo_stream.erb +3 -5
  169. data/app/views/alchemy/admin/leave.html.erb +1 -1
  170. data/app/views/alchemy/admin/nodes/_node.html.erb +19 -0
  171. data/app/views/alchemy/admin/nodes/edit.html.erb +1 -1
  172. data/app/views/alchemy/admin/nodes/index.html.erb +3 -1
  173. data/app/views/alchemy/admin/nodes/new.html.erb +14 -1
  174. data/app/views/alchemy/admin/pages/_current_page.html.erb +3 -1
  175. data/app/views/alchemy/admin/pages/_form.html.erb +21 -9
  176. data/app/views/alchemy/admin/pages/_page_status.html.erb +1 -1
  177. data/app/views/alchemy/admin/pages/_publication_fields.html.erb +28 -26
  178. data/app/views/alchemy/admin/pages/_table.html.erb +0 -7
  179. data/app/views/alchemy/admin/pages/_toolbar.html.erb +3 -6
  180. data/app/views/alchemy/admin/pages/edit.html.erb +5 -11
  181. data/app/views/alchemy/admin/pages/flush.turbo_stream.erb +2 -0
  182. data/app/views/alchemy/admin/pages/fold.turbo_stream.erb +5 -0
  183. data/app/views/alchemy/admin/pages/index.html.erb +5 -3
  184. data/app/views/alchemy/admin/pages/new.html.erb +2 -12
  185. data/app/views/alchemy/admin/pages/publish.turbo_stream.erb +12 -0
  186. data/app/views/alchemy/admin/pages/tree.html.erb +13 -0
  187. data/app/views/alchemy/admin/pages/update.turbo_stream.erb +5 -16
  188. data/app/views/alchemy/admin/partials/_flash_notices.html.erb +1 -1
  189. data/app/views/alchemy/admin/partials/{_remote_search_form.html.erb → _overlay_search_form.html.erb} +1 -2
  190. data/app/views/alchemy/admin/partials/_paste_from_clipboard_form.html.erb +12 -0
  191. data/app/views/alchemy/admin/pictures/_archive_overlay.html.erb +24 -21
  192. data/app/views/alchemy/admin/pictures/_filter_and_size_bar.html.erb +18 -26
  193. data/app/views/alchemy/admin/pictures/_picture.html.erb +11 -15
  194. data/app/views/alchemy/admin/pictures/_picture_to_assign.html.erb +3 -6
  195. data/app/views/alchemy/admin/pictures/_tag_list.html.erb +2 -3
  196. data/app/views/alchemy/admin/pictures/index.html.erb +0 -1
  197. data/app/views/alchemy/admin/pictures/update.turbo_stream.erb +1 -1
  198. data/app/views/alchemy/admin/resources/_resource_usage_info.html.erb +1 -1
  199. data/app/views/alchemy/admin/resources/_tag_list.html.erb +2 -3
  200. data/app/views/alchemy/admin/styleguide/index.html.erb +25 -20
  201. data/app/views/alchemy/admin/tags/edit.html.erb +1 -1
  202. data/app/views/alchemy/admin/tinymce/_setup.html.erb +2 -2
  203. data/app/views/alchemy/admin/uploader/_button.html.erb +1 -15
  204. data/app/views/alchemy/attachments/show.html.erb +1 -1
  205. data/app/views/alchemy/base/permission_denied.js.erb +1 -1
  206. data/app/views/alchemy/ingredients/shared/_anchor.html.erb +9 -7
  207. data/app/views/alchemy/ingredients/shared/_link_tools.html.erb +12 -5
  208. data/app/views/alchemy/ingredients/shared/_picture_tools.html.erb +10 -11
  209. data/app/views/alchemy/language_links/_spacer.html.erb +1 -1
  210. data/app/views/alchemy/messages_mailer/new.html.erb +1 -1
  211. data/app/views/alchemy/welcome.html.erb +1 -1
  212. data/config/locales/alchemy.en.yml +12 -3
  213. data/config/routes.rb +2 -2
  214. data/db/migrate/20230123112425_add_searchable_to_alchemy_pages.rb +1 -1
  215. data/db/migrate/20230505132743_add_indexes_to_alchemy_pictures.rb +1 -1
  216. data/db/migrate/20231113104432_create_page_mutexes.rb +1 -1
  217. data/db/migrate/20240314105244_create_alchemy_picture_descriptions.rb +1 -1
  218. data/db/migrate/20250626160259_add_unique_index_to_picture_descriptions.rb +1 -1
  219. data/db/migrate/20250905140323_add_created_at_index_to_pictures_and_attachments.rb +1 -1
  220. data/db/migrate/20251106150010_convert_select_value_for_multiple.rb +11 -0
  221. data/db/migrate/20260102121232_add_metadata_to_page_versions.rb +9 -0
  222. data/db/migrate/20260115164704_add_publication_timestamps_to_alchemy_elements.rb +30 -0
  223. data/db/migrate/20260115164705_add_index_to_element_publication_timestamps.rb +13 -0
  224. data/lib/alchemy/ability_helper.rb +1 -3
  225. data/lib/alchemy/auth_accessors.rb +51 -117
  226. data/lib/alchemy/configuration.rb +1 -0
  227. data/lib/alchemy/configurations/main.rb +63 -0
  228. data/lib/alchemy/controller_actions.rb +1 -1
  229. data/lib/alchemy/engine.rb +9 -12
  230. data/lib/alchemy/error_tracking/error_logger.rb +1 -1
  231. data/lib/alchemy/errors.rb +1 -1
  232. data/lib/alchemy/logger.rb +34 -4
  233. data/lib/alchemy/name_conversions.rb +0 -6
  234. data/lib/alchemy/seeder.rb +2 -2
  235. data/lib/alchemy/tasks/usage.rb +4 -4
  236. data/lib/alchemy/test_support/factories/page_version_factory.rb +3 -0
  237. data/lib/alchemy/test_support/having_picture_thumbnails_examples.rb +30 -0
  238. data/lib/alchemy/test_support/shared_ingredient_editor_examples.rb +26 -6
  239. data/lib/alchemy/test_support/shared_publishable_examples.rb +114 -0
  240. data/lib/alchemy/upgrader/eight_one.rb +56 -0
  241. data/lib/alchemy/upgrader.rb +9 -1
  242. data/lib/alchemy/version.rb +1 -1
  243. data/lib/alchemy.rb +1 -4
  244. data/lib/alchemy_cms.rb +0 -1
  245. data/lib/generators/alchemy/elements/templates/view.html.erb +3 -3
  246. data/lib/generators/alchemy/ingredient/ingredient_generator.rb +6 -8
  247. data/lib/generators/alchemy/ingredient/templates/editor_component.rb.tt +22 -0
  248. data/lib/generators/alchemy/page_layouts/templates/layout.html.erb +1 -1
  249. data/lib/generators/alchemy/site_layouts/templates/layout.html.erb +1 -1
  250. data/lib/tasks/alchemy/upgrade.rake +21 -7
  251. data/vendor/javascript/shoelace.min.js +713 -31
  252. data/vendor/javascript/tinymce.min.js +1 -1
  253. metadata +104 -84
  254. data/app/decorators/alchemy/element_editor.rb +0 -90
  255. data/app/helpers/alchemy/admin/pictures_helper.rb +0 -14
  256. data/app/javascript/alchemy_admin/file_editors.js +0 -28
  257. data/app/javascript/alchemy_admin/image_loader.js +0 -54
  258. data/app/javascript/alchemy_admin/page_sorter.js +0 -71
  259. data/app/javascript/alchemy_admin/sitemap.js +0 -154
  260. data/app/javascript/alchemy_admin/templates/page_folder.hbs +0 -3
  261. data/app/views/alchemy/admin/attachments/archive_overlay.js.erb +0 -4
  262. data/app/views/alchemy/admin/pages/_page.html.erb +0 -163
  263. data/app/views/alchemy/admin/pages/_sitemap.html.erb +0 -30
  264. data/app/views/alchemy/admin/pages/flush.js.erb +0 -2
  265. data/app/views/alchemy/admin/pictures/archive_overlay.js.erb +0 -5
  266. data/app/views/alchemy/admin/pictures/index.js.erb +0 -2
  267. data/app/views/alchemy/ingredients/_audio_editor.html.erb +0 -5
  268. data/app/views/alchemy/ingredients/_boolean_editor.html.erb +0 -11
  269. data/app/views/alchemy/ingredients/_datetime_editor.html.erb +0 -20
  270. data/app/views/alchemy/ingredients/_file_editor.html.erb +0 -52
  271. data/app/views/alchemy/ingredients/_headline_editor.html.erb +0 -44
  272. data/app/views/alchemy/ingredients/_html_editor.html.erb +0 -8
  273. data/app/views/alchemy/ingredients/_link_editor.html.erb +0 -30
  274. data/app/views/alchemy/ingredients/_node_editor.html.erb +0 -13
  275. data/app/views/alchemy/ingredients/_number_editor.html.erb +0 -24
  276. data/app/views/alchemy/ingredients/_page_editor.html.erb +0 -13
  277. data/app/views/alchemy/ingredients/_picture_editor.html.erb +0 -59
  278. data/app/views/alchemy/ingredients/_richtext_editor.html.erb +0 -15
  279. data/app/views/alchemy/ingredients/_select_editor.html.erb +0 -31
  280. data/app/views/alchemy/ingredients/_text_editor.html.erb +0 -29
  281. data/app/views/alchemy/ingredients/_video_editor.html.erb +0 -5
  282. data/lib/generators/alchemy/ingredient/templates/editor.html.erb +0 -14
  283. /data/{lib → app/models}/alchemy/permissions.rb +0 -0
@@ -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: 100%;
11
+ width: 100vw;
12
12
  height: var(--top-menu-height);
13
13
  @extend .disable-user-select;
14
14
  }
@@ -64,8 +64,7 @@ alchemy-message {
64
64
  }
65
65
 
66
66
  h1 {
67
- font-size: 1.3rem;
68
- line-height: 1.1;
67
+ font-size: var(--font-size_medium);
69
68
  }
70
69
 
71
70
  h1,
@@ -94,13 +94,6 @@ select {
94
94
  }
95
95
  }
96
96
  }
97
-
98
- .select2-search-choice-close {
99
- position: static;
100
- display: inline-flex;
101
- align-items: center;
102
- justify-content: center;
103
- }
104
97
  }
105
98
 
106
99
  &.medium {
@@ -141,26 +134,17 @@ select {
141
134
  }
142
135
  }
143
136
 
144
- &.select2-container-multi,
145
137
  &.select2-allowclear {
146
138
  .select2-search-choice-close {
139
+ position: static;
140
+ display: inline-flex;
147
141
  left: auto;
148
142
  right: var(--spacing-1);
149
143
  top: 5px;
150
144
  background: none;
151
145
  text-decoration: none;
152
-
153
- &:before {
154
- content: "";
155
- display: inline-flex;
156
- width: 12px;
157
- height: 12px;
158
- background: var(--select-close-icon) no-repeat;
159
- }
160
-
161
- &:hover {
162
- color: var(--icon-color);
163
- }
146
+ align-items: center;
147
+ justify-content: center;
164
148
  }
165
149
  }
166
150
 
@@ -175,12 +159,30 @@ select {
175
159
  }
176
160
  }
177
161
 
162
+ &.select2-container-disabled {
163
+ .select2-choices {
164
+ background-color: var(--select-disabled-background-color);
165
+ border-color: var(--select-disabled-border-color);
166
+ cursor: not-allowed;
167
+ color: var(--select-disabled-text-color);
168
+ }
169
+ }
170
+
171
+ .select2-search-choice-close {
172
+ position: absolute;
173
+ left: initial;
174
+ right: var(--spacing-1);
175
+ }
176
+
178
177
  .select2-choices {
179
178
  @extend %default-input-style;
180
179
  padding: 0 var(--spacing-0);
181
180
  width: 100%;
182
181
 
183
182
  .select2-search-choice {
183
+ display: flex;
184
+ align-items: center;
185
+ gap: var(--spacing-0);
184
186
  margin: var(--spacing-1);
185
187
  padding: var(--spacing-1) var(--spacing-6) var(--spacing-1)
186
188
  var(--spacing-2);
@@ -211,6 +213,20 @@ select {
211
213
  .select2-default {
212
214
  color: var(--text-color-muted) !important;
213
215
  }
216
+
217
+ .select2-search-choice-close {
218
+ &:before {
219
+ content: "";
220
+ display: inline-flex;
221
+ width: 12px;
222
+ height: 12px;
223
+ background: var(--select-close-icon) no-repeat;
224
+ }
225
+
226
+ &:hover {
227
+ color: var(--icon-color);
228
+ }
229
+ }
214
230
  }
215
231
 
216
232
  .select2-drop {
@@ -326,7 +342,6 @@ select {
326
342
  only screen and (min-resolution: 2dppx) {
327
343
  #alchemy {
328
344
  .select2-search input,
329
- .select2-search-choice-close,
330
345
  .select2-container .select2-choice abbr,
331
346
  .select2-container .select2-choice .select2-arrow b {
332
347
  background-image: none !important;
@@ -89,7 +89,7 @@
89
89
 
90
90
  --sl-transition-x-slow: 1000ms;
91
91
  --sl-transition-slow: 500ms;
92
- --sl-transition-medium: 250ms;
92
+ --sl-transition-medium: var(--transition-duration);
93
93
  --sl-transition-fast: 150ms;
94
94
  --sl-transition-x-fast: 50ms;
95
95
 
@@ -309,6 +309,19 @@ sl-tooltip {
309
309
  }
310
310
  }
311
311
 
312
+ sl-button {
313
+ &::part(base),
314
+ &::part(prefix),
315
+ &::part(spinner),
316
+ &::part(label) {
317
+ transition-property: background-color, border-color, color, fill;
318
+ transition-duration: var(--sl-transition-medium);
319
+ }
320
+ &[disabled]::part(base) {
321
+ border-color: var(--button-disabled-border-color);
322
+ }
323
+ }
324
+
312
325
  sl-dialog {
313
326
  &::part(panel) {
314
327
  background-color: var(--dialog-background-color);
@@ -58,11 +58,18 @@
58
58
  }
59
59
  }
60
60
 
61
- #sitemap-wrapper {
61
+ alchemy-sitemap {
62
+ display: block;
62
63
  position: relative;
63
64
  min-height: calc(100vh - 148px);
64
65
  }
65
66
 
67
+ #alchemy_pages_tree {
68
+ display: block;
69
+ height: calc(100vh - var(--top-menu-height) - var(--spacing-3));
70
+ position: relative;
71
+ }
72
+
66
73
  #sitemap {
67
74
  padding: 0 0 104px 0;
68
75
 
@@ -221,10 +228,11 @@
221
228
  }
222
229
 
223
230
  .sitemap_tool {
231
+ display: inline-flex;
232
+ align-items: center;
233
+ justify-content: center;
224
234
  width: var(--spacing-8);
225
235
  height: var(--spacing-8);
226
- line-height: var(--sitemap-line-height);
227
- text-align: center;
228
236
  margin: 0;
229
237
 
230
238
  &.disabled .icon {
@@ -3,9 +3,10 @@
3
3
  .tag-list {
4
4
  display: flex;
5
5
  flex-direction: column;
6
+ margin-top: var(--spacing-3);
6
7
  margin-bottom: var(--spacing-2);
7
8
 
8
- label {
9
+ > label {
9
10
  display: block;
10
11
  font-weight: bold;
11
12
  font-size: var(--font-size_medium);
@@ -83,6 +84,7 @@
83
84
  #tags_tag_list {
84
85
  alchemy-list-filter {
85
86
  margin-top: 0;
87
+ margin-bottom: var(--spacing-0);
86
88
  }
87
89
 
88
90
  ul.tags {
@@ -75,7 +75,7 @@
75
75
  height: 29px;
76
76
  border-right-style: solid;
77
77
  border-right-width: 1px;
78
- border-right-color: var(--border-color);
78
+ border-right-color: var(--toolbar-spacer-color);
79
79
  margin-right: var(--spacing-1);
80
80
  margin-left: var(--spacing-1);
81
81
  }
@@ -1,2 +1,2 @@
1
1
  <%= render 'alchemy/menubar' %>
2
- <%= render "alchemy/preview_mode_code" %>
2
+ <%= render "alchemy/preview_mode_code" %>
@@ -97,7 +97,7 @@
97
97
  </svg>
98
98
  <%= Alchemy.t(:edit_page) %>
99
99
  <% end %>
100
- <%= form_tag Alchemy.logout_path, method: Alchemy.logout_method do %>
100
+ <%= form_tag Alchemy.config.logout_path, method: Alchemy.config.logout_method do %>
101
101
  <%= button_tag class: "button" do %>
102
102
  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16" fill="currentColor">
103
103
  <path d="M5 22C4.44772 22 4 21.5523 4 21V3C4 2.44772 4.44772 2 5 2H19C19.5523 2 20 2.44772 20 3V6H18V4H6V20H18V18H20V21C20 21.5523 19.5523 22 19 22H5ZM18 16V13H11V11H18V8L23 12L18 16Z"></path>
@@ -1,35 +1,39 @@
1
- <div id="overlay_toolbar">
2
- <div class="toolbar_buttons">
3
- <% if can? :create, Alchemy::Attachment %>
4
- <div class="toolbar_button">
5
- <%= render 'alchemy/admin/uploader/button',
6
- object: Alchemy::Attachment.new,
7
- dropzone: '#assign_file_list',
8
- file_attribute: 'file',
9
- in_dialog: true,
10
- accept: Array(search_filter_params[:only]).map { |extension|
11
- Marcel::MimeType.for(extension:)
12
- }.join(",").presence,
13
- redirect_url: admin_attachments_path(
14
- form_field_id: @form_field_id
15
- ) %>
16
- </div>
17
- <% end %>
1
+ <%= turbo_frame_tag "archive_overlay" do %>
2
+ <div id="overlay_toolbar">
3
+ <div class="toolbar_buttons">
4
+ <% if can? :create, Alchemy::Attachment %>
5
+ <div class="toolbar_button">
6
+ <%= render 'alchemy/admin/uploader/button',
7
+ object: Alchemy::Attachment.new,
8
+ dropzone: '#assign_file_list',
9
+ file_attribute: 'file',
10
+ in_dialog: true,
11
+ accept: Array(search_filter_params[:only]).map { |extension|
12
+ Marcel::MimeType.for(extension:)
13
+ }.join(",").presence,
14
+ redirect_url: admin_attachments_path(
15
+ form_field_id: @form_field_id,
16
+ only: search_filter_params[:only],
17
+ except: search_filter_params[:except],
18
+ q: search_filter_params[:q].merge(
19
+ last_upload: true
20
+ )
21
+ ) %>
22
+ </div>
23
+ <% end %>
24
+ </div>
25
+
26
+ <%= render 'alchemy/admin/partials/overlay_search_form' %>
18
27
  </div>
19
- <%= render 'alchemy/admin/partials/remote_search_form' %>
20
- </div>
21
28
 
22
- <div id="assign_file_list" class="with_padding<%= search_filter_params[:tagged_with].present? ? ' filtered' : '' %>">
23
- <div id="library_sidebar">
24
- <%= render 'filter_bar' if resource_has_filters %>
29
+ <div
30
+ id="assign_file_list"
31
+ class="with_padding<%= search_filter_params[:tagged_with].present? ? ' filtered' : '' %>"
32
+ >
33
+ <%= render 'library_sidebar' %>
25
34
 
26
- <% if Alchemy::Attachment.tag_counts.any? %>
27
- <div class="tag-list">
28
- <%= render 'tag_list' %>
29
- </div>
30
- <% end %>
31
- </div>
32
- <div id="overlay_file_list" class="with_tag_list">
33
- <%= render 'overlay_file_list' %>
35
+ <div id="overlay_file_list" class="with_tag_list">
36
+ <%= render 'overlay_file_list' %>
37
+ </div>
34
38
  </div>
35
- </div>
39
+ <% end %>
@@ -0,0 +1,6 @@
1
+ <div id="library_sidebar">
2
+ <%= render "sorting_select" %>
3
+ <%= render "filter_bar" if resource_has_filters %>
4
+
5
+ <div class="tag-list"><%= render "tag_list" %></div>
6
+ </div>
@@ -18,5 +18,5 @@
18
18
  </li>
19
19
  <%= render partial: 'file_to_assign', collection: @attachments %>
20
20
  </ul>
21
- <%= render "alchemy/admin/resources/pagination", resources: @attachments, remote: true, hide_per_page_select: true %>
21
+ <%= render "alchemy/admin/resources/pagination", resources: @attachments, hide_per_page_select: true %>
22
22
  <% end %>
@@ -1,8 +1,7 @@
1
- <% file_upload_id = "file_upload_#{dom_id(object)}" %>
2
1
  <% file_types = Alchemy.config.uploader.allowed_filetypes[object.class.model_name.collection] || ['*'] %>
3
2
  <% accept ||= file_types.to_a == ["*"] ? nil : file_types.map {|type| ".#{type}"}.join(", ") %>
4
3
 
5
- <alchemy-uploader id="<%= file_upload_id %>">
4
+ <alchemy-uploader redirect-url="<%= redirect_url %>">
6
5
  <%= form_for [:admin, object], html: {multipart: true, class: 'upload-button'} do |f| %>
7
6
  <%= f.file_field file_attribute,
8
7
  class: 'fileupload--field', accept: accept,
@@ -13,9 +12,3 @@
13
12
  <% end %>
14
13
  <% end %>
15
14
  </alchemy-uploader>
16
-
17
- <script type="text/javascript">
18
- document.getElementById("<%= file_upload_id %>").addEventListener("Alchemy.upload.successful", (event) => {
19
- Turbo.visit('<%= redirect_url.html_safe %>');
20
- })
21
- </script>
@@ -0,0 +1,13 @@
1
+ <div id="sorting_select">
2
+ <div class="filter-input">
3
+ <alchemy-auto-submit>
4
+ <%= label_tag "q[s]", t(".label") %>
5
+ <%= select_tag "q[s]", options_for_select([
6
+ [t(".by_latest"), "created_at desc"],
7
+ [t(".alphabetical"), "name asc"]
8
+ ], search_filter_params.dig(:q, :s)),
9
+ form: "resource_search",
10
+ class: "full_width" %>
11
+ </alchemy-auto-submit>
12
+ </div>
13
+ </div>
@@ -1,14 +1,13 @@
1
1
  <% if Alchemy::Attachment.tag_counts.any? %>
2
2
  <h3><%= Alchemy.t("Filter by tag") %></h3>
3
- <%= render Alchemy::Admin::ListFilter.new(".tag-list li") %>
3
+ <%= render Alchemy::Admin::ListFilter.new(".tag-list li", placeholder: Alchemy.t("Filter tags")) %>
4
4
  <ul>
5
- <%= render_tag_list('Alchemy::Attachment') %>
5
+ <%= render Alchemy::Admin::TagsList.new('Alchemy::Attachment') %>
6
6
  </ul>
7
7
  <% if search_filter_params[:tagged_with].present? %>
8
8
  <%= link_to(
9
9
  render_icon(:times, size: '1x') + Alchemy.t('Remove tag filter'),
10
10
  url_for(search_filter_params.except(:tagged_with)),
11
- remote: request.xhr?,
12
11
  class: 'secondary button small with_icon'
13
12
  ) %>
14
13
  <% end %>
@@ -3,26 +3,20 @@
3
3
  <% if can? :create, Alchemy::Attachment %>
4
4
  <div class="toolbar_button">
5
5
  <%= render 'alchemy/admin/uploader/button',
6
- redirect_url: alchemy.admin_attachments_path,
6
+ redirect_url: alchemy.admin_attachments_path(q: {
7
+ last_upload: true
8
+ }),
7
9
  object: Alchemy::Attachment.new,
8
10
  file_attribute: 'file' %>
9
11
  </div>
10
12
  <% end %>
11
13
  </div>
14
+
12
15
  <%= render 'alchemy/admin/partials/search_form' %>
13
16
  <% end %>
14
17
 
15
18
  <div id="archive_all" class="with_tag_filter resources-table-wrapper">
16
19
  <%= render 'alchemy/admin/resources/table_header' %>
17
20
  <%= render 'files_list' %>
18
-
19
- <div id="library_sidebar">
20
- <%= render 'filter_bar' if resource_has_filters %>
21
-
22
- <% if Alchemy::Attachment.tag_counts.any? %>
23
- <div class="tag-list with_filter_bar<%= ' filtered' if search_filter_params[:tagged_with].present? %>">
24
- <%= render 'tag_list' %>
25
- </div>
26
- <% end %>
27
- </div>
21
+ <%= render 'library_sidebar' %>
28
22
  </div>
@@ -51,7 +51,7 @@
51
51
  <%= video_tag(@attachment.url, preload: "metadata", controls: true) %>
52
52
  </div>
53
53
  <% when "application/pdf" %>
54
- <iframe src="<%= @attachment.url %>" frameborder="0"></iframe>
54
+ <iframe src="<%= @attachment.url %>" frameborder="0" title="Alchemy.t('File preview')"></iframe>
55
55
  <% end %>
56
56
  <% end %>
57
57
  </div>
@@ -8,5 +8,6 @@
8
8
  size: "400x305"
9
9
  },
10
10
  id: "clipboard_button",
11
+ tooltip_placement: local_assigns.fetch(:tooltip_placement, "top-start"),
11
12
  if_permitted_to: [:index, :alchemy_admin_clipboard]
12
13
  ) %>
@@ -1,18 +1,17 @@
1
1
  <%= turbo_frame_tag :clipboard_items do %>
2
- <% if @clipboard_items.blank? %>
2
+ <% if clipboard_items.blank? %>
3
3
  <%= render_message do %>
4
4
  <%= Alchemy.t('No items in your clipboard') %>
5
5
  <% end %>
6
6
  <% else %>
7
7
  <%= render_message do %>
8
- <%= Alchemy.t('Add items from clipboard via "Add Element" button') %>
8
+ <%= Alchemy.t("Add items from clipboard via \"Add #{remarkable_type.singularize.capitalize}\" button") %>
9
9
  <% end %>
10
-
11
10
  <ul>
12
- <% @clipboard_items.each do |item| %>
11
+ <% clipboard_items.each do |item| %>
13
12
  <% item_class = item.class.name.demodulize.underscore.pluralize %>
14
13
  <li id="clipboard_item_<%= item.id %>" class="<%= item_class %>">
15
- <% if item_class == 'pages' %>
14
+ <% if %[pages nodes].include? item_class %>
16
15
  <%= render_icon(:file) %>
17
16
  <%= truncate(item.name, length: 50) %>
18
17
  <% else %>
@@ -1,6 +1,6 @@
1
1
  <% if @item.class.name == 'Alchemy::Element' && params[:remove] -%>
2
2
  <% if @item.fixed? -%>
3
- <alchemy-action name="removeFixedElement" params="[<%= @item.id %>]" />
3
+ <alchemy-action name="removeFixedElement" params="[<%= @item.id %>]"></alchemy-action>
4
4
  <% else -%>
5
5
  <%= turbo_stream.remove "element_#{@item.id}" %>
6
6
  <% end -%>
@@ -1,15 +1,15 @@
1
- <div id="jscropper">
2
1
  <% if @no_image_notice %>
3
2
  <%= render_message :warn do %>
4
3
  <%= @no_image_notice %>
5
4
  <% end %>
6
5
  <% else %>
6
+ <div id="jscropper">
7
7
  <%= render_message do %>
8
8
  <%= simple_format Alchemy.t(:explain_cropping) %>
9
9
  <% end %>
10
- <div class="thumbnail_background">
11
- <%= image_tag @picture.url(flatten: true), id: 'imageToCrop' %>
12
- </div>
10
+ <%= content_tag "alchemy-picture-thumbnail", nil,
11
+ src: @picture.url(flatten: true),
12
+ id: "imageToCrop" %>
13
13
  <form>
14
14
  <%= button_tag Alchemy.t(:apply), type: 'submit' %>
15
15
  <%= button_tag Alchemy.t('Reset Imagemask'), class: 'reset_mask secondary', type: 'reset' %>
@@ -19,11 +19,9 @@
19
19
  <% if @settings %>
20
20
  <script type="module">
21
21
  import ImageCropper from "alchemy_admin/image_cropper";
22
- import ImageLoader from "alchemy_admin/image_loader";
23
22
 
24
- const image = document.getElementById("imageToCrop");
23
+ const image = document.getElementById("imageToCrop")?.querySelector("img");
25
24
 
26
- new ImageLoader(image);
27
25
  new ImageCropper(
28
26
  image,
29
27
  <%= @settings[:default_box].to_json %>,
@@ -37,7 +37,7 @@
37
37
  </td>
38
38
  <td>
39
39
  <% if (current_alchemy_user.id == page.locked_by) || can?(:manage, Alchemy::Current.site) %>
40
- <%= form_tag(alchemy.unlock_admin_page_path(page, :redirect_to => alchemy.admin_dashboard_path)) do %>
40
+ <%= form_tag(alchemy.unlock_admin_page_path(page, :redirect_to => alchemy.admin_dashboard_url)) do %>
41
41
  <button class="icon_button small" title="<%= Alchemy.t(:explain_unlocking) %>">
42
42
  <%= render_icon(:close, size: '1x') %>
43
43
  </button>
@@ -1,25 +1,25 @@
1
1
  <%= content_tag :div, class: 'add-nested-element', data: { element_id: element.id } do %>
2
2
  <% if element.nestable_elements.length == 1 &&
3
3
  (nestable_element = element.nestable_elements.first) &&
4
- Alchemy::Element.all_from_clipboard_for_parent_element(get_clipboard("elements"), element).none?
4
+ Alchemy::Element.all_from_clipboard_for_parent_element(clipboard, element).none?
5
5
  %>
6
6
  <%= turbo_frame_tag("new_nested_element_#{element.id}") do %>
7
7
  <%= form_for [:admin, Alchemy::Element.new(name: nestable_element)], html: { class: 'add-nested-element-form', id: nil } do |f| %>
8
8
  <%= f.hidden_field :name %>
9
9
  <%= f.hidden_field :page_version_id, value: element.page_version_id %>
10
10
  <%= f.hidden_field :parent_element_id, value: element.id %>
11
- <button class="add-nestable-element-button" is="alchemy-button">
11
+ <%= button_tag class: "add-nestable-element-button", is: "alchemy-button", disabled: cannot?(:create, Alchemy::Element) do %>
12
12
  <%= Alchemy.t(:add_nested_element, name: Alchemy.t(nestable_element.to_sym, scope: 'element_names')) %>
13
- </button>
13
+ <% end %>
14
14
  <% end %>
15
15
  <% end %>
16
16
  <% else %>
17
17
  <%= link_to_dialog (nestable_element ? Alchemy.t(:add_nested_element, name: Alchemy.t(nestable_element.to_sym, scope: 'element_names')) : Alchemy.t("New Element")),
18
- alchemy.new_admin_element_path(
18
+ can?(:create, Alchemy::Element) ? alchemy.new_admin_element_path(
19
19
  parent_element_id: element.id,
20
20
  page_version_id: element.page_version_id
21
- ), {
22
- size: "320x125",
21
+ ) : nil, {
22
+ size: "380x125",
23
23
  title: Alchemy.t("New Element")
24
24
  }, class: "button add-nestable-element-button" %>
25
25
  <% end %>
@@ -2,5 +2,5 @@
2
2
  <%= element.display_name %>
3
3
  </sl-tab>
4
4
  <sl-tab-panel id="fixed_element_<%= element.id %>" name="fixed-element-<%= element.id %>" style="--padding: 0" class="scrollable-elements">
5
- <%= render Alchemy::ElementEditor.new(element) %>
5
+ <%= render Alchemy::Admin::ElementEditor.new(element: element) %>
6
6
  </sl-tab-panel>
@@ -5,7 +5,13 @@
5
5
  </p>
6
6
  <% end %>
7
7
 
8
- <button type="submit" form="element_<%= element.id %>_form" is="alchemy-button" data-turbo="false">
8
+ <button
9
+ form="element_<%= element.id %>_form"
10
+ is="alchemy-button"
11
+ data-turbo="false"
12
+ type="submit"
13
+ <%= "disabled" if cannot?(:update, element) %>
14
+ >
9
15
  <%= Alchemy.t(:save) %>
10
16
  </button>
11
17
  </div>
@@ -1,15 +1,15 @@
1
1
  <div class="element-header<%= ' has-hint' if element.has_hint? %>">
2
- <span class="element-handle">
2
+ <span class="element-handle<%= ' draggable' if can?(:order, element) %>">
3
3
  <% if element.definition.blank? %>
4
- <%= hint_with_tooltip Alchemy.t(:element_definition_missing) %>
4
+ <%= hint_with_tooltip Alchemy.t(:element_definition_missing), icon_class: "element-icon" %>
5
5
  <% elsif element.deprecated? %>
6
- <%= hint_with_tooltip element.deprecation_notice %>
6
+ <%= hint_with_tooltip element.deprecation_notice, icon_class: "element-icon" %>
7
7
  <% else %>
8
- <span class="icon element">
8
+ <span class="element-icon">
9
9
  <%= element.definition.icon_file %>
10
10
  </span>
11
- <%= render_icon(:draggable, style: false, fixed_width: false) %>
12
11
  <% end %>
12
+ <%= render_icon(:draggable, style: false, fixed_width: false, class: "handle-icon") %>
13
13
  </span>
14
14
  <span class="element-title">
15
15
  <span class="preview_text_element_name"><%= element.display_name %></span>
@@ -1,34 +1,59 @@
1
1
  <% remarkable_type = "elements" %>
2
2
  <div class="element-toolbar">
3
- <sl-tooltip placement="top-start" content="<%= Alchemy.t(:copy_element) %>">
3
+ <sl-tooltip
4
+ placement="top-start"
5
+ content="<%= Alchemy.t(:copy_element) %>"
6
+ <%= "disabled" if cannot?(:create, element) %>
7
+ >
4
8
  <%= button_to(
5
9
  render_icon("file-copy"),
6
10
  alchemy.insert_admin_clipboard_path(remarkable_type: remarkable_type, remarkable_id: element.id),
7
11
  "data-turbo-method": :post,
8
- class: "icon_button"
12
+ class: "icon_button",
13
+ disabled: cannot?(:create, element)
9
14
  ) %>
10
15
  </sl-tooltip>
11
- <sl-tooltip content="<%= Alchemy.t(:cut_element) %>">
16
+ <sl-tooltip
17
+ content="<%= Alchemy.t(:cut_element) %>"
18
+ <%= "disabled" if cannot?(:create, element) %>
19
+ >
12
20
  <%= button_to(
13
21
  render_icon("scissors-cut"),
14
22
  alchemy.insert_admin_clipboard_path(remarkable_type: remarkable_type, remarkable_id: element.id, remove: true),
15
23
  "data-turbo-method": :post,
16
- class: "icon_button"
24
+ class: "icon_button",
25
+ disabled: cannot?(:create, element)
17
26
  ) %>
18
27
  </sl-tooltip>
19
- <sl-tooltip content="<%= Alchemy.t("Delete element") %>">
28
+ <sl-tooltip
29
+ content="<%= Alchemy.t("Delete element") %>"
30
+ <%= "disabled" if cannot?(:destroy, element) %>
31
+ >
20
32
  <alchemy-delete-element-button
21
33
  href="<%= alchemy.admin_element_path(element) %>"
22
34
  message="<%= Alchemy.t(:confirm_to_delete_element) %>"
23
35
  >
24
- <button type="button" class="icon_button" data-turbo="false">
36
+ <button
37
+ class="icon_button"
38
+ data-turbo="false"
39
+ type="button"
40
+ <%= "disabled" if cannot?(:destroy, element) %>
41
+ >
25
42
  <%= render_icon('delete-bin-2') %>
26
43
  </button>
27
44
  </alchemy-delete-element-button>
28
45
  </sl-tooltip>
29
- <sl-tooltip content="<%= element.public? ? Alchemy.t(:hide_element) : Alchemy.t(:show_element) %>" placement="top-end">
46
+ <sl-tooltip
47
+ content="<%= element.public? ? Alchemy.t(:hide_element) : Alchemy.t(:show_element) %>"
48
+ placement="top-end"
49
+ <%= "disabled" if cannot?(:update, element) %>
50
+ >
30
51
  <alchemy-publish-element-button>
31
- <sl-switch <%= element.public? ? nil : "checked" %> size="small">
52
+ <sl-switch
53
+ size="small"
54
+ <%= "checked" if !element.public? %>
55
+ <%= "disabled" if cannot?(:update, element) %>
56
+ >
32
57
  <%= t(".hide") %>
33
58
  </sl-switch>
34
59
  </alchemy-publish-element-button>