alchemy_cms 7.4.6 → 8.0.0.a

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.

Potentially problematic release.


This version of alchemy_cms might be problematic. Click here for more details.

Files changed (349) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +86 -0
  3. data/Gemfile +13 -6
  4. data/README.md +13 -5
  5. data/alchemy_cms.gemspec +14 -5
  6. data/app/assets/builds/alchemy/admin/page-select.css +1 -1
  7. data/app/assets/builds/alchemy/admin/print.css +1 -1
  8. data/app/assets/builds/alchemy/admin.css +2 -2
  9. data/app/assets/builds/alchemy/custom-properties.css +1 -1
  10. data/app/assets/builds/alchemy/welcome.css +1 -1
  11. data/app/assets/builds/tinymce/skins/content/alchemy/content.min.css +1 -1
  12. data/app/assets/builds/tinymce/skins/ui/alchemy/content.min.css +1 -0
  13. data/app/assets/builds/tinymce/skins/ui/alchemy/skin.min.css +1 -1
  14. data/app/assets/config/alchemy_manifest.js +0 -2
  15. data/app/assets/images/alchemy/icons-sprite.svg +1 -0
  16. data/app/components/alchemy/admin/resource/applied_filter.rb +29 -0
  17. data/app/components/alchemy/admin/resource/checkbox_filter.rb +36 -0
  18. data/app/components/alchemy/admin/resource/datepicker_filter.rb +42 -0
  19. data/app/components/alchemy/admin/resource/select_filter.rb +43 -0
  20. data/app/components/alchemy/admin/toolbar_button.rb +5 -2
  21. data/app/components/alchemy/ingredients/number_view.rb +18 -0
  22. data/app/controllers/alchemy/admin/attachments_controller.rb +8 -15
  23. data/app/controllers/alchemy/admin/clipboard_controller.rb +2 -6
  24. data/app/controllers/alchemy/admin/elements_controller.rb +1 -1
  25. data/app/controllers/alchemy/admin/languages_controller.rb +1 -1
  26. data/app/controllers/alchemy/admin/pages_controller.rb +15 -15
  27. data/app/controllers/alchemy/admin/pictures_controller.rb +9 -5
  28. data/app/controllers/alchemy/admin/resources_controller.rb +16 -106
  29. data/app/controllers/alchemy/attachments_controller.rb +43 -14
  30. data/app/controllers/alchemy/messages_controller.rb +1 -1
  31. data/app/controllers/alchemy/pages_controller.rb +7 -2
  32. data/app/controllers/concerns/alchemy/admin/resource_filter.rb +92 -0
  33. data/app/decorators/alchemy/element_editor.rb +5 -48
  34. data/app/decorators/alchemy/ingredient_editor.rb +3 -53
  35. data/app/helpers/alchemy/admin/base_helper.rb +14 -84
  36. data/app/helpers/alchemy/admin/elements_helper.rb +4 -4
  37. data/app/helpers/alchemy/admin/pages_helper.rb +1 -1
  38. data/app/helpers/alchemy/base_helper.rb +0 -30
  39. data/app/helpers/alchemy/elements_block_helper.rb +0 -14
  40. data/app/helpers/alchemy/pages_helper.rb +1 -1
  41. data/{lib → app/helpers}/alchemy/resources_helper.rb +5 -45
  42. data/app/javascript/alchemy_admin/components/action.js +2 -0
  43. data/app/javascript/alchemy_admin/components/alchemy_html_element.js +3 -3
  44. data/app/javascript/alchemy_admin/components/datepicker.js +10 -2
  45. data/app/javascript/alchemy_admin/components/element_editor/delete_element_button.js +7 -7
  46. data/app/javascript/alchemy_admin/components/element_editor.js +1 -1
  47. data/app/javascript/alchemy_admin/components/index.js +1 -0
  48. data/app/javascript/alchemy_admin/components/remote_select.js +4 -1
  49. data/app/javascript/alchemy_admin/components/tags_autocomplete.js +5 -1
  50. data/app/javascript/alchemy_admin/components/tinymce.js +4 -2
  51. data/app/javascript/alchemy_admin/components/update_check.js +42 -0
  52. data/app/javascript/alchemy_admin/components/uploader/file_upload.js +15 -8
  53. data/app/javascript/alchemy_admin/components/uploader/progress.js +12 -6
  54. data/app/javascript/alchemy_admin/components/uploader.js +4 -2
  55. data/app/javascript/alchemy_admin/confirm_dialog.js +27 -57
  56. data/app/javascript/alchemy_admin/dirty.js +3 -2
  57. data/app/javascript/alchemy_admin/i18n.js +15 -16
  58. data/app/javascript/alchemy_admin/initializer.js +1 -49
  59. data/app/javascript/alchemy_admin/utils/ajax.js +51 -44
  60. data/app/javascript/alchemy_admin.js +3 -8
  61. data/app/models/alchemy/admin/filters/base.rb +38 -0
  62. data/app/models/alchemy/admin/filters/checkbox.rb +24 -0
  63. data/app/models/alchemy/admin/filters/datepicker.rb +53 -0
  64. data/app/models/alchemy/admin/filters/select.rb +70 -0
  65. data/app/models/alchemy/admin/resource_name.rb +27 -0
  66. data/app/models/alchemy/attachment.rb +51 -34
  67. data/app/models/alchemy/base_record.rb +2 -0
  68. data/app/models/alchemy/element/definitions.rb +1 -1
  69. data/app/models/alchemy/element/element_ingredients.rb +6 -6
  70. data/app/models/alchemy/element/presenters.rb +3 -12
  71. data/app/models/alchemy/element.rb +9 -27
  72. data/app/models/alchemy/element_definition.rb +160 -0
  73. data/app/models/alchemy/ingredient.rb +10 -43
  74. data/app/models/alchemy/ingredient_definition.rb +134 -0
  75. data/app/models/alchemy/ingredient_validator.rb +7 -3
  76. data/app/models/alchemy/ingredients/number.rb +19 -0
  77. data/app/models/alchemy/language.rb +0 -14
  78. data/app/models/alchemy/message.rb +3 -7
  79. data/app/models/alchemy/node.rb +1 -1
  80. data/app/models/alchemy/page/{page_layouts.rb → definitions.rb} +12 -19
  81. data/app/models/alchemy/page/fixed_attributes.rb +1 -1
  82. data/app/models/alchemy/page/page_elements.rb +13 -14
  83. data/app/models/alchemy/page/page_natures.rb +7 -7
  84. data/app/models/alchemy/page/page_scopes.rb +1 -1
  85. data/app/models/alchemy/page.rb +11 -33
  86. data/app/models/alchemy/page_definition.rb +115 -0
  87. data/app/models/alchemy/picture.rb +69 -79
  88. data/app/models/alchemy/picture_variant.rb +115 -5
  89. data/{lib → app/models}/alchemy/resource.rb +4 -18
  90. data/{lib → app/models}/alchemy/searchable_resource.rb +15 -0
  91. data/app/models/alchemy/site/layout.rb +5 -5
  92. data/app/models/alchemy/site.rb +0 -15
  93. data/app/models/alchemy/storage_adapter/active_storage/attachment_url.rb +41 -0
  94. data/app/models/alchemy/storage_adapter/active_storage/picture_url.rb +55 -0
  95. data/app/models/alchemy/storage_adapter/active_storage/preprocessor.rb +40 -0
  96. data/app/models/alchemy/storage_adapter/active_storage.rb +173 -0
  97. data/app/models/alchemy/{attachment/url.rb → storage_adapter/dragonfly/attachment_url.rb} +12 -12
  98. data/app/models/alchemy/{picture/url.rb → storage_adapter/dragonfly/picture_url.rb} +28 -12
  99. data/app/models/alchemy/{picture → storage_adapter/dragonfly}/preprocessor.rb +4 -4
  100. data/app/models/alchemy/storage_adapter/dragonfly.rb +183 -0
  101. data/app/models/alchemy/storage_adapter.rb +74 -0
  102. data/app/models/concerns/alchemy/picture_thumbnails.rb +19 -6
  103. data/app/serializers/alchemy/element_serializer.rb +0 -1
  104. data/app/services/alchemy/dragonfly_to_image_processing.rb +100 -0
  105. data/app/stylesheets/alchemy/_defaults.scss +3 -0
  106. data/app/stylesheets/alchemy/_extends.scss +69 -0
  107. data/app/{assets/stylesheets → stylesheets}/alchemy/_mixins.scss +36 -49
  108. data/app/stylesheets/alchemy/_variables.scss +5 -0
  109. data/app/{assets/stylesheets → stylesheets}/alchemy/admin/archive.scss +20 -37
  110. data/app/{assets/stylesheets → stylesheets}/alchemy/admin/base.scss +16 -14
  111. data/app/stylesheets/alchemy/admin/buttons.scss +160 -0
  112. data/app/{assets/stylesheets → stylesheets}/alchemy/admin/clipboard.scss +2 -2
  113. data/app/{assets/stylesheets → stylesheets}/alchemy/admin/dashboard.scss +13 -16
  114. data/app/{assets/stylesheets → stylesheets}/alchemy/admin/dialogs.scss +23 -16
  115. data/app/{assets/stylesheets → stylesheets}/alchemy/admin/elements.scss +150 -105
  116. data/app/{assets/stylesheets → stylesheets}/alchemy/admin/errors.scss +5 -5
  117. data/app/stylesheets/alchemy/admin/filters.scss +58 -0
  118. data/app/{assets/stylesheets → stylesheets}/alchemy/admin/flatpickr.scss +53 -60
  119. data/app/{assets/stylesheets → stylesheets}/alchemy/admin/form_fields.scss +21 -7
  120. data/app/{assets/stylesheets → stylesheets}/alchemy/admin/forms.scss +31 -19
  121. data/app/{assets/stylesheets → stylesheets}/alchemy/admin/frame.scss +20 -16
  122. data/app/stylesheets/alchemy/admin/hints.scss +5 -0
  123. data/app/{assets/stylesheets → stylesheets}/alchemy/admin/icons.scss +10 -1
  124. data/app/{assets/stylesheets → stylesheets}/alchemy/admin/image_library.scss +10 -8
  125. data/app/{assets/stylesheets → stylesheets}/alchemy/admin/images.scss +1 -1
  126. data/app/stylesheets/alchemy/admin/labels.scss +5 -0
  127. data/app/{assets/stylesheets → stylesheets}/alchemy/admin/lists.scss +3 -3
  128. data/app/{assets/stylesheets → stylesheets}/alchemy/admin/navigation.scss +61 -55
  129. data/app/{assets/stylesheets → stylesheets}/alchemy/admin/nodes.scss +21 -18
  130. data/app/{assets/stylesheets → stylesheets}/alchemy/admin/notices.scss +18 -18
  131. data/app/{assets/stylesheets → stylesheets}/alchemy/admin/page-select.scss +2 -2
  132. data/app/stylesheets/alchemy/admin/pagination.scss +144 -0
  133. data/app/{assets/stylesheets → stylesheets}/alchemy/admin/preview_window.scss +8 -6
  134. data/app/{assets/stylesheets → stylesheets}/alchemy/admin/print.scss +1 -1
  135. data/app/{assets/stylesheets → stylesheets}/alchemy/admin/resource_info.scss +8 -5
  136. data/app/{assets/stylesheets → stylesheets}/alchemy/admin/search.scss +9 -6
  137. data/app/{assets/stylesheets → stylesheets}/alchemy/admin/selects.scss +49 -37
  138. data/app/{assets/stylesheets → stylesheets}/alchemy/admin/shoelace.scss +5 -6
  139. data/app/{assets/stylesheets → stylesheets}/alchemy/admin/sitemap.scss +38 -33
  140. data/app/{assets/stylesheets → stylesheets}/alchemy/admin/tables.scss +6 -4
  141. data/app/{assets/stylesheets → stylesheets}/alchemy/admin/tags.scss +6 -4
  142. data/app/{assets/stylesheets → stylesheets}/alchemy/admin/toolbar.scss +12 -6
  143. data/app/{assets/stylesheets → stylesheets}/alchemy/admin/typography.scss +2 -2
  144. data/app/{assets/stylesheets → stylesheets}/alchemy/admin/upload.scss +7 -5
  145. data/app/stylesheets/alchemy/admin.scss +44 -0
  146. data/app/stylesheets/alchemy/custom-properties.css +244 -0
  147. data/app/stylesheets/alchemy/welcome.scss +75 -0
  148. data/app/{assets/stylesheets → stylesheets}/tinymce/skins/content/alchemy/content.scss +8 -9
  149. data/app/stylesheets/tinymce/skins/ui/alchemy/content.scss +1 -0
  150. data/app/{assets/stylesheets → stylesheets}/tinymce/skins/ui/alchemy/skin.scss +133 -136
  151. data/app/views/alchemy/admin/attachments/_files_list.html.erb +2 -2
  152. data/app/views/alchemy/admin/attachments/_overlay_file_list.html.erb +1 -1
  153. data/app/views/alchemy/admin/{elements/_clipboard_button.html.erb → clipboard/_button.html.erb} +3 -5
  154. data/app/views/alchemy/admin/clipboard/_update_nested_element_button.turbo_stream.erb +11 -0
  155. data/app/views/alchemy/admin/clipboard/clear.turbo_stream.erb +4 -0
  156. data/app/views/alchemy/admin/clipboard/index.html.erb +15 -13
  157. data/app/views/alchemy/admin/clipboard/insert.turbo_stream.erb +18 -0
  158. data/app/views/alchemy/admin/clipboard/remove.turbo_stream.erb +9 -0
  159. data/app/views/alchemy/admin/dashboard/info.html.erb +17 -31
  160. data/app/views/alchemy/admin/elements/_element.html.erb +4 -8
  161. data/app/views/alchemy/admin/elements/_form.html.erb +1 -1
  162. data/app/views/alchemy/admin/elements/_header.html.erb +1 -0
  163. data/app/views/alchemy/admin/elements/_toolbar.html.erb +4 -6
  164. data/app/views/alchemy/admin/elements/create.turbo_stream.erb +2 -1
  165. data/app/views/alchemy/admin/elements/index.html.erb +2 -2
  166. data/app/views/alchemy/admin/ingredients/_file_fields.html.erb +3 -16
  167. data/app/views/alchemy/admin/ingredients/_picture_fields.html.erb +0 -9
  168. data/app/views/alchemy/admin/languages/_form.html.erb +1 -1
  169. data/app/views/alchemy/admin/languages/_table.html.erb +1 -1
  170. data/app/views/alchemy/admin/languages/index.html.erb +5 -2
  171. data/app/views/alchemy/admin/layoutpages/index.html.erb +1 -12
  172. data/app/views/alchemy/admin/pages/_form.html.erb +2 -2
  173. data/app/views/alchemy/admin/pages/_page.html.erb +2 -3
  174. data/app/views/alchemy/admin/pages/_toolbar.html.erb +1 -15
  175. data/app/views/alchemy/admin/pages/index.html.erb +1 -1
  176. data/app/views/alchemy/admin/partials/_remote_search_form.html.erb +9 -12
  177. data/app/views/alchemy/admin/partials/_search_form.html.erb +4 -9
  178. data/app/views/alchemy/admin/pictures/_archive.html.erb +4 -7
  179. data/app/views/alchemy/admin/pictures/_archive_overlay.html.erb +2 -1
  180. data/app/views/alchemy/admin/pictures/_filter_and_size_bar.html.erb +1 -1
  181. data/app/views/alchemy/admin/pictures/index.html.erb +2 -7
  182. data/app/views/alchemy/admin/resources/_applied_filters.html.erb +8 -0
  183. data/app/views/alchemy/admin/resources/_filter_bar.html.erb +11 -21
  184. data/app/views/alchemy/admin/resources/_pagination.html.erb +6 -0
  185. data/app/views/alchemy/admin/resources/_per_page_select.html.erb +4 -2
  186. data/app/views/alchemy/admin/resources/_resource_table.html.erb +1 -1
  187. data/app/views/alchemy/admin/resources/_table_header.html.erb +1 -15
  188. data/app/views/alchemy/admin/sites/index.html.erb +5 -1
  189. data/app/views/alchemy/admin/styleguide/index.html.erb +8 -0
  190. data/app/views/alchemy/admin/tags/index.html.erb +1 -1
  191. data/app/views/alchemy/admin/tinymce/_setup.html.erb +7 -7
  192. data/app/{javascript/alchemy_admin/locales/en.js → views/alchemy/admin/translations/_en.js} +5 -2
  193. data/app/views/alchemy/admin/uploader/_button.html.erb +1 -1
  194. data/app/views/alchemy/admin/uploader/_setup.html.erb +4 -4
  195. data/app/views/alchemy/base/redirect.js.erb +1 -1
  196. data/app/views/alchemy/ingredients/_number_editor.html.erb +24 -0
  197. data/app/views/alchemy/no_index.html.erb +31 -0
  198. data/app/views/alchemy/welcome.html.erb +12 -10
  199. data/app/views/kaminari/alchemy/_first_page.html.erb +5 -3
  200. data/app/views/kaminari/alchemy/_last_page.html.erb +5 -3
  201. data/app/views/kaminari/alchemy/_next_page.html.erb +5 -3
  202. data/app/views/kaminari/alchemy/_paginator.html.erb +18 -13
  203. data/app/views/kaminari/alchemy/_prev_page.html.erb +5 -3
  204. data/app/views/layouts/alchemy/admin.html.erb +5 -9
  205. data/bun.lockb +0 -0
  206. data/bundles/remixicon.mjs +153 -0
  207. data/config/alchemy/config.yml +3 -2
  208. data/config/initializers/dragonfly.rb +0 -1
  209. data/config/initializers/mime_types.rb +1 -0
  210. data/config/locales/alchemy.en.yml +32 -14
  211. data/config/routes.rb +0 -2
  212. data/eslint.config.js +2 -1
  213. data/lib/alchemy/admin/preview_url.rb +4 -5
  214. data/lib/alchemy/cache_digests/template_tracker.rb +6 -9
  215. data/lib/alchemy/config_missing.rb +14 -0
  216. data/lib/alchemy/configuration/base_option.rb +24 -0
  217. data/lib/alchemy/configuration/boolean_option.rb +16 -0
  218. data/lib/alchemy/configuration/class_option.rb +15 -0
  219. data/lib/alchemy/configuration/class_set_option.rb +46 -0
  220. data/lib/alchemy/configuration/integer_list_option.rb +13 -0
  221. data/lib/alchemy/configuration/integer_option.rb +12 -0
  222. data/lib/alchemy/configuration/list_option.rb +22 -0
  223. data/lib/alchemy/configuration/regexp_option.rb +11 -0
  224. data/lib/alchemy/configuration/string_list_option.rb +13 -0
  225. data/lib/alchemy/configuration/string_option.rb +11 -0
  226. data/lib/alchemy/configuration.rb +115 -0
  227. data/lib/alchemy/configuration_methods.rb +3 -1
  228. data/lib/alchemy/configurations/default_language.rb +12 -0
  229. data/lib/alchemy/configurations/default_site.rb +10 -0
  230. data/lib/alchemy/configurations/format_matchers.rb +11 -0
  231. data/lib/alchemy/configurations/mailer.rb +16 -0
  232. data/lib/alchemy/configurations/main.rb +216 -0
  233. data/lib/alchemy/configurations/preview.rb +32 -0
  234. data/lib/alchemy/configurations/sitemap.rb +10 -0
  235. data/lib/alchemy/configurations/uploader.rb +34 -0
  236. data/lib/alchemy/engine.rb +65 -17
  237. data/lib/alchemy/hints.rb +3 -7
  238. data/lib/alchemy/on_page_layout.rb +2 -2
  239. data/lib/alchemy/propshaft/tinymce_asset.rb +15 -0
  240. data/lib/alchemy/seeder.rb +2 -2
  241. data/lib/alchemy/tasks/usage.rb +4 -4
  242. data/lib/alchemy/test_support/config_stubbing.rb +1 -7
  243. data/lib/alchemy/test_support/factories/attachment_factory.rb +13 -2
  244. data/lib/alchemy/test_support/factories/language_factory.rb +1 -1
  245. data/lib/alchemy/test_support/factories/page_factory.rb +2 -3
  246. data/lib/alchemy/test_support/factories/picture_factory.rb +30 -2
  247. data/lib/alchemy/test_support/factories/site_factory.rb +2 -2
  248. data/lib/alchemy/test_support/having_crop_action_examples.rb +2 -2
  249. data/lib/alchemy/test_support/having_picture_thumbnails_examples.rb +80 -26
  250. data/lib/alchemy/test_support/shared_ingredient_examples.rb +5 -5
  251. data/lib/alchemy/upgrader/.keep +0 -0
  252. data/lib/alchemy/upgrader/eight_zero.rb +14 -0
  253. data/lib/alchemy/upgrader.rb +33 -20
  254. data/lib/alchemy/version.rb +1 -1
  255. data/lib/alchemy.rb +192 -170
  256. data/lib/alchemy_cms.rb +1 -7
  257. data/lib/generators/alchemy/ingredient/ingredient_generator.rb +0 -3
  258. data/lib/generators/alchemy/install/files/_article.html.erb +6 -4
  259. data/lib/generators/alchemy/install/files/alchemy.en.yml +22 -3
  260. data/lib/generators/alchemy/install/files/application.html.erb +5 -0
  261. data/lib/generators/alchemy/install/install_generator.rb +5 -14
  262. data/lib/generators/alchemy/install/templates/alchemy.rb.tt +196 -0
  263. data/lib/generators/alchemy/install/templates/dragonfly.rb.tt +0 -1
  264. data/lib/generators/alchemy/install/templates/elements.yml.tt +3 -1
  265. data/lib/generators/alchemy/install/templates/menus.yml.tt +1 -1
  266. data/lib/generators/alchemy/install/templates/page_layouts.yml.tt +2 -2
  267. data/lib/generators/alchemy/page_layouts/page_layouts_generator.rb +2 -2
  268. data/lib/tasks/alchemy/assets.rake +14 -0
  269. data/lib/tasks/alchemy/upgrade.rake +12 -47
  270. data/vendor/javascript/tinymce.min.js +1 -1
  271. data/vitest.config.js +21 -0
  272. metadata +181 -180
  273. data/app/assets/builds/alchemy/admin/page-select.css.map +0 -1
  274. data/app/assets/builds/alchemy/admin/print.css.map +0 -1
  275. data/app/assets/builds/alchemy/admin.css.map +0 -1
  276. data/app/assets/builds/alchemy/custom-properties.css.map +0 -1
  277. data/app/assets/builds/alchemy/welcome.css.map +0 -1
  278. data/app/assets/builds/tinymce/skins/content/alchemy/content.min.css.map +0 -1
  279. data/app/assets/builds/tinymce/skins/ui/alchemy/skin.min.css.map +0 -1
  280. data/app/assets/javascripts/alchemy/admin.js +0 -10
  281. data/app/assets/stylesheets/alchemy/_defaults.scss +0 -3
  282. data/app/assets/stylesheets/alchemy/_deprecated_variables.scss +0 -45
  283. data/app/assets/stylesheets/alchemy/_deprecation.scss +0 -17
  284. data/app/assets/stylesheets/alchemy/_extends.scss +0 -62
  285. data/app/assets/stylesheets/alchemy/_variables.scss +0 -201
  286. data/app/assets/stylesheets/alchemy/admin/buttons.scss +0 -124
  287. data/app/assets/stylesheets/alchemy/admin/hints.scss +0 -5
  288. data/app/assets/stylesheets/alchemy/admin/labels.scss +0 -3
  289. data/app/assets/stylesheets/alchemy/admin/pagination.scss +0 -92
  290. data/app/assets/stylesheets/alchemy/admin.scss +0 -42
  291. data/app/assets/stylesheets/alchemy/custom-properties.css +0 -98
  292. data/app/assets/stylesheets/alchemy/welcome.scss +0 -57
  293. data/app/assets/stylesheets/tinymce/skins/ui/alchemy/content.css +0 -711
  294. data/app/assets/stylesheets/tinymce/skins/ui/alchemy/content.inline.css +0 -705
  295. data/app/assets/stylesheets/tinymce/skins/ui/alchemy/content.inline.min.css +0 -7
  296. data/app/assets/stylesheets/tinymce/skins/ui/alchemy/content.min.css +0 -7
  297. data/app/assets/stylesheets/tinymce/skins/ui/alchemy/content.mobile.css +0 -29
  298. data/app/assets/stylesheets/tinymce/skins/ui/alchemy/content.mobile.min.css +0 -7
  299. data/app/assets/stylesheets/tinymce/skins/ui/alchemy/skin.mobile.css +0 -677
  300. data/app/assets/stylesheets/tinymce/skins/ui/alchemy/skin.mobile.min.css +0 -7
  301. data/app/controllers/alchemy/elements_controller.rb +0 -32
  302. data/app/models/alchemy/element/dom_id.rb +0 -31
  303. data/app/models/alchemy/picture/calculations.rb +0 -49
  304. data/app/models/alchemy/picture/transformations.rb +0 -115
  305. data/app/views/alchemy/admin/attachments/destroy.js.erb +0 -1
  306. data/app/views/alchemy/admin/clipboard/clear.js.erb +0 -3
  307. data/app/views/alchemy/admin/clipboard/insert.js.erb +0 -29
  308. data/app/views/alchemy/admin/clipboard/remove.js.erb +0 -10
  309. data/app/views/alchemy/admin/resources/_filter.html.erb +0 -12
  310. data/app/views/alchemy/admin/resources/_resource.html.erb +0 -34
  311. data/app/views/alchemy/admin/resources/_table.html.erb +0 -29
  312. data/app/views/alchemy/elements/show.html.erb +0 -1
  313. data/app/views/alchemy/elements/show.js.erb +0 -1
  314. data/app/views/alchemy/ingredients/_audio_view.html.erb +0 -1
  315. data/app/views/alchemy/ingredients/_boolean_view.html.erb +0 -1
  316. data/app/views/alchemy/ingredients/_datetime_view.html.erb +0 -3
  317. data/app/views/alchemy/ingredients/_file_view.html.erb +0 -4
  318. data/app/views/alchemy/ingredients/_headline_view.html.erb +0 -4
  319. data/app/views/alchemy/ingredients/_html_view.html.erb +0 -1
  320. data/app/views/alchemy/ingredients/_link_view.html.erb +0 -4
  321. data/app/views/alchemy/ingredients/_node_view.html.erb +0 -1
  322. data/app/views/alchemy/ingredients/_page_view.html.erb +0 -1
  323. data/app/views/alchemy/ingredients/_picture_view.html.erb +0 -4
  324. data/app/views/alchemy/ingredients/_richtext_view.html.erb +0 -3
  325. data/app/views/alchemy/ingredients/_select_view.html.erb +0 -1
  326. data/app/views/alchemy/ingredients/_text_view.html.erb +0 -4
  327. data/app/views/alchemy/ingredients/_video_view.html.erb +0 -3
  328. data/babel.config.js +0 -12
  329. data/config/initializers/assets.rb +0 -4
  330. data/lib/alchemy/config.rb +0 -114
  331. data/lib/alchemy/element_definition.rb +0 -73
  332. data/lib/alchemy/page_layout.rb +0 -73
  333. data/lib/alchemy/resource_filter.rb +0 -40
  334. data/lib/alchemy/upgrader/seven_point_four.rb +0 -26
  335. data/lib/alchemy/upgrader/seven_point_three.rb +0 -52
  336. data/lib/generators/alchemy/ingredient/templates/view.html.erb +0 -1
  337. data/lib/generators/alchemy/install/files/alchemy_admin.js +0 -1
  338. data/lib/generators/alchemy/install/files/all.js +0 -11
  339. data/lib/generators/alchemy/install/files/article.css +0 -25
  340. data/vendor/assets/images/remixicon.symbol.svg +0 -11
  341. /data/app/{assets/stylesheets → stylesheets}/alchemy/_fonts.scss +0 -0
  342. /data/app/{assets/stylesheets → stylesheets}/alchemy/admin/attachment-select.scss +0 -0
  343. /data/app/{assets/stylesheets → stylesheets}/alchemy/admin/attachments.scss +0 -0
  344. /data/app/{assets/stylesheets → stylesheets}/alchemy/admin/flash.scss +0 -0
  345. /data/app/{assets/stylesheets → stylesheets}/alchemy/admin/list_filter.scss +0 -0
  346. /data/app/{assets/stylesheets → stylesheets}/alchemy/admin/node-select.scss +0 -0
  347. /data/app/{assets/stylesheets → stylesheets}/alchemy/admin/spinner.scss +0 -0
  348. /data/app/{assets/stylesheets → stylesheets}/tinymce/skins/skintool.json +0 -0
  349. /data/app/{assets/stylesheets → stylesheets}/tinymce/skins/ui/alchemy/fonts/tinymce-mobile.woff +0 -0
