alchemy_cms 8.3.10 → 8.4.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.
- checksums.yaml +4 -4
- data/LICENSE +1 -1
- data/README.md +58 -10
- data/app/assets/builds/alchemy/admin/page-select.css +1 -1
- data/app/assets/builds/alchemy/admin/print.css +1 -1
- data/app/assets/builds/alchemy/admin/remote-select.css +1 -0
- data/app/assets/builds/alchemy/admin/tags-autocomplete.css +1 -0
- data/app/assets/builds/alchemy/admin.css +4 -4
- data/app/assets/builds/alchemy/alchemy_admin.min.js +1 -1
- data/app/assets/builds/alchemy/alchemy_admin.min.js.map +1 -1
- data/app/assets/builds/alchemy/dark-theme.css +1 -1
- data/app/assets/builds/alchemy/light-theme.css +1 -1
- data/app/assets/builds/alchemy/preview.min.js +1 -1
- data/app/assets/builds/alchemy/theme.css +1 -1
- data/app/assets/builds/alchemy/welcome.css +1 -1
- data/app/assets/builds/tinymce/skins/content/alchemy/content.min.css +1 -1
- data/app/assets/builds/tinymce/skins/content/alchemy-dark/content.min.css +1 -1
- data/app/assets/builds/tinymce/skins/ui/alchemy/skin.min.css +1 -1
- data/app/assets/builds/tinymce/skins/ui/alchemy-dark/skin.min.css +1 -1
- data/app/assets/images/alchemy/icons-sprite.svg +1 -1
- data/app/components/alchemy/admin/dashboard/widgets/greeting.html.erb +1 -1
- data/app/components/alchemy/admin/dashboard/widgets/news_reader.html.erb +38 -0
- data/app/components/alchemy/admin/dashboard/widgets/news_reader.rb +54 -0
- data/app/components/alchemy/admin/dashboard/widgets/online_users.html.erb +1 -1
- data/app/components/alchemy/admin/dashboard/widgets/recent_pages.html.erb +1 -1
- data/app/components/alchemy/admin/dashboard/widgets/system_info.html.erb +11 -3
- data/app/components/alchemy/admin/dashboard/widgets/system_info.rb +6 -1
- data/app/components/alchemy/admin/element_editor.html.erb +1 -1
- data/app/components/alchemy/admin/element_select.rb +30 -20
- data/app/components/alchemy/admin/element_status_indicators.html.erb +16 -0
- data/app/components/alchemy/admin/element_status_indicators.rb +31 -0
- data/app/components/alchemy/admin/link_dialog/external_tab.rb +2 -1
- data/app/components/alchemy/admin/main_navigation/entry.rb +61 -0
- data/app/components/alchemy/admin/main_navigation/menu.rb +21 -0
- data/app/components/alchemy/admin/main_navigation/sub_navigation.rb +31 -0
- data/app/components/alchemy/admin/page_node.html.erb +1 -1
- data/app/components/alchemy/admin/page_permitted_roles_select.html.erb +11 -0
- data/app/components/alchemy/admin/page_permitted_roles_select.rb +35 -0
- data/app/components/alchemy/admin/page_select.rb +18 -8
- data/app/components/alchemy/admin/preview_time_select.rb +1 -1
- data/app/components/alchemy/admin/toolbar_button.rb +43 -20
- data/app/components/alchemy/admin/uploader_button.rb +66 -0
- data/app/components/alchemy/ingredients/base_editor.rb +10 -1
- data/app/components/alchemy/ingredients/boolean_editor.rb +1 -0
- data/app/components/alchemy/ingredients/color_editor.rb +6 -3
- data/app/components/alchemy/ingredients/datetime_view.rb +1 -1
- data/app/components/alchemy/ingredients/picture_view.rb +2 -4
- data/app/components/alchemy/menubar.html.erb +157 -0
- data/app/components/alchemy/menubar.rb +15 -0
- data/app/controllers/alchemy/admin/attachments_controller.rb +12 -9
- data/app/controllers/alchemy/admin/base_controller.rb +34 -21
- data/app/controllers/alchemy/admin/dashboard_controller.rb +4 -0
- data/app/controllers/alchemy/admin/elements_controller.rb +4 -23
- data/app/controllers/alchemy/admin/languages_controller.rb +1 -1
- data/app/controllers/alchemy/admin/nodes_controller.rb +1 -1
- data/app/controllers/alchemy/admin/pages_controller.rb +1 -1
- data/app/controllers/alchemy/admin/pictures_controller.rb +6 -3
- data/app/controllers/alchemy/admin/resources_controller.rb +5 -5
- data/app/controllers/alchemy/admin/sites_controller.rb +1 -1
- data/app/controllers/alchemy/base_controller.rb +24 -16
- data/app/controllers/alchemy/pages_controller.rb +29 -8
- data/app/controllers/alchemy/sitemap_controller.rb +58 -0
- data/app/controllers/concerns/alchemy/admin/csp_protection.rb +43 -0
- data/app/controllers/concerns/alchemy/admin/current_language.rb +1 -1
- data/app/controllers/concerns/alchemy/admin/resource_filter.rb +3 -1
- data/{lib → app/controllers/concerns}/alchemy/controller_actions.rb +13 -0
- data/app/controllers/concerns/alchemy/legacy_page_redirects.rb +4 -4
- data/app/helpers/alchemy/admin/base_helper.rb +4 -1
- data/app/helpers/alchemy/admin/form_helper.rb +0 -2
- data/app/helpers/alchemy/admin/navigation_helper.rb +10 -181
- data/app/helpers/alchemy/elements_block_helper.rb +14 -0
- data/app/helpers/alchemy/resources_helper.rb +15 -1
- data/app/javascript/alchemy_admin/components/attachment_select.js +11 -20
- data/app/javascript/alchemy_admin/components/auto_submit.js +2 -4
- data/app/javascript/alchemy_admin/components/button.js +0 -6
- data/app/javascript/alchemy_admin/components/clear_schedule_button.js +21 -0
- data/app/javascript/alchemy_admin/components/color_select.js +50 -45
- data/app/javascript/alchemy_admin/components/conditional_field.js +50 -0
- data/app/javascript/alchemy_admin/components/dirty_guard.js +77 -0
- data/app/javascript/alchemy_admin/components/dom_id_select.js +17 -10
- data/app/javascript/alchemy_admin/components/element_editor/delete_element_button.js +7 -2
- data/app/javascript/alchemy_admin/components/element_editor.js +29 -56
- data/app/javascript/alchemy_admin/components/element_select.js +26 -66
- data/app/javascript/alchemy_admin/components/icon.js +9 -4
- data/app/javascript/alchemy_admin/{image_cropper.js → components/image_cropper.js} +39 -53
- data/app/javascript/alchemy_admin/components/image_overlay_link.js +14 -0
- data/app/javascript/alchemy_admin/components/index.js +12 -1
- data/app/javascript/alchemy_admin/components/main_navi_entry.js +75 -0
- data/app/javascript/alchemy_admin/components/menu_node.js +73 -0
- data/app/javascript/alchemy_admin/components/news_reader.js +109 -0
- data/app/javascript/alchemy_admin/components/node_folder.js +36 -0
- data/app/javascript/alchemy_admin/components/node_form.js +34 -0
- data/app/javascript/alchemy_admin/components/node_select.js +25 -30
- data/app/javascript/alchemy_admin/components/node_tree.js +56 -0
- data/app/javascript/alchemy_admin/components/page_node.js +2 -1
- data/app/javascript/alchemy_admin/components/page_select.js +16 -34
- data/app/javascript/alchemy_admin/components/picture_archive.js +92 -0
- data/app/javascript/alchemy_admin/components/picture_editor.js +2 -1
- data/app/javascript/alchemy_admin/components/preview_window.js +11 -3
- data/app/javascript/alchemy_admin/components/remote_select.js +461 -81
- data/app/javascript/alchemy_admin/components/select.js +26 -88
- data/app/javascript/alchemy_admin/components/sitemap.js +2 -1
- data/app/javascript/alchemy_admin/components/sortable_elements.js +2 -1
- data/app/javascript/alchemy_admin/components/tags_autocomplete.js +63 -48
- data/app/javascript/alchemy_admin/components/tinymce.js +2 -1
- data/app/javascript/alchemy_admin/components/uploader/file_upload.js +3 -2
- data/app/javascript/alchemy_admin/components/uploader.js +19 -3
- data/app/javascript/alchemy_admin/confirm_dialog.js +7 -1
- data/app/javascript/alchemy_admin/dialog.js +182 -110
- data/app/javascript/alchemy_admin/hotkeys.js +0 -5
- data/app/javascript/alchemy_admin/i18n.js +3 -9
- data/app/javascript/alchemy_admin/image_overlay.js +58 -42
- data/app/javascript/alchemy_admin/initializer.js +2 -2
- data/app/javascript/alchemy_admin/link_dialog.js +15 -2
- data/app/javascript/alchemy_admin/routes.js +18 -0
- data/app/javascript/alchemy_admin/turbo_stream_actions.js +88 -0
- data/app/javascript/alchemy_admin/utils/ajax.js +14 -3
- data/app/javascript/alchemy_admin/utils/events.js +5 -0
- data/app/javascript/alchemy_admin/utils/json_script.js +12 -0
- data/app/javascript/alchemy_admin/utils/tom_select.js +171 -0
- data/app/javascript/alchemy_admin.js +2 -19
- data/app/javascript/preview.js +131 -113
- data/app/jobs/alchemy/invalidate_elements_cache_job.rb +1 -1
- data/app/models/alchemy/admin/content_security_policy.rb +143 -0
- data/app/models/alchemy/admin/filters/base.rb +7 -0
- data/app/models/alchemy/admin/filters/datepicker.rb +1 -1
- data/app/models/alchemy/admin/filters/select.rb +20 -7
- data/app/models/alchemy/attachment.rb +14 -7
- data/app/models/alchemy/cache_control.rb +104 -0
- data/app/models/alchemy/current.rb +1 -1
- data/app/models/alchemy/eager_loading.rb +0 -2
- data/app/models/alchemy/element.rb +23 -8
- data/app/models/alchemy/element_definition.rb +1 -0
- data/app/models/alchemy/elements_repository.rb +11 -0
- data/app/models/alchemy/folded_page.rb +5 -1
- data/app/models/alchemy/ingredient.rb +26 -0
- data/app/models/alchemy/ingredients/datetime.rb +1 -1
- data/app/models/alchemy/ingredients/link.rb +2 -0
- data/app/models/alchemy/ingredients/picture.rb +3 -0
- data/app/models/alchemy/ingredients/text.rb +2 -0
- data/app/models/alchemy/language.rb +19 -7
- data/app/models/alchemy/legacy_page_url.rb +6 -1
- data/app/models/alchemy/node.rb +51 -0
- data/app/models/alchemy/page/page_natures.rb +41 -8
- data/app/models/alchemy/page/page_scopes.rb +23 -0
- data/app/models/alchemy/page/sitemap_cache_key.rb +56 -0
- data/app/models/alchemy/page.rb +88 -32
- data/app/models/alchemy/page_definition.rb +1 -1
- data/app/models/alchemy/page_mutex.rb +16 -0
- data/app/models/alchemy/page_version.rb +24 -1
- data/app/models/alchemy/permissions.rb +6 -5
- data/app/models/alchemy/picture.rb +15 -7
- data/app/models/alchemy/picture_description.rb +22 -0
- data/app/models/alchemy/picture_thumb.rb +18 -0
- data/app/models/alchemy/publishable/timestamp_resolver.rb +70 -0
- data/app/models/alchemy/resource.rb +1 -1
- data/app/models/alchemy/safe_url_validator.rb +34 -0
- data/app/models/alchemy/site.rb +8 -3
- data/app/models/alchemy/storage_adapter/active_storage/preprocessor.rb +7 -3
- data/app/models/alchemy/storage_adapter/active_storage.rb +4 -1
- data/app/models/alchemy/tag.rb +10 -4
- data/{lib → app/models/concerns}/alchemy/filetypes.rb +5 -0
- data/app/models/concerns/alchemy/picture_thumbnails.rb +61 -6
- data/app/models/concerns/alchemy/publishable.rb +14 -29
- data/app/models/concerns/alchemy/taggable.rb +92 -0
- data/app/models/concerns/alchemy/user_methods.rb +95 -0
- data/app/services/alchemy/duplicate_element.rb +5 -2
- data/app/services/alchemy/element_preloader.rb +1 -2
- data/app/stylesheets/alchemy/_custom-properties.scss +1 -0
- data/app/stylesheets/alchemy/_extends.scss +0 -8
- data/app/stylesheets/alchemy/_themes.scss +10 -9
- data/app/stylesheets/alchemy/admin/_empty-state.scss +29 -0
- data/app/stylesheets/alchemy/admin/_help.scss +10 -0
- data/app/stylesheets/alchemy/admin/_tom-select.scss +104 -15
- data/app/stylesheets/alchemy/admin/archive.scss +56 -11
- data/app/stylesheets/alchemy/admin/base.scss +4 -5
- data/app/stylesheets/alchemy/admin/buttons.scss +12 -1
- data/app/stylesheets/alchemy/admin/dashboard.scss +150 -20
- data/app/stylesheets/alchemy/admin/dialogs.scss +27 -36
- data/app/stylesheets/alchemy/admin/element-select.scss +1 -1
- data/app/stylesheets/alchemy/admin/elements.scss +8 -24
- data/app/stylesheets/alchemy/admin/flash.scss +2 -1
- data/app/stylesheets/alchemy/admin/forms.scss +60 -24
- data/app/stylesheets/alchemy/admin/frame.scss +40 -4
- data/app/stylesheets/alchemy/admin/image_library.scss +9 -12
- data/app/stylesheets/alchemy/admin/navigation.scss +17 -14
- data/app/stylesheets/alchemy/admin/node-select.scss +13 -37
- data/app/stylesheets/alchemy/admin/nodes.scss +1 -1
- data/app/stylesheets/alchemy/admin/page-select.scss +6 -97
- data/app/stylesheets/alchemy/admin/print.scss +0 -4
- data/app/stylesheets/alchemy/admin/remote-select.scss +170 -0
- data/app/stylesheets/alchemy/admin/search.scss +2 -3
- data/app/stylesheets/alchemy/admin/selects.scss +1 -294
- data/app/stylesheets/alchemy/admin/sitemap.scss +2 -1
- data/app/stylesheets/alchemy/admin/tables.scss +7 -1
- data/app/stylesheets/alchemy/admin/tags-autocomplete.scss +17 -0
- data/app/stylesheets/alchemy/admin/tags.scss +0 -13
- data/app/stylesheets/alchemy/admin/toolbar.scss +9 -6
- data/app/stylesheets/alchemy/admin/upload.scss +61 -1
- data/app/stylesheets/alchemy/admin.scss +4 -1
- data/app/stylesheets/tinymce/skins/ui/alchemy/skin.scss +19 -0
- data/app/stylesheets/tinymce/skins/ui/alchemy-dark/skin.scss +19 -0
- data/app/types/alchemy/cache_control_type.rb +84 -0
- data/app/views/alchemy/_edit_mode.html.erb +1 -1
- data/app/views/alchemy/_menubar.html.erb +2 -154
- data/app/views/alchemy/_preview_mode_code.html.erb +0 -3
- data/app/views/alchemy/admin/_left_menu.html.erb +18 -5
- data/app/views/alchemy/admin/_top_menu.html.erb +1 -1
- data/app/views/alchemy/admin/attachments/_archive_overlay.html.erb +5 -4
- data/app/views/alchemy/admin/attachments/_file_to_assign.html.erb +3 -3
- data/app/views/alchemy/admin/attachments/_files_list.html.erb +71 -83
- data/app/views/alchemy/admin/attachments/assign.turbo_stream.erb +8 -0
- data/app/views/alchemy/admin/attachments/index.html.erb +32 -7
- data/app/views/alchemy/admin/clipboard/insert.turbo_stream.erb +1 -1
- data/app/views/alchemy/admin/crop.html.erb +20 -20
- data/app/views/alchemy/admin/dashboard/_footer.html.erb +0 -3
- data/app/views/alchemy/admin/dashboard/_top.html.erb +1 -0
- data/app/views/alchemy/admin/dashboard/help.html.erb +84 -57
- data/app/views/alchemy/admin/dashboard/license.html.erb +6 -0
- data/app/views/alchemy/admin/elements/_footer.html.erb +0 -1
- data/app/views/alchemy/admin/elements/_form.html.erb +1 -1
- data/app/views/alchemy/admin/elements/_header.html.erb +2 -19
- data/app/views/alchemy/admin/elements/_preview_text_quote.html.erb +3 -0
- data/app/views/alchemy/admin/elements/_schedule.html.erb +7 -7
- data/app/views/alchemy/admin/elements/_toolbar.html.erb +1 -1
- data/app/views/alchemy/admin/elements/create.turbo_stream.erb +1 -1
- data/app/views/alchemy/admin/elements/index.html.erb +1 -1
- data/app/views/alchemy/admin/elements/publish.turbo_stream.erb +2 -2
- data/app/views/alchemy/admin/elements/update.turbo_stream.erb +31 -0
- data/app/views/alchemy/admin/ingredients/update.turbo_stream.erb +6 -3
- data/app/views/alchemy/admin/languages/_table.html.erb +0 -2
- data/app/views/alchemy/admin/languages/index.html.erb +25 -29
- data/app/views/alchemy/admin/layoutpages/_layoutpage.html.erb +1 -3
- data/app/views/alchemy/admin/layoutpages/edit.html.erb +1 -1
- data/app/views/alchemy/admin/layoutpages/index.html.erb +26 -7
- data/app/views/alchemy/admin/nodes/_form.html.erb +3 -21
- data/app/views/alchemy/admin/nodes/_node.html.erb +93 -88
- data/app/views/alchemy/admin/nodes/index.html.erb +15 -23
- data/app/views/alchemy/admin/pages/_create_language_form.html.erb +2 -6
- data/app/views/alchemy/admin/pages/_form.html.erb +2 -1
- data/app/views/alchemy/admin/pages/_publication_fields.html.erb +1 -1
- data/app/views/alchemy/admin/pages/_table.html.erb +2 -4
- data/app/views/alchemy/admin/pages/_toolbar.html.erb +2 -1
- data/app/views/alchemy/admin/pages/edit.html.erb +10 -21
- data/app/views/alchemy/admin/pages/flush.turbo_stream.erb +1 -1
- data/app/views/alchemy/admin/pages/index.html.erb +26 -31
- data/app/views/alchemy/admin/pages/info.html.erb +2 -2
- data/app/views/alchemy/admin/pages/update.turbo_stream.erb +2 -2
- data/app/views/alchemy/admin/partials/_language_tree_select.html.erb +1 -1
- data/app/views/alchemy/admin/partials/_routes.html.erb +24 -48
- data/app/views/alchemy/admin/pictures/_archive.html.erb +3 -17
- data/app/views/alchemy/admin/pictures/_archive_overlay.html.erb +1 -1
- data/app/views/alchemy/admin/pictures/_filter_and_size_bar.html.erb +5 -3
- data/app/views/alchemy/admin/pictures/_form.html.erb +0 -1
- data/app/views/alchemy/admin/pictures/_infos.html.erb +5 -1
- data/app/views/alchemy/admin/pictures/_picture.html.erb +1 -1
- data/app/views/alchemy/admin/pictures/_picture_to_assign.html.erb +3 -4
- data/app/views/alchemy/admin/pictures/assign.turbo_stream.erb +7 -0
- data/app/views/alchemy/admin/pictures/index.html.erb +38 -30
- data/app/views/alchemy/admin/pictures/show.html.erb +41 -41
- data/app/views/alchemy/admin/resources/_empty_state.html.erb +27 -0
- data/app/views/alchemy/admin/resources/_pagination.html.erb +1 -1
- data/app/views/alchemy/admin/resources/_per_page_select.html.erb +1 -1
- data/app/views/alchemy/admin/resources/_resource_table.html.erb +0 -2
- data/app/views/alchemy/admin/resources/_resource_usage_info.html.erb +3 -2
- data/app/views/alchemy/admin/resources/index.html.erb +32 -13
- data/app/views/alchemy/admin/sites/index.html.erb +24 -22
- data/app/views/alchemy/admin/styleguide/index.html.erb +35 -12
- data/app/views/alchemy/admin/tags/index.html.erb +27 -25
- data/app/views/alchemy/admin/tinymce/_setup.html.erb +6 -8
- data/app/views/alchemy/admin/translations/_en.js +3 -0
- data/app/views/alchemy/admin/uploader/_button.html.erb +11 -17
- data/app/views/alchemy/admin/uploader/_setup.html.erb +3 -3
- data/app/views/alchemy/pages/sitemap.xml.erb +2 -0
- data/app/views/kaminari/alchemy/_first_page.html.erb +1 -2
- data/app/views/kaminari/alchemy/_gap.html.erb +0 -1
- data/app/views/kaminari/alchemy/_last_page.html.erb +1 -2
- data/app/views/kaminari/alchemy/_next_page.html.erb +1 -2
- data/app/views/kaminari/alchemy/_page.html.erb +1 -2
- data/app/views/kaminari/alchemy/_paginator.html.erb +0 -1
- data/app/views/kaminari/alchemy/_prev_page.html.erb +1 -2
- data/app/views/layouts/alchemy/admin/dialog.html.erb +3 -0
- data/app/views/layouts/alchemy/admin.html.erb +5 -6
- data/config/brakeman.ignore +23 -1
- data/config/importmap.rb +10 -8
- data/config/initializers/dragonfly.rb +21 -17
- data/config/locales/alchemy.en.yml +53 -12
- data/config/routes.rb +3 -3
- data/db/migrate/20260727120000_add_permitted_roles_to_alchemy_pages.rb +23 -0
- data/db/migrate/20260820120000_add_cached_tag_list_to_taggables.rb +57 -0
- data/lib/alchemy/configuration/number_option.rb +13 -0
- data/lib/alchemy/configuration/proc_option.rb +13 -0
- data/lib/alchemy/configuration.rb +2 -0
- data/lib/alchemy/configurations/admin_components.rb +30 -0
- data/lib/alchemy/configurations/format_matchers.rb +7 -1
- data/lib/alchemy/configurations/main.rb +103 -4
- data/lib/alchemy/configurations/menu.rb +91 -0
- data/lib/alchemy/configurations/menu_item.rb +123 -0
- data/lib/alchemy/configurations/sitemap.rb +1 -0
- data/lib/alchemy/configurations/uploader.rb +15 -1
- data/lib/alchemy/engine.rb +0 -6
- data/lib/alchemy/i18n.rb +26 -0
- data/lib/alchemy/modules.rb +52 -50
- data/lib/alchemy/tasks/generate_thumbnails.rb +99 -0
- data/lib/alchemy/tasks/tidy.rb +1 -1
- data/lib/alchemy/test_support/capybara_helpers.rb +48 -37
- data/lib/alchemy/test_support/current_language_shared_examples.rb +1 -1
- data/lib/alchemy/test_support/factories/dummy_user_factory.rb +4 -1
- data/lib/alchemy/test_support/having_picture_thumbnails_examples.rb +132 -0
- data/lib/alchemy/test_support/shared_ingredient_examples.rb +52 -0
- data/lib/alchemy/test_support/shared_publishable_examples.rb +39 -4
- data/lib/alchemy/upgrader/eight_four.rb +237 -0
- data/lib/alchemy/upgrader/register_module_rewriter.rb +177 -0
- data/lib/alchemy/upgrader.rb +2 -1
- data/lib/alchemy/version.rb +1 -1
- data/lib/alchemy.rb +0 -1
- data/lib/alchemy_cms.rb +0 -13
- data/lib/generators/alchemy/elements/templates/view.html.erb +1 -1
- data/lib/generators/alchemy/elements/templates/view.html.haml +1 -1
- data/lib/generators/alchemy/elements/templates/view.html.slim +1 -1
- data/lib/generators/alchemy/install/install_generator.rb +2 -13
- data/lib/generators/alchemy/install/templates/alchemy.rb.tt +24 -9
- data/lib/generators/alchemy/module/module_generator.rb +1 -0
- data/lib/generators/alchemy/module/templates/ability.rb.tt +1 -1
- data/lib/generators/alchemy/module/templates/module_config.rb.tt +16 -18
- data/lib/generators/alchemy/user_columns_migration/templates/migration.rb.tt +19 -0
- data/lib/generators/alchemy/user_columns_migration/user_columns_migration_generator.rb +30 -0
- data/lib/tasks/alchemy/thumbnails.rake +16 -29
- data/lib/tasks/alchemy/upgrade.rake +45 -3
- data/vendor/javascript/cropperjs.min.js +3 -3
- data/vendor/javascript/floating-ui.min.js +1 -1
- data/vendor/javascript/tinymce.min.js +5 -5
- data/vendor/javascript/tom-select.min.js +1 -1
- metadata +85 -65
- data/app/javascript/alchemy_admin/components/action.js +0 -50
- data/app/javascript/alchemy_admin/dirty.js +0 -55
- data/app/javascript/alchemy_admin/node_tree.js +0 -82
- data/app/javascript/alchemy_admin/picture_selector.js +0 -67
- data/app/javascript/alchemy_admin/templates/compiled.js +0 -1
- data/app/javascript/alchemy_admin/templates/node_folder.hbs +0 -3
- data/app/stylesheets/alchemy/admin/attachment-select.scss +0 -19
- data/app/views/alchemy/admin/_main_navi.html.erb +0 -6
- data/app/views/alchemy/admin/attachments/assign.js.erb +0 -15
- data/app/views/alchemy/admin/pages/_page_layout_filter.html.erb +0 -30
- data/app/views/alchemy/admin/partials/_main_navigation_entry.html.erb +0 -20
- data/app/views/alchemy/admin/partials/_sub_navigation.html.erb +0 -11
- data/app/views/alchemy/admin/pictures/assign.js.erb +0 -13
- data/app/views/alchemy/base/error_notice.js.erb +0 -1
- data/app/views/alchemy/base/permission_denied.js.erb +0 -3
- data/app/views/alchemy/base/redirect.js.erb +0 -11
- data/config/alchemy/config.yml +0 -217
- data/config/alchemy/modules.yml +0 -82
- data/config/initializers/rails_live_reload.rb +0 -13
- data/lib/alchemy/dev_support/live_reload_watcher.rb +0 -5
- data/lib/alchemy/taggable.rb +0 -49
- data/lib/generators/alchemy/install/templates/dragonfly.rb.tt +0 -34
- data/vendor/assets/stylesheets/alchemy_admin/select2.css +0 -1
- data/vendor/javascript/handlebars.min.js +0 -29
- data/vendor/javascript/jquery.min.js +0 -2
- data/vendor/javascript/rails-ujs.min.js +0 -1
- data/vendor/javascript/select2.min.js +0 -23
- /data/{lib → app/controllers/concerns}/alchemy/ability_helper.rb +0 -0
- /data/{lib → app/controllers/concerns}/alchemy/admin/locale.rb +0 -0
- /data/{lib → app/controllers/concerns}/alchemy/admin/preview_time.rb +0 -0
- /data/{lib → app/controllers/concerns}/alchemy/admin/timezone.rb +0 -0
- /data/{lib → app/controllers/concerns}/alchemy/configuration_methods.rb +0 -0
- /data/{lib → app/models}/alchemy/admin/preview_url.rb +0 -0
- /data/{lib → app/models/concerns}/alchemy/hints.rb +0 -0
- /data/{lib → app/models/concerns}/alchemy/name_conversions.rb +0 -0
- /data/{lib → app/services}/alchemy/elements_finder.rb +0 -0
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
@use "defaults";
|
|
2
2
|
@use "fonts";
|
|
3
3
|
@use "admin/archive";
|
|
4
|
-
@use "admin/attachment-select";
|
|
5
4
|
@use "admin/attachments";
|
|
6
5
|
@use "admin/base";
|
|
7
6
|
@use "admin/buttons";
|
|
@@ -10,6 +9,7 @@
|
|
|
10
9
|
@use "admin/dialogs";
|
|
11
10
|
@use "admin/elements";
|
|
12
11
|
@use "admin/element-select";
|
|
12
|
+
@use "admin/empty-state";
|
|
13
13
|
@use "admin/errors";
|
|
14
14
|
@use "admin/filters";
|
|
15
15
|
@use "admin/flash";
|
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
@use "admin/form_fields";
|
|
18
18
|
@use "admin/forms";
|
|
19
19
|
@use "admin/frame";
|
|
20
|
+
@use "admin/help";
|
|
20
21
|
@use "admin/hints";
|
|
21
22
|
@use "admin/icons";
|
|
22
23
|
@use "admin/image_library";
|
|
@@ -31,6 +32,7 @@
|
|
|
31
32
|
@use "admin/pagination";
|
|
32
33
|
@use "admin/popover";
|
|
33
34
|
@use "admin/preview_window";
|
|
35
|
+
@use "admin/remote-select";
|
|
34
36
|
@use "admin/resource_info";
|
|
35
37
|
@use "admin/search";
|
|
36
38
|
@use "admin/selects";
|
|
@@ -39,6 +41,7 @@
|
|
|
39
41
|
@use "admin/spinner";
|
|
40
42
|
@use "admin/tables";
|
|
41
43
|
@use "admin/tags";
|
|
44
|
+
@use "admin/tags-autocomplete";
|
|
42
45
|
@use "admin/tom-select";
|
|
43
46
|
@use "admin/toolbar";
|
|
44
47
|
@use "admin/typography";
|
|
@@ -1196,6 +1196,25 @@ button::-moz-focus-inner {
|
|
|
1196
1196
|
stroke: #e74c3c;
|
|
1197
1197
|
}
|
|
1198
1198
|
|
|
1199
|
+
.tox div.tox-swatch:not(.tox-swatch--remove) svg {
|
|
1200
|
+
display: none;
|
|
1201
|
+
fill: #222f3e;
|
|
1202
|
+
height: 24px;
|
|
1203
|
+
margin: calc((30px - 24px) / 2) calc((30px - 24px) / 2);
|
|
1204
|
+
width: 24px;
|
|
1205
|
+
}
|
|
1206
|
+
|
|
1207
|
+
.tox div.tox-swatch:not(.tox-swatch--remove) svg path {
|
|
1208
|
+
fill: #fff;
|
|
1209
|
+
paint-order: stroke;
|
|
1210
|
+
stroke: #222f3e;
|
|
1211
|
+
stroke-width: 2px;
|
|
1212
|
+
}
|
|
1213
|
+
|
|
1214
|
+
.tox div.tox-swatch:not(.tox-swatch--remove).tox-collection__item--enabled svg {
|
|
1215
|
+
display: block;
|
|
1216
|
+
}
|
|
1217
|
+
|
|
1199
1218
|
.tox .tox-swatches__picker-btn {
|
|
1200
1219
|
align-items: center;
|
|
1201
1220
|
background-color: transparent;
|
|
@@ -1196,6 +1196,25 @@ button::-moz-focus-inner {
|
|
|
1196
1196
|
stroke: #e74c3c;
|
|
1197
1197
|
}
|
|
1198
1198
|
|
|
1199
|
+
.tox div.tox-swatch:not(.tox-swatch--remove) svg {
|
|
1200
|
+
display: none;
|
|
1201
|
+
fill: #fff;
|
|
1202
|
+
height: 24px;
|
|
1203
|
+
margin: calc((30px - 24px) / 2) calc((30px - 24px) / 2);
|
|
1204
|
+
width: 24px;
|
|
1205
|
+
}
|
|
1206
|
+
|
|
1207
|
+
.tox div.tox-swatch:not(.tox-swatch--remove) svg path {
|
|
1208
|
+
fill: #fff;
|
|
1209
|
+
paint-order: stroke;
|
|
1210
|
+
stroke: #222f3e;
|
|
1211
|
+
stroke-width: 2px;
|
|
1212
|
+
}
|
|
1213
|
+
|
|
1214
|
+
.tox div.tox-swatch:not(.tox-swatch--remove).tox-collection__item--enabled svg {
|
|
1215
|
+
display: block;
|
|
1216
|
+
}
|
|
1217
|
+
|
|
1199
1218
|
.tox .tox-swatches__picker-btn {
|
|
1200
1219
|
align-items: center;
|
|
1201
1220
|
background-color: transparent;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Alchemy
|
|
4
|
+
# Casts a page layout `cache` / element `page_cache` config value into an
|
|
5
|
+
# {Alchemy::CacheControl} and validates the hash grammar at definition-load
|
|
6
|
+
# time (see {#assert_valid_value}, called eagerly on attribute assignment).
|
|
7
|
+
class CacheControlType < ActiveModel::Type::Value
|
|
8
|
+
ALLOWED_KEYS = [:visibility, :max_age, :no_cache, :no_store].freeze
|
|
9
|
+
|
|
10
|
+
def cast(value)
|
|
11
|
+
Alchemy::CacheControl.parse(value)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
def assert_valid_value(value)
|
|
15
|
+
case value
|
|
16
|
+
when nil, true, false, Alchemy::CacheControl
|
|
17
|
+
nil
|
|
18
|
+
when Integer
|
|
19
|
+
assert_valid_max_age!(value)
|
|
20
|
+
when Hash
|
|
21
|
+
assert_valid_hash!(value)
|
|
22
|
+
else
|
|
23
|
+
raise ArgumentError,
|
|
24
|
+
"#{value.inspect} is not a valid cache setting. " \
|
|
25
|
+
"Must be true, false, an Integer, or a Hash."
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
private
|
|
30
|
+
|
|
31
|
+
def assert_valid_hash!(hash)
|
|
32
|
+
options = hash.transform_keys(&:to_sym)
|
|
33
|
+
|
|
34
|
+
unknown = options.keys - ALLOWED_KEYS
|
|
35
|
+
if unknown.any?
|
|
36
|
+
raise ArgumentError,
|
|
37
|
+
"unknown cache option(s) #{unknown.map(&:inspect).join(", ")}. " \
|
|
38
|
+
"Allowed: #{ALLOWED_KEYS.map(&:inspect).join(", ")}."
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
assert_valid_visibility!(options[:visibility]) if options.key?(:visibility)
|
|
42
|
+
assert_valid_max_age!(options[:max_age]) if options.key?(:max_age)
|
|
43
|
+
assert_boolean!(:no_cache, options[:no_cache]) if options.key?(:no_cache)
|
|
44
|
+
assert_boolean!(:no_store, options[:no_store]) if options.key?(:no_store)
|
|
45
|
+
assert_no_conflicts!(options)
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
def assert_valid_visibility!(value)
|
|
49
|
+
unless CacheControl::VISIBILITIES.include?(value.to_s.to_sym)
|
|
50
|
+
raise ArgumentError,
|
|
51
|
+
"cache visibility #{value.inspect} is invalid. Must be :public or :private."
|
|
52
|
+
end
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
def assert_valid_max_age!(value)
|
|
56
|
+
unless value.is_a?(Integer) && value >= 0
|
|
57
|
+
raise ArgumentError,
|
|
58
|
+
"cache max_age #{value.inspect} is invalid. Must be a non-negative Integer."
|
|
59
|
+
end
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
def assert_boolean!(key, value)
|
|
63
|
+
unless [true, false].include?(value)
|
|
64
|
+
raise ArgumentError, "cache #{key} #{value.inspect} is invalid. Must be true or false."
|
|
65
|
+
end
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
def assert_no_conflicts!(options)
|
|
69
|
+
if options[:no_store]
|
|
70
|
+
conflicting = [:max_age, :visibility, :no_cache].select { |k| truthy?(options, k) }
|
|
71
|
+
if conflicting.any?
|
|
72
|
+
raise ArgumentError,
|
|
73
|
+
"cache no_store cannot be combined with #{conflicting.map(&:inspect).join(", ")}."
|
|
74
|
+
end
|
|
75
|
+
elsif options[:no_cache] && options.key?(:max_age)
|
|
76
|
+
raise ArgumentError, "cache no_cache cannot be combined with max_age."
|
|
77
|
+
end
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
def truthy?(options, key)
|
|
81
|
+
options.key?(key) && options[key]
|
|
82
|
+
end
|
|
83
|
+
end
|
|
84
|
+
end
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
<%= render
|
|
1
|
+
<%= render Alchemy::Menubar.new %>
|
|
2
2
|
<%= render "alchemy/preview_mode_code" %>
|
|
@@ -1,154 +1,2 @@
|
|
|
1
|
-
<%
|
|
2
|
-
|
|
3
|
-
<template>
|
|
4
|
-
<style>
|
|
5
|
-
.menubar {
|
|
6
|
-
--icon-size: 24px;
|
|
7
|
-
--panel-width: 525px;
|
|
8
|
-
--border-radius: 3px;
|
|
9
|
-
--left-offset: 0px;
|
|
10
|
-
display: flex;
|
|
11
|
-
position: fixed;
|
|
12
|
-
top: 0;
|
|
13
|
-
left: calc(-1 * (var(--panel-width) - var(--left-offset)));
|
|
14
|
-
z-index: 10000;
|
|
15
|
-
background: #214166;
|
|
16
|
-
transition: left 0.25s cubic-bezier(0.23, 1, 0.32, 1);
|
|
17
|
-
box-shadow: 0 0 0 1px #fff;
|
|
18
|
-
box-sizing: border-box;
|
|
19
|
-
border-bottom-right-radius: var(--border-radius);
|
|
20
|
-
padding: 12px 16px 12px 12px;
|
|
21
|
-
gap: 12px;
|
|
22
|
-
justify-content: space-between;
|
|
23
|
-
align-items: center;
|
|
24
|
-
flex-wrap: nowrap;
|
|
25
|
-
overflow: hidden;
|
|
26
|
-
font-family: "Open Sans", "Lucida Grande", "Lucida Sans Unicode",
|
|
27
|
-
"Lucida Sans", Verdana, Tahoma, sans-serif;
|
|
28
|
-
font-size: 13px;
|
|
29
|
-
line-height: normal;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
.menubar * {
|
|
33
|
-
box-sizing: border-box;
|
|
34
|
-
margin: 0;
|
|
35
|
-
padding: 0;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
.menubar:hover,
|
|
39
|
-
.menubar:focus-within,
|
|
40
|
-
.menubar.is-open {
|
|
41
|
-
left: 0;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
.menubar > svg {
|
|
45
|
-
width: var(--icon-size);
|
|
46
|
-
height: var(--icon-size);
|
|
47
|
-
flex-shrink: 0;
|
|
48
|
-
margin-left: 4px;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
.menubar .button {
|
|
52
|
-
display: inline-flex;
|
|
53
|
-
align-items: center;
|
|
54
|
-
justify-content: center;
|
|
55
|
-
gap: 8px;
|
|
56
|
-
font-size: inherit;
|
|
57
|
-
font-weight: 700;
|
|
58
|
-
cursor: pointer;
|
|
59
|
-
border-radius: var(--border-radius);
|
|
60
|
-
background-color: transparent;
|
|
61
|
-
border: 1px solid rgba(255, 255, 255, 0.5);
|
|
62
|
-
color: #fff;
|
|
63
|
-
margin: 0;
|
|
64
|
-
padding: 0.75em 1.5em;
|
|
65
|
-
appearance: none;
|
|
66
|
-
transition: all 250ms;
|
|
67
|
-
-webkit-font-smoothing: antialiased;
|
|
68
|
-
-moz-osx-font-smoothing: grayscale;
|
|
69
|
-
text-decoration: none;
|
|
70
|
-
white-space: nowrap;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
.menubar .button:hover {
|
|
74
|
-
text-decoration: none;
|
|
75
|
-
background-color: rgba(0, 0, 0, 0.25);
|
|
76
|
-
border-color: rgba(255, 255, 255, 0.75)
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
.menubar .button:active {
|
|
80
|
-
box-shadow: inset 0px 1px 1px -1px #333;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
.menubar .button:focus {
|
|
84
|
-
outline: solid 2px #eca96e;
|
|
85
|
-
outline-offset: 2px;
|
|
86
|
-
}
|
|
87
|
-
</style>
|
|
88
|
-
|
|
89
|
-
<div class="menubar" data-turbo="false">
|
|
90
|
-
<%= link_to alchemy.admin_dashboard_url, class: "button" do %>
|
|
91
|
-
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16" fill="currentColor">
|
|
92
|
-
<path d="M7.82843 10.9999H20V12.9999H7.82843L13.1924 18.3638L11.7782 19.778L4 11.9999L11.7782 4.22168L13.1924 5.63589L7.82843 10.9999Z"></path>
|
|
93
|
-
</svg>
|
|
94
|
-
<%= Alchemy.t(:to_alchemy) %>
|
|
95
|
-
<% end %>
|
|
96
|
-
<%= link_to alchemy.edit_admin_page_url(@page), class: "button" do %>
|
|
97
|
-
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16" fill="currentColor">
|
|
98
|
-
<path d="M6.41421 15.89L16.5563 5.74785L15.1421 4.33363L5 14.4758V15.89H6.41421ZM7.24264 17.89H3V13.6473L14.435 2.21231C14.8256 1.82179 15.4587 1.82179 15.8492 2.21231L18.6777 5.04074C19.0682 5.43126 19.0682 6.06443 18.6777 6.45495L7.24264 17.89ZM3 19.89H21V21.89H3V19.89Z"></path>
|
|
99
|
-
</svg>
|
|
100
|
-
<%= Alchemy.t(:edit_page) %>
|
|
101
|
-
<% end %>
|
|
102
|
-
<%= form_tag Alchemy.config.logout_path, method: Alchemy.config.logout_method do %>
|
|
103
|
-
<%= button_tag class: "button" do %>
|
|
104
|
-
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16" fill="currentColor">
|
|
105
|
-
<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>
|
|
106
|
-
</svg>
|
|
107
|
-
<%= Alchemy.t(:logout) %>
|
|
108
|
-
<% end %>
|
|
109
|
-
<% end %>
|
|
110
|
-
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30 30">
|
|
111
|
-
<path fill="#fff" d="M15.7 7.9L9.9 2.2 2.1 4.3 0 12.1l5.7 5.8 7.8-2.1 2.2-7.9zm-5.3 10.3l-1.2 4.4 3.2 3.2 4.4-1.2 1.2-4.4-3.2-3.2-4.4 1.2zM23.5 7.3L17.2 9l-1.7 6.2 4.5 4.6 6.2-1.7 1.7-6.2-4.4-4.6z" />
|
|
112
|
-
</svg>
|
|
113
|
-
</div>
|
|
114
|
-
</template>
|
|
115
|
-
|
|
116
|
-
<script type="module" data-turbo-eval="false">
|
|
117
|
-
class Menubar extends HTMLElement {
|
|
118
|
-
connectedCallback() {
|
|
119
|
-
const template = this.querySelector("template")
|
|
120
|
-
const attachedShadowRoot = this.attachShadow({ mode: "open" })
|
|
121
|
-
attachedShadowRoot.appendChild(template.content.cloneNode(true))
|
|
122
|
-
const width = this.bar.offsetWidth
|
|
123
|
-
this.bar.style = `--panel-width: ${width}px; --left-offset: calc(var(--icon-size) + 32px);`
|
|
124
|
-
this.bar.addEventListener("touchstart", this, { passive: false })
|
|
125
|
-
document.addEventListener("touchstart", this, { passive: true })
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
handleEvent(event) {
|
|
129
|
-
// click on menubar
|
|
130
|
-
if (event.currentTarget === this.bar) {
|
|
131
|
-
if (!this.bar.classList.contains("is-open")) {
|
|
132
|
-
event.preventDefault()
|
|
133
|
-
this.bar.classList.add("is-open")
|
|
134
|
-
}
|
|
135
|
-
// click outside of menubar
|
|
136
|
-
} else if (!event.composedPath().includes(this.bar)) {
|
|
137
|
-
this.bar.classList.remove("is-open")
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
disconnectedCallback() {
|
|
142
|
-
this.bar.removeEventListener("touchstart", this)
|
|
143
|
-
document.removeEventListener("touchstart", this)
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
get bar() {
|
|
147
|
-
return this.shadowRoot.querySelector(".menubar")
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
customElements.define("alchemy-menubar", Menubar)
|
|
152
|
-
</script>
|
|
153
|
-
</alchemy-menubar>
|
|
154
|
-
<% end %>
|
|
1
|
+
<% Alchemy::Deprecation.warn("Rendering 'alchemy/menubar' partial is deprecated. Use `render Alchemy::Menubar.new` instead.") %>
|
|
2
|
+
<%= render Alchemy::Menubar.new %>
|
|
@@ -1,14 +1,27 @@
|
|
|
1
1
|
<div id="left_menu">
|
|
2
|
-
<%= render
|
|
2
|
+
<%= render Alchemy::Admin::MainNavigation::Menu.new %>
|
|
3
3
|
|
|
4
4
|
<div id="logout">
|
|
5
|
+
<div class="main_navi_entry">
|
|
6
|
+
<%= link_to_dialog(
|
|
7
|
+
safe_join([
|
|
8
|
+
render_icon(:question, class: 'module'),
|
|
9
|
+
tag.label(Alchemy.t("Help"))
|
|
10
|
+
]),
|
|
11
|
+
alchemy.help_path,
|
|
12
|
+
{
|
|
13
|
+
title: Alchemy.t("AlchemyCMS Help"),
|
|
14
|
+
size: "500x400"
|
|
15
|
+
}
|
|
16
|
+
) %>
|
|
17
|
+
</div>
|
|
5
18
|
<div class="main_navi_entry">
|
|
6
19
|
<% if current_alchemy_user %>
|
|
7
20
|
<%= link_to_dialog(
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
)
|
|
21
|
+
safe_join([
|
|
22
|
+
render_icon('logout-box-r', class: 'module'),
|
|
23
|
+
tag.label(Alchemy.t(:leave))
|
|
24
|
+
]),
|
|
12
25
|
alchemy.leave_admin_path, {
|
|
13
26
|
size: "320x140",
|
|
14
27
|
title: Alchemy.t("Leave Alchemy")
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
<%= turbo_frame_tag "archive_overlay" do %>
|
|
2
|
-
<div
|
|
2
|
+
<div class="toolbar">
|
|
3
3
|
<div class="toolbar_buttons">
|
|
4
4
|
<% if can? :create, Alchemy::Attachment %>
|
|
5
5
|
<div class="toolbar_button">
|
|
6
|
-
<%= render
|
|
6
|
+
<%= render Alchemy::Admin::UploaderButton.new(
|
|
7
7
|
object: Alchemy::Attachment.new,
|
|
8
8
|
dropzone: '#assign_file_list',
|
|
9
9
|
file_attribute: 'file',
|
|
10
|
-
|
|
10
|
+
inline_label: true,
|
|
11
11
|
accept: Array(search_filter_params[:only]).map { |extension|
|
|
12
12
|
Marcel::MimeType.for(extension:)
|
|
13
13
|
}.join(",").presence,
|
|
@@ -18,7 +18,8 @@
|
|
|
18
18
|
q: search_filter_params[:q].merge(
|
|
19
19
|
last_upload: true
|
|
20
20
|
)
|
|
21
|
-
)
|
|
21
|
+
)
|
|
22
|
+
) %>
|
|
22
23
|
</div>
|
|
23
24
|
<% end %>
|
|
24
25
|
</div>
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
<li class="assign_file_file <%= cycle('even', 'odd') %>">
|
|
2
|
-
<%=
|
|
2
|
+
<%= button_to alchemy.assign_admin_attachment_path(
|
|
3
3
|
id: file_to_assign.id,
|
|
4
4
|
form_field_id: @form_field_id
|
|
5
5
|
),
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
method: :put,
|
|
7
|
+
form_class: "assign_file" do %>
|
|
8
8
|
<span class="list-primary">
|
|
9
9
|
<%= render_icon(file_to_assign.icon_css_class) %>
|
|
10
10
|
<%= file_to_assign.name %>
|
|
@@ -1,96 +1,84 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
<% else %>
|
|
6
|
-
<%= Alchemy.t(:no_files_in_archive) %>
|
|
7
|
-
<% end %>
|
|
8
|
-
<% end %>
|
|
9
|
-
<% else %>
|
|
10
|
-
<%= render Alchemy::Admin::Resource::Table.new(@attachments, query: @query) do |table| %>
|
|
11
|
-
<% table.icon_column { |attachment| attachment.icon_css_class } %>
|
|
12
|
-
<% table.column :name, sortable: true do |attachment| %>
|
|
13
|
-
<% if can?(:show, attachment) %>
|
|
14
|
-
<%= link_to_dialog(
|
|
15
|
-
attachment.name,
|
|
16
|
-
alchemy.admin_attachment_path(attachment),
|
|
17
|
-
{
|
|
18
|
-
title: attachment.name,
|
|
19
|
-
size: attachment_preview_size(attachment)
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
title: Alchemy.t('Attachment Preview')
|
|
23
|
-
}
|
|
24
|
-
) %>
|
|
25
|
-
<% else %>
|
|
26
|
-
<%= attachment.name %>
|
|
27
|
-
<% end %>
|
|
28
|
-
<% end %>
|
|
29
|
-
<% table.column :file_name, sortable: true %>
|
|
30
|
-
<% table.column :file_mime_type do |attachment| %>
|
|
31
|
-
<%= mime_to_human(attachment.file_mime_type) %>
|
|
32
|
-
<% end %>
|
|
33
|
-
<% table.column :file_size, sortable: true do |attachment| %>
|
|
34
|
-
<%= number_to_human_size(attachment.file_size) %>
|
|
35
|
-
<% end %>
|
|
36
|
-
<% table.column :created_at, sortable: true %>
|
|
37
|
-
|
|
38
|
-
<% table.with_action(:show, Alchemy.t('Attachment Preview')) do |attachment| %>
|
|
1
|
+
<%= render Alchemy::Admin::Resource::Table.new(@attachments, query: @query) do |table| %>
|
|
2
|
+
<% table.icon_column { |attachment| attachment.icon_css_class } %>
|
|
3
|
+
<% table.column :name, sortable: true do |attachment| %>
|
|
4
|
+
<% if can?(:show, attachment) %>
|
|
39
5
|
<%= link_to_dialog(
|
|
40
|
-
|
|
6
|
+
attachment.name,
|
|
41
7
|
alchemy.admin_attachment_path(attachment),
|
|
42
8
|
{
|
|
43
9
|
title: attachment.name,
|
|
44
10
|
size: attachment_preview_size(attachment)
|
|
45
11
|
},
|
|
46
|
-
|
|
12
|
+
{
|
|
13
|
+
title: Alchemy.t('Attachment Preview')
|
|
14
|
+
}
|
|
47
15
|
) %>
|
|
16
|
+
<% else %>
|
|
17
|
+
<%= attachment.name %>
|
|
48
18
|
<% end %>
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
19
|
+
<% end %>
|
|
20
|
+
<% table.column :file_name, sortable: true %>
|
|
21
|
+
<% table.column :file_mime_type do |attachment| %>
|
|
22
|
+
<%= mime_to_human(attachment.file_mime_type) %>
|
|
23
|
+
<% end %>
|
|
24
|
+
<% table.column :file_size, sortable: true do |attachment| %>
|
|
25
|
+
<%= number_to_human_size(attachment.file_size) %>
|
|
26
|
+
<% end %>
|
|
27
|
+
<% table.column :created_at, sortable: true %>
|
|
28
|
+
|
|
29
|
+
<% table.with_action(:show, Alchemy.t('Attachment Preview')) do |attachment| %>
|
|
30
|
+
<%= link_to_dialog(
|
|
31
|
+
render_icon(:information),
|
|
32
|
+
alchemy.admin_attachment_path(attachment),
|
|
33
|
+
{
|
|
34
|
+
title: attachment.name,
|
|
35
|
+
size: attachment_preview_size(attachment)
|
|
36
|
+
},
|
|
37
|
+
class: "icon_button"
|
|
38
|
+
) %>
|
|
39
|
+
<% end %>
|
|
40
|
+
<% table.with_action(:download) do |attachment| %>
|
|
41
|
+
<sl-tooltip content="<%= Alchemy.t("download_file", filename: attachment.file_name) %>">
|
|
42
|
+
<%= link_to render_icon(:download),
|
|
43
|
+
alchemy.download_attachment_path(attachment),
|
|
44
|
+
target: "_blank",
|
|
45
|
+
class: "icon_button" %>
|
|
46
|
+
</sl-tooltip>
|
|
47
|
+
<% end %>
|
|
48
|
+
<% table.with_action(:edit, Alchemy.t(:replace_file)) do |attachment| %>
|
|
49
|
+
<%= render 'alchemy/admin/attachments/replace_button',
|
|
50
|
+
redirect_url: alchemy.admin_attachments_path,
|
|
51
|
+
object: attachment,
|
|
52
|
+
file_attribute: 'file' %>
|
|
53
|
+
<% end %>
|
|
54
|
+
<% table.with_action(:destroy) do |attachment| %>
|
|
55
|
+
<% if @deletable_attachment_ids.include?(attachment.id) %>
|
|
56
|
+
<sl-tooltip content="<%= Alchemy.t(:delete_file) %>">
|
|
57
|
+
<%= link_to_confirm_dialog render_icon(:minus),
|
|
58
|
+
Alchemy.t(:confirm_to_delete_file),
|
|
59
|
+
alchemy.admin_attachment_path(
|
|
60
|
+
id: attachment,
|
|
61
|
+
q: search_filter_params[:q],
|
|
62
|
+
page: params[:page],
|
|
63
|
+
per_page: params[:per_page]
|
|
64
|
+
),
|
|
54
65
|
class: "icon_button" %>
|
|
55
66
|
</sl-tooltip>
|
|
56
|
-
<%
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
<% end %>
|
|
63
|
-
<% table.with_action(:destroy) do |attachment| %>
|
|
64
|
-
<% if @deletable_attachment_ids.include?(attachment.id) %>
|
|
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 %>
|
|
83
|
-
<% end %>
|
|
84
|
-
<% table.with_action(:edit, Alchemy.t(:rename_file)) do |attachment| %>
|
|
85
|
-
<%= link_to_dialog render_icon(:edit),
|
|
86
|
-
alchemy.edit_admin_attachment_path(attachment, q: search_filter_params[:q], page: params[:page]),
|
|
87
|
-
{
|
|
88
|
-
title: Alchemy.t(:rename_file),
|
|
89
|
-
size: '500x250'
|
|
90
|
-
},
|
|
91
|
-
class: "icon_button" %>
|
|
67
|
+
<% else %>
|
|
68
|
+
<sl-tooltip content="<%= Alchemy.t(:in_use) %>">
|
|
69
|
+
<button class="icon_button disabled">
|
|
70
|
+
<%= render_icon(:minus) %>
|
|
71
|
+
</button>
|
|
72
|
+
</sl-tooltip>
|
|
92
73
|
<% end %>
|
|
93
74
|
<% end %>
|
|
94
|
-
|
|
95
|
-
|
|
75
|
+
<% table.with_action(:edit, Alchemy.t(:rename_file)) do |attachment| %>
|
|
76
|
+
<%= link_to_dialog render_icon(:edit),
|
|
77
|
+
alchemy.edit_admin_attachment_path(attachment, q: search_filter_params[:q], page: params[:page]),
|
|
78
|
+
{
|
|
79
|
+
title: Alchemy.t(:rename_file),
|
|
80
|
+
size: '500x250'
|
|
81
|
+
},
|
|
82
|
+
class: "icon_button" %>
|
|
83
|
+
<% end %>
|
|
96
84
|
<% end %>
|
|
@@ -2,12 +2,14 @@
|
|
|
2
2
|
<div class="toolbar_buttons">
|
|
3
3
|
<% if can? :create, Alchemy::Attachment %>
|
|
4
4
|
<div class="toolbar_button">
|
|
5
|
-
<%= render
|
|
5
|
+
<%= render Alchemy::Admin::UploaderButton.new(
|
|
6
6
|
redirect_url: alchemy.admin_attachments_path(q: {
|
|
7
7
|
last_upload: true
|
|
8
8
|
}),
|
|
9
9
|
object: Alchemy::Attachment.new,
|
|
10
|
-
file_attribute: 'file'
|
|
10
|
+
file_attribute: 'file',
|
|
11
|
+
inline_label: true
|
|
12
|
+
) %>
|
|
11
13
|
</div>
|
|
12
14
|
<% end %>
|
|
13
15
|
</div>
|
|
@@ -15,8 +17,31 @@
|
|
|
15
17
|
<%= render 'alchemy/admin/partials/search_form' %>
|
|
16
18
|
<% end %>
|
|
17
19
|
|
|
18
|
-
|
|
19
|
-
<%= render 'alchemy/admin/resources/
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
<% if Alchemy::Attachment.none? %>
|
|
21
|
+
<%= render 'alchemy/admin/resources/empty_state' do %>
|
|
22
|
+
<%= render Alchemy::Admin::UploaderButton.new(
|
|
23
|
+
redirect_url: alchemy.admin_attachments_path(q: {
|
|
24
|
+
last_upload: true
|
|
25
|
+
}),
|
|
26
|
+
object: Alchemy::Attachment.new,
|
|
27
|
+
file_attribute: 'file',
|
|
28
|
+
inline_label: true
|
|
29
|
+
) %>
|
|
30
|
+
<% end %>
|
|
31
|
+
<% else %>
|
|
32
|
+
<%= render "alchemy/admin/resources/table_header" %>
|
|
33
|
+
|
|
34
|
+
<% if @attachments.none? && search_filter_params.present? %>
|
|
35
|
+
<%= render_message do %>
|
|
36
|
+
<%= Alchemy.t(:no_search_results) %>
|
|
37
|
+
<% end %>
|
|
38
|
+
<% else %>
|
|
39
|
+
<div class="resources-table-wrapper">
|
|
40
|
+
<%= render "files_list" %>
|
|
41
|
+
</div>
|
|
42
|
+
<% end %>
|
|
43
|
+
|
|
44
|
+
<%= render "alchemy/admin/resources/pagination", resources: @attachments %>
|
|
45
|
+
<% end %>
|
|
46
|
+
|
|
47
|
+
<%= render "library_sidebar" %>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<% if @item.class.name == 'Alchemy::Element' && params[:remove] -%>
|
|
2
2
|
<% if @item.fixed? -%>
|
|
3
|
-
<
|
|
3
|
+
<turbo-stream action="remove_fixed_element" element-id="<%= @item.id %>"></turbo-stream>
|
|
4
4
|
<% else -%>
|
|
5
5
|
<%= turbo_stream.remove "element_#{@item.id}" %>
|
|
6
6
|
<% end -%>
|