@@ -49,7 +49,7 @@
49
49
  <% table.with_action(:download) do |attachment| %>
50
50
  <sl-tooltip content="<%= Alchemy.t("download_file", filename: attachment.file_name) %>">
51
51
  <%= link_to render_icon(:download),
52
- alchemy.download_admin_attachment_path(attachment),
52
+ alchemy.download_attachment_path(attachment),
53
53
  target: "_blank",
54
54
  class: "icon_button" %>
55
55
  </sl-tooltip>
@@ -82,5 +82,5 @@
82
82
  <% end %>
83
83
  <% end %>
84
84
 
85
- <%= paginate @attachments, theme: 'alchemy' %>
85
+ <%= render "alchemy/admin/resources/pagination", resources: @attachments %>
86
86
  <% end %>
@@ -18,5 +18,5 @@
18
18
  </li>
19
19
  <%= render partial: 'file_to_assign', collection: @attachments %>
20
20
  </ul>
21
- <%= paginate @attachments, theme: 'alchemy', remote: true, hide_per_page_select: true %>
21
+ <%= render "alchemy/admin/resources/pagination", resources: @attachments, remote: true, hide_per_page_select: true %>
22
22
  <% end %>
@@ -1,14 +1,12 @@
1
1
  <%= render Alchemy::Admin::ToolbarButton.new(
2
- url: alchemy.admin_clipboard_path(remarkable_type: "elements"),
2
+ url: alchemy.admin_clipboard_path(remarkable_type: remarkable_type),
3
3
  label: Alchemy.t("Show clipboard"),
4
4
  icon: :clipboard,
5
- icon_style: clipboard_empty?("elements") ? "line" : "fill",
5
+ icon_style: clipboard_empty?(remarkable_type) ? "line" : "fill",
6
6
  dialog_options: {
7
7
  title: Alchemy.t("Clipboard"),
8
8
  size: "400x305"
9
9
  },
10
- link_options: {
11
- id: "clipboard_button"
12
- },
10
+ id: "clipboard_button",
13
11
  if_permitted_to: [:index, :alchemy_admin_clipboard]
14
12
  ) %>
@@ -0,0 +1,11 @@
1
+ <%# Update add nested element forms for any elements that accept ONLY this as a nested element %>
2
+ <% if @item.class == Alchemy::Element %>
3
+ <%
4
+ @item.page.draft_version.elements.expanded.select do |element|
5
+ element.nestable_elements == [@item.name]
6
+ end.each do |element|
7
+ %>
8
+ <%= turbo_stream.replace_all ".add-nested-element[data-element-id='#{element.id}']",
9
+ partial: "alchemy/admin/elements/add_nested_element_form", locals: {element: element} %>
10
+ <% end %>
11
+ <% end %>
@@ -0,0 +1,4 @@
1
+ <%= turbo_stream.replace "clipboard_button", partial: "button" %>
2
+ <%= turbo_stream.update "clipboard_items",
3
+ Alchemy::Admin::Message.new(Alchemy.t('No items in your clipboard')).render_in(self) %>
4
+ <%= render "update_nested_element_button" %>
@@ -1,13 +1,13 @@
1
- <% if @clipboard_items.blank? %>
2
- <%= render_message do %>
3
- <%= Alchemy.t('No items in your clipboard') %>
4
- <% end %>
5
- <% else %>
6
- <%= render_message do %>
7
- <%= Alchemy.t('Add items from clipboard via "Add Element" button') %>
8
- <% end %>
1
+ <%= turbo_frame_tag :clipboard_items do %>
2
+ <% if @clipboard_items.blank? %>
3
+ <%= render_message do %>
4
+ <%= Alchemy.t('No items in your clipboard') %>
5
+ <% end %>
6
+ <% else %>
7
+ <%= render_message do %>
8
+ <%= Alchemy.t('Add items from clipboard via "Add Element" button') %>
9
+ <% end %>
9
10
 
10
- <div id="clipboard_items">
11
11
  <ul>
12
12
  <% @clipboard_items.each do |item| %>
13
13
  <% item_class = item.class.name.demodulize.underscore.pluralize %>
@@ -22,18 +22,20 @@
22
22
  <sl-tooltip content="<%= Alchemy.t('Remove item from clipboard') %>">
23
23
  <%= link_to render_icon(:close, size: '1x'),
24
24
  alchemy.remove_admin_clipboard_path(remarkable_type: item_class, remarkable_id: item.id),
25
- remote: true, method: 'delete',
25
+ "data-turbo-method": :delete,
26
26
  class: "icon_button small"
27
27
  %>
28
28
  </sl-tooltip>
29
29
  </li>
30
30
  <% end %>
31
31
  </ul>
32
+
32
33
  <p>
33
- <%= link_to_confirm_dialog Alchemy.t('clear clipboard'),
34
- Alchemy.t('Do you really want to clear the clipboard?'),
34
+ <%= link_to Alchemy.t('clear clipboard'),
35
35
  alchemy.clear_admin_clipboard_path(remarkable_type: params[:remarkable_type]),
36
+ "data-turbo-confirm": Alchemy.t('Do you really want to clear the clipboard?'),
37
+ "data-turbo-method": :delete,
36
38
  class: 'button' %>
37
39
  </p>
38
- </div>
40
+ <% end %>
39
41
  <% end %>
@@ -0,0 +1,18 @@
1
+ <% if @item.class.name == 'Alchemy::Element' && params[:remove] -%>
2
+ <% if @item.fixed? -%>
3
+ <alchemy-action name="removeFixedElement" params="[<%= @item.id %>]" />
4
+ <% else -%>
5
+ <%= turbo_stream.remove "element_#{@item.id}" %>
6
+ <% end -%>
7
+ <alchemy-growl>
8
+ <%= Alchemy.t("item moved to clipboard", name: @item.display_name_with_preview_text) %>
9
+ </alchemy-growl>
10
+ <% else -%>
11
+ <alchemy-growl>
12
+ <%= Alchemy.t("item copied to clipboard", name: @item.class.name == "Alchemy::Element" ? @item.display_name_with_preview_text : @item.name) %>
13
+ </alchemy-growl>
14
+ <% end -%>
15
+
16
+ <%= turbo_stream.replace "clipboard_button", partial: "button" %>
17
+
18
+ <%= render "update_nested_element_button" %>
@@ -0,0 +1,9 @@
1
+ <% if @clipboard.blank? %>
2
+ <%= render template: "alchemy/admin/clipboard/clear" %>
3
+ <% else %>
4
+ <%= turbo_stream.remove "clipboard_item_#{@item.id}" %>
5
+ <%= render "update_nested_element_button" %>
6
+ <alchemy-growl>
7
+ <%= Alchemy.t("item removed from clipboard", name: @item.class.to_s == "Element" ? @item.display_name_with_preview_text : @item.name) %>
8
+ </alchemy-growl>
9
+ <% end %>
@@ -7,38 +7,24 @@
7
7
  Ruby v<%= RUBY_VERSION %>, Rails v<%= Rails.version %>
8
8
  </small>
9
9
  </h2>
10
- <% if can? :update_check, :alchemy_admin_dashboard %>
11
- <p class="center" id="update_check">
12
- <span id="update_available" class="hidden">
13
- <%= render_icon(:exclamation) %>
14
- <%= Alchemy.t 'Update available' %>
15
- </span>
16
- <span id="up_to_date" class="hidden">
17
- <%= render_icon(:check) %>
18
- <%= Alchemy.t 'Alchemy is up to date' %>
19
- </span>
20
- <span id="error" class="hidden">
21
- <%= render_icon(:exclamation) %>
22
- <%= Alchemy.t 'Update status unavailable' %>
23
- </span>
24
- </p>
25
- <script type="module">
26
- var el = $('#update_check');
27
- var spinner = new Alchemy.Spinner('small')
28
- spinner.spin(el[0])
29
- $.get('<%= alchemy.update_check_path %>', function(data, textStatus, jqXHR) {
30
- if (data == 'true') {
31
- $('#update_available').removeClass("hidden")
32
- } else {
33
- $('#up_to_date').removeClass("hidden")
34
- }
35
- }).fail(function(jqXHR, textStatus, errorThrown) {
36
- $('#error').removeClass("hidden")
37
- }).always(function() {
38
- spinner.stop()
39
- })
40
- </script>
10
+
11
+ <% if can?(:update_check, :alchemy_admin_dashboard) %>
12
+ <alchemy-update-check url="<%= alchemy.update_check_path %>">
13
+ <span class="update_available hidden">
14
+ <%= render_icon(:exclamation) %>
15
+ <%= Alchemy.t('Update available') %>
16
+ </span>
17
+ <span class="up_to_date hidden">
18
+ <%= render_icon(:check) %>
19
+ <%= Alchemy.t('Alchemy is up to date') %>
20
+ </span>
21
+ <span class="error hidden">
22
+ <%= render_icon(:exclamation) %>
23
+ <%= Alchemy.t('Update status unavailable') %>
24
+ </span>
25
+ </alchemy-update-check>
41
26
  <% end %>
27
+
42
28
  <%= render_message do %>
43
29
  <p><%= Alchemy.t('Alchemy is open software and itself uses open software and free resources:') %></p>
44
30
  <ul>
@@ -13,15 +13,11 @@
13
13
 
14
14
  <%= render 'alchemy/admin/elements/toolbar', element: element %>
15
15
 
16
- <% if element.has_hint? %>
17
- <%= render_message(:hint, sanitize(element.hint)) %>
18
- <% end %>
19
-
20
- <% element.definition[:message].tap do |message| %>
16
+ <% element.definition.message.tap do |message| %>
21
17
  <%= render_message(:info, sanitize(message)) if message %>
22
18
  <% end %>
23
19
 
24
- <% element.definition[:warning].tap do |warning| %>
20
+ <% element.definition.warning.tap do |warning| %>
25
21
  <%= render_message(:warning, sanitize(warning)) if warning %>
26
22
  <% end %>
27
23
 
@@ -37,10 +33,10 @@
37
33
  <!-- Ingredients -->
38
34
  <% if element.has_ingredients_defined? %>
39
35
  <div class="element-ingredient-editors">
40
- <%= render element.ingredients.select { |i| !i.definition[:group] }, element_form: f %>
36
+ <%= render element.ingredients.select { !_1.definition.group }, element_form: f %>
41
37
 
42
38
  <!-- Each ingredient group -->
43
- <% element.ingredients.select { |i| i.definition[:group] }.group_by { |i| i.definition[:group] }.each do |group, ingredients| %>
39
+ <% element.ingredients.select { _1.definition.group }.group_by { _1.definition.group }.each do |group, ingredients| %>
44
40
  <%= content_tag :details, class: "ingredient-group", id: "element_#{element.id}_ingredient_group_#{group.parameterize.underscore}", is: "alchemy-ingredient-group" do %>
45
41
  <summary>
46
42
  <%= element.translated_group group %>
@@ -13,7 +13,7 @@
13
13
  selected: (@elements.first if @elements.count == 1),
14
14
  input_html: {is: 'alchemy-select', autofocus: true} %>
15
15
  <% if @elements.count == 1 %>
16
- <%= form.hidden_field :name, value: @elements.first[:name] %>
16
+ <%= form.hidden_field :name, value: @elements.first.name %>
17
17
  <% end %>
18
18
  <%= form.hidden_field :parent_element_id, value: @parent_element.try(:id) %>
19
19
  <%= form.submit Alchemy.t(:add) %>
@@ -10,6 +10,7 @@
10
10
  </span>
11
11
  <span class="element-title">
12
12
  <span class="preview_text_element_name"><%= element.display_name %></span>
13
+ <%= render_hint_for(element, size: "1x", fixed_width: false) %>
13
14
  <span class="preview_text_quote">
14
15
  <%= sanitize(element.preview_text.presence || '&nbsp;') %>
15
16
  </span>
@@ -1,20 +1,18 @@
1
1
  <% remarkable_type = "elements" %>
2
2
  <div class="element-toolbar">
3
3
  <sl-tooltip placement="top-start" content="<%= Alchemy.t(:copy_element) %>">
4
- <%= link_to(
4
+ <%= button_to(
5
5
  render_icon("file-copy"),
6
6
  alchemy.insert_admin_clipboard_path(remarkable_type: remarkable_type, remarkable_id: element.id),
7
- remote: true,
8
- method: :post,
7
+ "data-turbo-method": :post,
9
8
  class: "icon_button"
10
9
  ) %>
11
10
  </sl-tooltip>
12
11
  <sl-tooltip content="<%= Alchemy.t(:cut_element) %>">
13
- <%= link_to(
12
+ <%= button_to(
14
13
  render_icon("scissors-cut"),
15
14
  alchemy.insert_admin_clipboard_path(remarkable_type: remarkable_type, remarkable_id: element.id, remove: true),
16
- remote: true,
17
- method: :post,
15
+ "data-turbo-method": :post,
18
16
  class: "icon_button"
19
17
  ) %>
20
18
  </sl-tooltip>
@@ -25,7 +25,8 @@
25
25
  <% end %>
26
26
 
27
27
  <%= turbo_stream.replace "clipboard_button",
28
- partial: "alchemy/admin/elements/clipboard_button" %>
28
+ partial: "alchemy/admin/clipboard/button",
29
+ locals: {remarkable_type: "elements"} %>
29
30
 
30
31
  <alchemy-growl>
31
32
  <%= Alchemy.t(:successfully_added_element) %>
@@ -13,14 +13,14 @@
13
13
  },
14
14
  if_permitted_to: [:create, Alchemy::Element]
15
15
  ) %>
16
- <%= render "alchemy/admin/elements/clipboard_button" %>
16
+ <%= render "alchemy/admin/clipboard/button", remarkable_type: "elements" %>
17
17
  <sl-tooltip content="<%= Alchemy.t("Collapse all elements") %>" placement="top-end" class="right">
18
18
  <button id="collapse-all-elements-button" class="icon_button">
19
19
  <alchemy-icon name="contract-up-down"></alchemy-icon>
20
20
  </button>
21
21
  </sl-tooltip>
22
22
  </div>
23
- <% if @page.element_definitions.any? { |el| el["fixed"] } %>
23
+ <% if @page.element_definitions.any?(&:fixed) %>
24
24
  <sl-tab-group id="fixed-elements">
25
25
  <sl-tab slot="nav" panel="main-content-elements">
26
26
  <%= Alchemy.t(:main_content) %>
@@ -1,18 +1,5 @@
1
- <% css_classes = ingredient.settings[:css_classes] %>
2
-
3
1
  <%= f.input :link_text %>
4
2
  <%= f.input :title %>
5
- <%- if css_classes.present? -%>
6
- <%= f.input :css_class,
7
- collection: css_classes,
8
- include_blank: Alchemy.t('None') %>
9
- <%- else -%>
10
- <% Alchemy::Deprecation.warn %(Float positioning in File ingredients is deprecated. If you rely on them, please use `css_classes` in your "#{ingredient.role}" settings instead.) %>
11
- <%= f.input :css_class,
12
- label: Alchemy.t(:position_in_text),
13
- collection: [
14
- [Alchemy.t(:above), "no_float"],
15
- [Alchemy.t(:left), "left"],
16
- [Alchemy.t(:right), "right"]
17
- ], include_blank: Alchemy.t('Layout default') %>
18
- <%- end -%>
3
+ <%= f.input :css_class,
4
+ collection: ingredient.settings[:css_classes],
5
+ include_blank: Alchemy.t('None') %>
@@ -19,13 +19,4 @@
19
19
  end
20
20
  end %>
21
21
  <%= f.input :css_class, collection: css_classes_collection, include_blank: false %>
22
- <%- else -%>
23
- <% Alchemy::Deprecation.warn %(Float positioning in Picture ingredients is deprecated. If you rely on them, please use `css_classes` in your "#{ingredient.role}" settings instead.) %>
24
- <%= f.input :css_class,
25
- label: Alchemy.t(:position_in_text),
26
- collection: [
27
- [Alchemy.t(:above), "no_float"],
28
- [Alchemy.t(:left), "left"],
29
- [Alchemy.t(:right), "right"]
30
- ], include_blank: Alchemy.t("Layout default") %>
31
22
  <%- end -%>
@@ -12,7 +12,7 @@
12
12
  <% end %>
13
13
  <%= f.input :frontpage_name %>
14
14
  <%= f.input :page_layout,
15
- collection: Alchemy::PageLayout.all,
15
+ collection: Alchemy::PageDefinition.all,
16
16
  label_method: ->(p) { Alchemy::Page.human_layout_name(p['name']) },
17
17
  value_method: ->(p) { p['name'] },
18
18
  input_html: {is: 'alchemy-select'} %>
@@ -15,4 +15,4 @@
15
15
  <% table.edit_button tooltip: Alchemy.t(:edit_language), dialog_size: "430x415" %>
16
16
  <% end %>
17
17
 
18
- <%= paginate @languages, theme: 'alchemy' %>
18
+ <%= render "alchemy/admin/resources/pagination", resources: @languages %>
@@ -31,12 +31,15 @@
31
31
  <%== Alchemy.t('alchemy/language', scope: :no_resource_found) %>
32
32
  <% end %>
33
33
  <%= render 'form', language: Alchemy::Language.new(
34
- Alchemy::Config.get(:default_language).merge(
34
+ name: Alchemy.config.default_language.name,
35
+ code: Alchemy.config.default_language.code,
36
+ page_layout: Alchemy.config.default_language.page_layout,
37
+ frontpage_name: Alchemy.config.default_language.frontpage_name,
35
38
  site: Alchemy::Current.site,
36
39
  default: true,
37
40
  public: true
38
41
  )
39
- ) %>
42
+ %>
40
43
  </div>
41
44
  <% end %>
42
45
  </div>
@@ -15,18 +15,7 @@
15
15
  tooltip_placement: "top-start",
16
16
  if_permitted_to: [:create, Alchemy::Page]
17
17
  ) %>
18
- <%= render Alchemy::Admin::ToolbarButton.new(
19
- icon: clipboard_empty?('pages') ? 'clipboard' : 'paste',
20
- url: alchemy.admin_clipboard_path(remarkable_type: 'pages'),
21
- dialog_options: {
22
- title: Alchemy.t('Clipboard'),
23
- size: '380x270'
24
- },
25
- title: Alchemy.t('Show clipboard'),
26
- link_options: {id: "clipboard_button"},
27
- label: Alchemy.t('Show clipboard'),
28
- if_permitted_to: [:create, Alchemy::Page]
29
- ) %>
18
+ <%= render "alchemy/admin/clipboard/button", remarkable_type: "pages" %>
30
19
  </div>
31
20
  <% end %>
32
21
 
@@ -11,7 +11,7 @@
11
11
  <div class="control_group">
12
12
  <%= render 'alchemy/admin/pages/publication_fields' %>
13
13
  <%= page_status_checkbox(@page, :restricted) %>
14
- <% if configuration(:sitemap)['show_flag'] %>
14
+ <% if Alchemy.config.sitemap.show_flag %>
15
15
  <%= page_status_checkbox(@page, :sitemap) %>
16
16
  <% end %>
17
17
  </div>
@@ -23,7 +23,7 @@
23
23
  <%= f.input :title %>
24
24
  </alchemy-char-counter>
25
25
 
26
- <% if Alchemy.enable_searchable %>
26
+ <% if Alchemy.config.show_page_searchable_checkbox %>
27
27
  <div class="input check_boxes">
28
28
  <label class="control-label"><%= Alchemy.t(:fulltext_search) %></label>
29
29
  <div class="control_group">
@@ -98,14 +98,13 @@
98
98
  {{/if}}
99
99
  {{#if permissions.copy}}
100
100
  <sl-tooltip content="<%= Alchemy.t(:copy_page) %>">
101
- <%= link_to(
101
+ <%= button_to(
102
102
  render_icon("file-copy"),
103
103
  alchemy.insert_admin_clipboard_path(
104
104
  remarkable_type: :pages,
105
105
  remarkable_id: "__ID__",
106
106
  ),
107
- remote: true,
108
- method: :post,
107
+ "data-turbo-method": :post,
109
108
  class: "icon_button"
110
109
  ) %>
111
110
  </sl-tooltip>
@@ -29,21 +29,7 @@
29
29
  </sl-tooltip>
30
30
  </div>
31
31
  <% end %>
32
- <div class="toolbar_button">
33
- <sl-tooltip content="<%= Alchemy.t("Show clipboard") %>">
34
- <%= link_to_dialog(
35
- render_icon(:clipboard, style: clipboard_empty?("pages") ? "line" : "fill"),
36
- alchemy.admin_clipboard_path(remarkable_type: "pages"),
37
- {
38
- title: Alchemy.t("Clipboard"),
39
- size: "380x305"
40
- },
41
- class: "icon_button",
42
- title: Alchemy.t("Show clipboard"),
43
- id: "clipboard_button"
44
- ) %>
45
- </sl-tooltip>
46
- </div>
32
+ <%= render "alchemy/admin/clipboard/button", remarkable_type: "pages" %>
47
33
  <div class="toolbar_spacer"></div>
48
34
  <div class="toolbar_button">
49
35
  <sl-tooltip content="<%= Alchemy.t("Hierarchical") %>">
@@ -17,7 +17,7 @@
17
17
  <%= render partial: "create_language_form" %>
18
18
  <% end %>
19
19
 
20
- <%= paginate @pages, scope: alchemy, theme: "alchemy" %>
20
+ <%= render "alchemy/admin/resources/pagination", resources: @pages %>
21
21
 
22
22
  <div id="library_sidebar">
23
23
  <%= render "filter_bar" if resource_has_filters %>
@@ -1,8 +1,10 @@
1
- <%= search_form_for @query, url: url_for({
2
- action: 'index',
3
- size: @size,
4
- }.merge(search_filter_params.except(:q))
5
- ), remote: true, html: {class: 'search_form', id: nil} do |f| %>
1
+ <%- url ||= url_for({ action: 'index' }.merge(
2
+ q: search_filter_params[:q]&.except(resource_handler.search_field_name),
3
+ form_field_id: @form_field_id,
4
+ size: @size
5
+ )) -%>
6
+
7
+ <%= search_form_for @query, url: url_for(action: 'index', size: @size), remote: true, html: {class: 'search_form', id: "resource_search"} do |f| %>
6
8
  <%= hidden_field_tag :form_field_id, @form_field_id %>
7
9
  <div class="search_field">
8
10
  <button type="submit">
@@ -12,15 +14,10 @@
12
14
  placeholder: Alchemy.t(:search),
13
15
  class: 'search_input_field',
14
16
  id: nil %>
15
- <%= link_to render_icon(:times, size: '1x'), url_for({
16
- action: 'index',
17
- form_field_id: @form_field_id,
18
- size: @size,
19
- overlay: true
20
- }.merge(search_filter_params.except(:q))),
17
+ <%= link_to render_icon(:times, size: '1x'), url,
21
18
  remote: true,
22
19
  class: 'search_field_clear',
23
20
  title: Alchemy.t(:click_to_show_all),
24
- style: search_filter_params[:q].blank? ? 'visibility: hidden' : 'visibility: visible' %>
21
+ style: search_filter_params.fetch(:q, {}).fetch(resource_handler.search_field_name, '').present? ? 'visibility: visible' : 'visibility: hidden' %>
25
22
  </div>
26
23
  <% end %>
@@ -1,6 +1,8 @@
1
- <%- url ||= resource_url_proxy.url_for({ action: 'index' }.merge(search_filter_params.except(:q, :page))) -%>
1
+ <%- url ||= resource_url_proxy.url_for({ action: 'index' }.merge(
2
+ q: search_filter_params[:q]&.except(resource_handler.search_field_name))
3
+ ) -%>
2
4
 
3
- <%= search_form_for @query, url: url, class: 'search_form' do |f| %>
5
+ <%= search_form_for @query, url: resource_url_proxy.url_for(action: "index"), id: "resource_search", class: 'search_form' do |f| %>
4
6
  <div class="search_field">
5
7
  <button type="submit">
6
8
  <%= render_icon('search') %>
@@ -8,19 +10,12 @@
8
10
  <%= f.search_field resource_handler.search_field_name,
9
11
  class: 'search_input_field',
10
12
  placeholder: Alchemy.t(:search) %>
11
- <% local_assigns.fetch(:additional_query_fields, []).each do |field| %>
12
- <%= f.hidden_field field, id: nil %>
13
- <% end %>
14
13
  <%= link_to render_icon(:times, size: '1x'), url,
15
14
  class: 'search_field_clear',
16
15
  id: 'search_field_clear',
17
16
  title: Alchemy.t(:click_to_show_all),
18
17
  style: search_filter_params.fetch(:q, {}).fetch(resource_handler.search_field_name, '').present? ? 'visibility: visible' : 'visibility: hidden' %>
19
18
 
20
- <% search_filter_params.fetch(:filter, []).each do |filter_param| %>
21
- <%= hidden_field_tag "filter[#{filter_param[0]}]", filter_param[1], id: nil %>
22
- <% end %>
23
-
24
19
  <% if search_filter_params.fetch(:tagged_with, nil) %>
25
20
  <%= hidden_field_tag :tagged_with, search_filter_params.fetch(:tagged_with), id: nil %>
26
21
  <% end %>
@@ -19,12 +19,9 @@
19
19
  id: 'edit_multiple_pictures',
20
20
  style: 'float: none'
21
21
  ) %>
22
- <%= button_tag render_icon("delete-bin-2", size: '1x') + Alchemy.t("Delete"), 'data-alchemy-confirm' => {
23
- title: Alchemy.t(:please_confirm),
24
- message: Alchemy.t(:confirm_to_delete_images_from_server),
25
- ok_label: Alchemy.t("Yes"),
26
- cancel_label: Alchemy.t("No")
27
- }.to_json, class: 'button with_icon' %>
22
+ <%= button_tag render_icon("delete-bin-2", size: '1x') + Alchemy.t("Delete"),
23
+ 'data-turbo-confirm': Alchemy.t(:confirm_to_delete_images_from_server),
24
+ class: 'button with_icon' %>
28
25
  &nbsp;<%= Alchemy.t(:or) %>&nbsp;
29
26
  <%= link_to(
30
27
  render_icon(:close) + Alchemy.t("Clear selection"),
@@ -53,4 +50,4 @@
53
50
  <% end %>
54
51
  <% end %>
55
52
 
56
- <%= paginate @pictures, theme: 'alchemy' %>
53
+ <%= render "alchemy/admin/resources/pagination", resources: @pictures %>
@@ -21,7 +21,8 @@
21
21
  <%= render partial: 'picture_to_assign',
22
22
  collection: @pictures,
23
23
  locals: {size: @size} %>
24
- <%= paginate @pictures, theme: 'alchemy', remote: true, hide_per_page_select: true %>
24
+
25
+ <%= render "alchemy/admin/resources/pagination", resources: @pictures, remote: true, hide_per_page_select: true %>
25
26
  </div>
26
27
  <% end %>
27
28
  </div>
@@ -8,7 +8,7 @@
8
8
  in_dialog: true,
9
9
  redirect_url: alchemy.admin_pictures_path(
10
10
  size: search_filter_params[:size],
11
- filter: { misc: 'last_upload' },
11
+ q: { last_upload: true },
12
12
  form_field_id: @form_field_id
13
13
  ) %>
14
14
  </div>
@@ -7,7 +7,7 @@
7
7
  file_attribute: 'image_file',
8
8
  redirect_url: alchemy.admin_pictures_path(
9
9
  size: @size,
10
- filter: { misc: 'last_upload' }
10
+ q: { last_upload: true }
11
11
  ) %>
12
12
  </div>
13
13
  <div class="toolbar_spacer"></div>
@@ -74,13 +74,8 @@
74
74
  <h2>
75
75
  <%= @pictures.total_count %>
76
76
  <%= Alchemy::Picture.model_name.human(count: @pictures.total_count) %>
77
- <% if search_filter_params[:filter].present? %>
78
- <%= Alchemy.t("filtered_by") %>
79
- <% search_filter_params[:filter].each do |k, v| %>
80
- <span class="applied-filter"><%= Alchemy.t("filters.picture.#{k}.values.#{v}") %></span>
81
- <% end %>
82
- <% end %>
83
77
  </h2>
78
+ <%= render "alchemy/admin/resources/applied_filters" %>
84
79
  </div>
85
80
  <%= render 'archive' %>
86
81
  </div>
@@ -0,0 +1,8 @@
1
+ <% if applied_filters.present? %>
2
+ <div class="applied-filters">
3
+ <b><%= Alchemy.t("filtered_by") %></b>
4
+ <% applied_filters.each do |filter| %>
5
+ <%= render filter.applied_filter_component(search_filter_params:, resource_url_proxy:, query: @query) %>
6
+ <% end %>
7
+ </div>
8
+ <% end %>