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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +86 -0
- data/Gemfile +13 -6
- data/README.md +13 -5
- data/alchemy_cms.gemspec +14 -5
- 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.css +2 -2
- data/app/assets/builds/alchemy/custom-properties.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/ui/alchemy/content.min.css +1 -0
- data/app/assets/builds/tinymce/skins/ui/alchemy/skin.min.css +1 -1
- data/app/assets/config/alchemy_manifest.js +0 -2
- data/app/assets/images/alchemy/icons-sprite.svg +1 -0
- data/app/components/alchemy/admin/resource/applied_filter.rb +29 -0
- data/app/components/alchemy/admin/resource/checkbox_filter.rb +36 -0
- data/app/components/alchemy/admin/resource/datepicker_filter.rb +42 -0
- data/app/components/alchemy/admin/resource/select_filter.rb +43 -0
- data/app/components/alchemy/admin/toolbar_button.rb +5 -2
- data/app/components/alchemy/ingredients/number_view.rb +18 -0
- data/app/controllers/alchemy/admin/attachments_controller.rb +8 -15
- data/app/controllers/alchemy/admin/clipboard_controller.rb +2 -6
- data/app/controllers/alchemy/admin/elements_controller.rb +1 -1
- data/app/controllers/alchemy/admin/languages_controller.rb +1 -1
- data/app/controllers/alchemy/admin/pages_controller.rb +15 -15
- data/app/controllers/alchemy/admin/pictures_controller.rb +9 -5
- data/app/controllers/alchemy/admin/resources_controller.rb +16 -106
- data/app/controllers/alchemy/attachments_controller.rb +43 -14
- data/app/controllers/alchemy/messages_controller.rb +1 -1
- data/app/controllers/alchemy/pages_controller.rb +7 -2
- data/app/controllers/concerns/alchemy/admin/resource_filter.rb +92 -0
- data/app/decorators/alchemy/element_editor.rb +5 -48
- data/app/decorators/alchemy/ingredient_editor.rb +3 -53
- data/app/helpers/alchemy/admin/base_helper.rb +14 -84
- data/app/helpers/alchemy/admin/elements_helper.rb +4 -4
- data/app/helpers/alchemy/admin/pages_helper.rb +1 -1
- data/app/helpers/alchemy/base_helper.rb +0 -30
- data/app/helpers/alchemy/elements_block_helper.rb +0 -14
- data/app/helpers/alchemy/pages_helper.rb +1 -1
- data/{lib → app/helpers}/alchemy/resources_helper.rb +5 -45
- data/app/javascript/alchemy_admin/components/action.js +2 -0
- data/app/javascript/alchemy_admin/components/alchemy_html_element.js +3 -3
- data/app/javascript/alchemy_admin/components/datepicker.js +10 -2
- data/app/javascript/alchemy_admin/components/element_editor/delete_element_button.js +7 -7
- data/app/javascript/alchemy_admin/components/element_editor.js +1 -1
- data/app/javascript/alchemy_admin/components/index.js +1 -0
- data/app/javascript/alchemy_admin/components/remote_select.js +4 -1
- data/app/javascript/alchemy_admin/components/tags_autocomplete.js +5 -1
- data/app/javascript/alchemy_admin/components/tinymce.js +4 -2
- data/app/javascript/alchemy_admin/components/update_check.js +42 -0
- data/app/javascript/alchemy_admin/components/uploader/file_upload.js +15 -8
- data/app/javascript/alchemy_admin/components/uploader/progress.js +12 -6
- data/app/javascript/alchemy_admin/components/uploader.js +4 -2
- data/app/javascript/alchemy_admin/confirm_dialog.js +27 -57
- data/app/javascript/alchemy_admin/dirty.js +3 -2
- data/app/javascript/alchemy_admin/i18n.js +15 -16
- data/app/javascript/alchemy_admin/initializer.js +1 -49
- data/app/javascript/alchemy_admin/utils/ajax.js +51 -44
- data/app/javascript/alchemy_admin.js +3 -8
- data/app/models/alchemy/admin/filters/base.rb +38 -0
- data/app/models/alchemy/admin/filters/checkbox.rb +24 -0
- data/app/models/alchemy/admin/filters/datepicker.rb +53 -0
- data/app/models/alchemy/admin/filters/select.rb +70 -0
- data/app/models/alchemy/admin/resource_name.rb +27 -0
- data/app/models/alchemy/attachment.rb +51 -34
- data/app/models/alchemy/base_record.rb +2 -0
- data/app/models/alchemy/element/definitions.rb +1 -1
- data/app/models/alchemy/element/element_ingredients.rb +6 -6
- data/app/models/alchemy/element/presenters.rb +3 -12
- data/app/models/alchemy/element.rb +9 -27
- data/app/models/alchemy/element_definition.rb +160 -0
- data/app/models/alchemy/ingredient.rb +10 -43
- data/app/models/alchemy/ingredient_definition.rb +134 -0
- data/app/models/alchemy/ingredient_validator.rb +7 -3
- data/app/models/alchemy/ingredients/number.rb +19 -0
- data/app/models/alchemy/language.rb +0 -14
- data/app/models/alchemy/message.rb +3 -7
- data/app/models/alchemy/node.rb +1 -1
- data/app/models/alchemy/page/{page_layouts.rb → definitions.rb} +12 -19
- data/app/models/alchemy/page/fixed_attributes.rb +1 -1
- data/app/models/alchemy/page/page_elements.rb +13 -14
- data/app/models/alchemy/page/page_natures.rb +7 -7
- data/app/models/alchemy/page/page_scopes.rb +1 -1
- data/app/models/alchemy/page.rb +11 -33
- data/app/models/alchemy/page_definition.rb +115 -0
- data/app/models/alchemy/picture.rb +69 -79
- data/app/models/alchemy/picture_variant.rb +115 -5
- data/{lib → app/models}/alchemy/resource.rb +4 -18
- data/{lib → app/models}/alchemy/searchable_resource.rb +15 -0
- data/app/models/alchemy/site/layout.rb +5 -5
- data/app/models/alchemy/site.rb +0 -15
- data/app/models/alchemy/storage_adapter/active_storage/attachment_url.rb +41 -0
- data/app/models/alchemy/storage_adapter/active_storage/picture_url.rb +55 -0
- data/app/models/alchemy/storage_adapter/active_storage/preprocessor.rb +40 -0
- data/app/models/alchemy/storage_adapter/active_storage.rb +173 -0
- data/app/models/alchemy/{attachment/url.rb → storage_adapter/dragonfly/attachment_url.rb} +12 -12
- data/app/models/alchemy/{picture/url.rb → storage_adapter/dragonfly/picture_url.rb} +28 -12
- data/app/models/alchemy/{picture → storage_adapter/dragonfly}/preprocessor.rb +4 -4
- data/app/models/alchemy/storage_adapter/dragonfly.rb +183 -0
- data/app/models/alchemy/storage_adapter.rb +74 -0
- data/app/models/concerns/alchemy/picture_thumbnails.rb +19 -6
- data/app/serializers/alchemy/element_serializer.rb +0 -1
- data/app/services/alchemy/dragonfly_to_image_processing.rb +100 -0
- data/app/stylesheets/alchemy/_defaults.scss +3 -0
- data/app/stylesheets/alchemy/_extends.scss +69 -0
- data/app/{assets/stylesheets → stylesheets}/alchemy/_mixins.scss +36 -49
- data/app/stylesheets/alchemy/_variables.scss +5 -0
- data/app/{assets/stylesheets → stylesheets}/alchemy/admin/archive.scss +20 -37
- data/app/{assets/stylesheets → stylesheets}/alchemy/admin/base.scss +16 -14
- data/app/stylesheets/alchemy/admin/buttons.scss +160 -0
- data/app/{assets/stylesheets → stylesheets}/alchemy/admin/clipboard.scss +2 -2
- data/app/{assets/stylesheets → stylesheets}/alchemy/admin/dashboard.scss +13 -16
- data/app/{assets/stylesheets → stylesheets}/alchemy/admin/dialogs.scss +23 -16
- data/app/{assets/stylesheets → stylesheets}/alchemy/admin/elements.scss +150 -105
- data/app/{assets/stylesheets → stylesheets}/alchemy/admin/errors.scss +5 -5
- data/app/stylesheets/alchemy/admin/filters.scss +58 -0
- data/app/{assets/stylesheets → stylesheets}/alchemy/admin/flatpickr.scss +53 -60
- data/app/{assets/stylesheets → stylesheets}/alchemy/admin/form_fields.scss +21 -7
- data/app/{assets/stylesheets → stylesheets}/alchemy/admin/forms.scss +31 -19
- data/app/{assets/stylesheets → stylesheets}/alchemy/admin/frame.scss +20 -16
- data/app/stylesheets/alchemy/admin/hints.scss +5 -0
- data/app/{assets/stylesheets → stylesheets}/alchemy/admin/icons.scss +10 -1
- data/app/{assets/stylesheets → stylesheets}/alchemy/admin/image_library.scss +10 -8
- data/app/{assets/stylesheets → stylesheets}/alchemy/admin/images.scss +1 -1
- data/app/stylesheets/alchemy/admin/labels.scss +5 -0
- data/app/{assets/stylesheets → stylesheets}/alchemy/admin/lists.scss +3 -3
- data/app/{assets/stylesheets → stylesheets}/alchemy/admin/navigation.scss +61 -55
- data/app/{assets/stylesheets → stylesheets}/alchemy/admin/nodes.scss +21 -18
- data/app/{assets/stylesheets → stylesheets}/alchemy/admin/notices.scss +18 -18
- data/app/{assets/stylesheets → stylesheets}/alchemy/admin/page-select.scss +2 -2
- data/app/stylesheets/alchemy/admin/pagination.scss +144 -0
- data/app/{assets/stylesheets → stylesheets}/alchemy/admin/preview_window.scss +8 -6
- data/app/{assets/stylesheets → stylesheets}/alchemy/admin/print.scss +1 -1
- data/app/{assets/stylesheets → stylesheets}/alchemy/admin/resource_info.scss +8 -5
- data/app/{assets/stylesheets → stylesheets}/alchemy/admin/search.scss +9 -6
- data/app/{assets/stylesheets → stylesheets}/alchemy/admin/selects.scss +49 -37
- data/app/{assets/stylesheets → stylesheets}/alchemy/admin/shoelace.scss +5 -6
- data/app/{assets/stylesheets → stylesheets}/alchemy/admin/sitemap.scss +38 -33
- data/app/{assets/stylesheets → stylesheets}/alchemy/admin/tables.scss +6 -4
- data/app/{assets/stylesheets → stylesheets}/alchemy/admin/tags.scss +6 -4
- data/app/{assets/stylesheets → stylesheets}/alchemy/admin/toolbar.scss +12 -6
- data/app/{assets/stylesheets → stylesheets}/alchemy/admin/typography.scss +2 -2
- data/app/{assets/stylesheets → stylesheets}/alchemy/admin/upload.scss +7 -5
- data/app/stylesheets/alchemy/admin.scss +44 -0
- data/app/stylesheets/alchemy/custom-properties.css +244 -0
- data/app/stylesheets/alchemy/welcome.scss +75 -0
- data/app/{assets/stylesheets → stylesheets}/tinymce/skins/content/alchemy/content.scss +8 -9
- data/app/stylesheets/tinymce/skins/ui/alchemy/content.scss +1 -0
- data/app/{assets/stylesheets → stylesheets}/tinymce/skins/ui/alchemy/skin.scss +133 -136
- data/app/views/alchemy/admin/attachments/_files_list.html.erb +2 -2
- data/app/views/alchemy/admin/attachments/_overlay_file_list.html.erb +1 -1
- data/app/views/alchemy/admin/{elements/_clipboard_button.html.erb → clipboard/_button.html.erb} +3 -5
- data/app/views/alchemy/admin/clipboard/_update_nested_element_button.turbo_stream.erb +11 -0
- data/app/views/alchemy/admin/clipboard/clear.turbo_stream.erb +4 -0
- data/app/views/alchemy/admin/clipboard/index.html.erb +15 -13
- data/app/views/alchemy/admin/clipboard/insert.turbo_stream.erb +18 -0
- data/app/views/alchemy/admin/clipboard/remove.turbo_stream.erb +9 -0
- data/app/views/alchemy/admin/dashboard/info.html.erb +17 -31
- data/app/views/alchemy/admin/elements/_element.html.erb +4 -8
- data/app/views/alchemy/admin/elements/_form.html.erb +1 -1
- data/app/views/alchemy/admin/elements/_header.html.erb +1 -0
- data/app/views/alchemy/admin/elements/_toolbar.html.erb +4 -6
- data/app/views/alchemy/admin/elements/create.turbo_stream.erb +2 -1
- data/app/views/alchemy/admin/elements/index.html.erb +2 -2
- data/app/views/alchemy/admin/ingredients/_file_fields.html.erb +3 -16
- data/app/views/alchemy/admin/ingredients/_picture_fields.html.erb +0 -9
- data/app/views/alchemy/admin/languages/_form.html.erb +1 -1
- data/app/views/alchemy/admin/languages/_table.html.erb +1 -1
- data/app/views/alchemy/admin/languages/index.html.erb +5 -2
- data/app/views/alchemy/admin/layoutpages/index.html.erb +1 -12
- data/app/views/alchemy/admin/pages/_form.html.erb +2 -2
- data/app/views/alchemy/admin/pages/_page.html.erb +2 -3
- data/app/views/alchemy/admin/pages/_toolbar.html.erb +1 -15
- data/app/views/alchemy/admin/pages/index.html.erb +1 -1
- data/app/views/alchemy/admin/partials/_remote_search_form.html.erb +9 -12
- data/app/views/alchemy/admin/partials/_search_form.html.erb +4 -9
- data/app/views/alchemy/admin/pictures/_archive.html.erb +4 -7
- data/app/views/alchemy/admin/pictures/_archive_overlay.html.erb +2 -1
- data/app/views/alchemy/admin/pictures/_filter_and_size_bar.html.erb +1 -1
- data/app/views/alchemy/admin/pictures/index.html.erb +2 -7
- data/app/views/alchemy/admin/resources/_applied_filters.html.erb +8 -0
- data/app/views/alchemy/admin/resources/_filter_bar.html.erb +11 -21
- data/app/views/alchemy/admin/resources/_pagination.html.erb +6 -0
- data/app/views/alchemy/admin/resources/_per_page_select.html.erb +4 -2
- data/app/views/alchemy/admin/resources/_resource_table.html.erb +1 -1
- data/app/views/alchemy/admin/resources/_table_header.html.erb +1 -15
- data/app/views/alchemy/admin/sites/index.html.erb +5 -1
- data/app/views/alchemy/admin/styleguide/index.html.erb +8 -0
- data/app/views/alchemy/admin/tags/index.html.erb +1 -1
- data/app/views/alchemy/admin/tinymce/_setup.html.erb +7 -7
- data/app/{javascript/alchemy_admin/locales/en.js → views/alchemy/admin/translations/_en.js} +5 -2
- data/app/views/alchemy/admin/uploader/_button.html.erb +1 -1
- data/app/views/alchemy/admin/uploader/_setup.html.erb +4 -4
- data/app/views/alchemy/base/redirect.js.erb +1 -1
- data/app/views/alchemy/ingredients/_number_editor.html.erb +24 -0
- data/app/views/alchemy/no_index.html.erb +31 -0
- data/app/views/alchemy/welcome.html.erb +12 -10
- data/app/views/kaminari/alchemy/_first_page.html.erb +5 -3
- data/app/views/kaminari/alchemy/_last_page.html.erb +5 -3
- data/app/views/kaminari/alchemy/_next_page.html.erb +5 -3
- data/app/views/kaminari/alchemy/_paginator.html.erb +18 -13
- data/app/views/kaminari/alchemy/_prev_page.html.erb +5 -3
- data/app/views/layouts/alchemy/admin.html.erb +5 -9
- data/bun.lockb +0 -0
- data/bundles/remixicon.mjs +153 -0
- data/config/alchemy/config.yml +3 -2
- data/config/initializers/dragonfly.rb +0 -1
- data/config/initializers/mime_types.rb +1 -0
- data/config/locales/alchemy.en.yml +32 -14
- data/config/routes.rb +0 -2
- data/eslint.config.js +2 -1
- data/lib/alchemy/admin/preview_url.rb +4 -5
- data/lib/alchemy/cache_digests/template_tracker.rb +6 -9
- data/lib/alchemy/config_missing.rb +14 -0
- data/lib/alchemy/configuration/base_option.rb +24 -0
- data/lib/alchemy/configuration/boolean_option.rb +16 -0
- data/lib/alchemy/configuration/class_option.rb +15 -0
- data/lib/alchemy/configuration/class_set_option.rb +46 -0
- data/lib/alchemy/configuration/integer_list_option.rb +13 -0
- data/lib/alchemy/configuration/integer_option.rb +12 -0
- data/lib/alchemy/configuration/list_option.rb +22 -0
- data/lib/alchemy/configuration/regexp_option.rb +11 -0
- data/lib/alchemy/configuration/string_list_option.rb +13 -0
- data/lib/alchemy/configuration/string_option.rb +11 -0
- data/lib/alchemy/configuration.rb +115 -0
- data/lib/alchemy/configuration_methods.rb +3 -1
- data/lib/alchemy/configurations/default_language.rb +12 -0
- data/lib/alchemy/configurations/default_site.rb +10 -0
- data/lib/alchemy/configurations/format_matchers.rb +11 -0
- data/lib/alchemy/configurations/mailer.rb +16 -0
- data/lib/alchemy/configurations/main.rb +216 -0
- data/lib/alchemy/configurations/preview.rb +32 -0
- data/lib/alchemy/configurations/sitemap.rb +10 -0
- data/lib/alchemy/configurations/uploader.rb +34 -0
- data/lib/alchemy/engine.rb +65 -17
- data/lib/alchemy/hints.rb +3 -7
- data/lib/alchemy/on_page_layout.rb +2 -2
- data/lib/alchemy/propshaft/tinymce_asset.rb +15 -0
- data/lib/alchemy/seeder.rb +2 -2
- data/lib/alchemy/tasks/usage.rb +4 -4
- data/lib/alchemy/test_support/config_stubbing.rb +1 -7
- data/lib/alchemy/test_support/factories/attachment_factory.rb +13 -2
- data/lib/alchemy/test_support/factories/language_factory.rb +1 -1
- data/lib/alchemy/test_support/factories/page_factory.rb +2 -3
- data/lib/alchemy/test_support/factories/picture_factory.rb +30 -2
- data/lib/alchemy/test_support/factories/site_factory.rb +2 -2
- data/lib/alchemy/test_support/having_crop_action_examples.rb +2 -2
- data/lib/alchemy/test_support/having_picture_thumbnails_examples.rb +80 -26
- data/lib/alchemy/test_support/shared_ingredient_examples.rb +5 -5
- data/lib/alchemy/upgrader/.keep +0 -0
- data/lib/alchemy/upgrader/eight_zero.rb +14 -0
- data/lib/alchemy/upgrader.rb +33 -20
- data/lib/alchemy/version.rb +1 -1
- data/lib/alchemy.rb +192 -170
- data/lib/alchemy_cms.rb +1 -7
- data/lib/generators/alchemy/ingredient/ingredient_generator.rb +0 -3
- data/lib/generators/alchemy/install/files/_article.html.erb +6 -4
- data/lib/generators/alchemy/install/files/alchemy.en.yml +22 -3
- data/lib/generators/alchemy/install/files/application.html.erb +5 -0
- data/lib/generators/alchemy/install/install_generator.rb +5 -14
- data/lib/generators/alchemy/install/templates/alchemy.rb.tt +196 -0
- data/lib/generators/alchemy/install/templates/dragonfly.rb.tt +0 -1
- data/lib/generators/alchemy/install/templates/elements.yml.tt +3 -1
- data/lib/generators/alchemy/install/templates/menus.yml.tt +1 -1
- data/lib/generators/alchemy/install/templates/page_layouts.yml.tt +2 -2
- data/lib/generators/alchemy/page_layouts/page_layouts_generator.rb +2 -2
- data/lib/tasks/alchemy/assets.rake +14 -0
- data/lib/tasks/alchemy/upgrade.rake +12 -47
- data/vendor/javascript/tinymce.min.js +1 -1
- data/vitest.config.js +21 -0
- metadata +181 -180
- data/app/assets/builds/alchemy/admin/page-select.css.map +0 -1
- data/app/assets/builds/alchemy/admin/print.css.map +0 -1
- data/app/assets/builds/alchemy/admin.css.map +0 -1
- data/app/assets/builds/alchemy/custom-properties.css.map +0 -1
- data/app/assets/builds/alchemy/welcome.css.map +0 -1
- data/app/assets/builds/tinymce/skins/content/alchemy/content.min.css.map +0 -1
- data/app/assets/builds/tinymce/skins/ui/alchemy/skin.min.css.map +0 -1
- data/app/assets/javascripts/alchemy/admin.js +0 -10
- data/app/assets/stylesheets/alchemy/_defaults.scss +0 -3
- data/app/assets/stylesheets/alchemy/_deprecated_variables.scss +0 -45
- data/app/assets/stylesheets/alchemy/_deprecation.scss +0 -17
- data/app/assets/stylesheets/alchemy/_extends.scss +0 -62
- data/app/assets/stylesheets/alchemy/_variables.scss +0 -201
- data/app/assets/stylesheets/alchemy/admin/buttons.scss +0 -124
- data/app/assets/stylesheets/alchemy/admin/hints.scss +0 -5
- data/app/assets/stylesheets/alchemy/admin/labels.scss +0 -3
- data/app/assets/stylesheets/alchemy/admin/pagination.scss +0 -92
- data/app/assets/stylesheets/alchemy/admin.scss +0 -42
- data/app/assets/stylesheets/alchemy/custom-properties.css +0 -98
- data/app/assets/stylesheets/alchemy/welcome.scss +0 -57
- data/app/assets/stylesheets/tinymce/skins/ui/alchemy/content.css +0 -711
- data/app/assets/stylesheets/tinymce/skins/ui/alchemy/content.inline.css +0 -705
- data/app/assets/stylesheets/tinymce/skins/ui/alchemy/content.inline.min.css +0 -7
- data/app/assets/stylesheets/tinymce/skins/ui/alchemy/content.min.css +0 -7
- data/app/assets/stylesheets/tinymce/skins/ui/alchemy/content.mobile.css +0 -29
- data/app/assets/stylesheets/tinymce/skins/ui/alchemy/content.mobile.min.css +0 -7
- data/app/assets/stylesheets/tinymce/skins/ui/alchemy/skin.mobile.css +0 -677
- data/app/assets/stylesheets/tinymce/skins/ui/alchemy/skin.mobile.min.css +0 -7
- data/app/controllers/alchemy/elements_controller.rb +0 -32
- data/app/models/alchemy/element/dom_id.rb +0 -31
- data/app/models/alchemy/picture/calculations.rb +0 -49
- data/app/models/alchemy/picture/transformations.rb +0 -115
- data/app/views/alchemy/admin/attachments/destroy.js.erb +0 -1
- data/app/views/alchemy/admin/clipboard/clear.js.erb +0 -3
- data/app/views/alchemy/admin/clipboard/insert.js.erb +0 -29
- data/app/views/alchemy/admin/clipboard/remove.js.erb +0 -10
- data/app/views/alchemy/admin/resources/_filter.html.erb +0 -12
- data/app/views/alchemy/admin/resources/_resource.html.erb +0 -34
- data/app/views/alchemy/admin/resources/_table.html.erb +0 -29
- data/app/views/alchemy/elements/show.html.erb +0 -1
- data/app/views/alchemy/elements/show.js.erb +0 -1
- data/app/views/alchemy/ingredients/_audio_view.html.erb +0 -1
- data/app/views/alchemy/ingredients/_boolean_view.html.erb +0 -1
- data/app/views/alchemy/ingredients/_datetime_view.html.erb +0 -3
- data/app/views/alchemy/ingredients/_file_view.html.erb +0 -4
- data/app/views/alchemy/ingredients/_headline_view.html.erb +0 -4
- data/app/views/alchemy/ingredients/_html_view.html.erb +0 -1
- data/app/views/alchemy/ingredients/_link_view.html.erb +0 -4
- data/app/views/alchemy/ingredients/_node_view.html.erb +0 -1
- data/app/views/alchemy/ingredients/_page_view.html.erb +0 -1
- data/app/views/alchemy/ingredients/_picture_view.html.erb +0 -4
- data/app/views/alchemy/ingredients/_richtext_view.html.erb +0 -3
- data/app/views/alchemy/ingredients/_select_view.html.erb +0 -1
- data/app/views/alchemy/ingredients/_text_view.html.erb +0 -4
- data/app/views/alchemy/ingredients/_video_view.html.erb +0 -3
- data/babel.config.js +0 -12
- data/config/initializers/assets.rb +0 -4
- data/lib/alchemy/config.rb +0 -114
- data/lib/alchemy/element_definition.rb +0 -73
- data/lib/alchemy/page_layout.rb +0 -73
- data/lib/alchemy/resource_filter.rb +0 -40
- data/lib/alchemy/upgrader/seven_point_four.rb +0 -26
- data/lib/alchemy/upgrader/seven_point_three.rb +0 -52
- data/lib/generators/alchemy/ingredient/templates/view.html.erb +0 -1
- data/lib/generators/alchemy/install/files/alchemy_admin.js +0 -1
- data/lib/generators/alchemy/install/files/all.js +0 -11
- data/lib/generators/alchemy/install/files/article.css +0 -25
- data/vendor/assets/images/remixicon.symbol.svg +0 -11
- /data/app/{assets/stylesheets → stylesheets}/alchemy/_fonts.scss +0 -0
- /data/app/{assets/stylesheets → stylesheets}/alchemy/admin/attachment-select.scss +0 -0
- /data/app/{assets/stylesheets → stylesheets}/alchemy/admin/attachments.scss +0 -0
- /data/app/{assets/stylesheets → stylesheets}/alchemy/admin/flash.scss +0 -0
- /data/app/{assets/stylesheets → stylesheets}/alchemy/admin/list_filter.scss +0 -0
- /data/app/{assets/stylesheets → stylesheets}/alchemy/admin/node-select.scss +0 -0
- /data/app/{assets/stylesheets → stylesheets}/alchemy/admin/spinner.scss +0 -0
- /data/app/{assets/stylesheets → stylesheets}/tinymce/skins/skintool.json +0 -0
- /data/app/{assets/stylesheets → stylesheets}/tinymce/skins/ui/alchemy/fonts/tinymce-mobile.woff +0 -0
@@ -86,8 +86,8 @@ RSpec.shared_examples_for "having picture thumbnails" do
|
|
86
86
|
allow(record).to receive(:settings) { {} }
|
87
87
|
end
|
88
88
|
|
89
|
-
it "
|
90
|
-
expect(picture_url).
|
89
|
+
it "does not add them to the url" do
|
90
|
+
expect(picture_url).to_not match(/\?foo=baz/)
|
91
91
|
end
|
92
92
|
end
|
93
93
|
end
|
@@ -112,7 +112,7 @@ RSpec.shared_examples_for "having picture thumbnails" do
|
|
112
112
|
describe "#picture_url_options" do
|
113
113
|
subject(:picture_url_options) { record.picture_url_options }
|
114
114
|
|
115
|
-
let(:picture) {
|
115
|
+
let(:picture) { build(:alchemy_picture) }
|
116
116
|
|
117
117
|
it { is_expected.to be_a(HashWithIndifferentAccess) }
|
118
118
|
|
@@ -418,7 +418,7 @@ RSpec.shared_examples_for "having picture thumbnails" do
|
|
418
418
|
end
|
419
419
|
|
420
420
|
context "with picture assigned" do
|
421
|
-
let(:picture) {
|
421
|
+
let(:picture) { build(:alchemy_picture) }
|
422
422
|
|
423
423
|
let(:default_mask) do
|
424
424
|
[
|
@@ -432,8 +432,8 @@ RSpec.shared_examples_for "having picture thumbnails" do
|
|
432
432
|
let(:settings) { {} }
|
433
433
|
|
434
434
|
before do
|
435
|
-
picture.image_file_width
|
436
|
-
picture.image_file_height
|
435
|
+
allow(picture).to receive(:image_file_width) { 300 }
|
436
|
+
allow(picture).to receive(:image_file_height) { 250 }
|
437
437
|
allow(record).to receive(:settings) { settings }
|
438
438
|
end
|
439
439
|
|
@@ -555,8 +555,8 @@ RSpec.shared_examples_for "having picture thumbnails" do
|
|
555
555
|
let(:settings) { {crop: true, size: size} }
|
556
556
|
|
557
557
|
before do
|
558
|
-
picture.image_file_width
|
559
|
-
picture.image_file_height
|
558
|
+
allow(picture).to receive(:image_file_width) { 200 }
|
559
|
+
allow(picture).to receive(:image_file_height) { 100 }
|
560
560
|
end
|
561
561
|
|
562
562
|
context "size 200x50" do
|
@@ -619,45 +619,99 @@ RSpec.shared_examples_for "having picture thumbnails" do
|
|
619
619
|
end
|
620
620
|
|
621
621
|
describe "#allow_image_cropping?" do
|
622
|
-
let(:picture)
|
623
|
-
|
622
|
+
let(:picture) { Alchemy::Picture.new }
|
623
|
+
let(:image_file_width) { 400 }
|
624
|
+
let(:image_file_height) { 300 }
|
625
|
+
let(:crop) { false }
|
626
|
+
let(:size) { "400x300" }
|
627
|
+
let(:upsample) { false }
|
628
|
+
|
629
|
+
before do
|
630
|
+
allow(picture).to receive(:image_file_width) { image_file_width }
|
631
|
+
allow(picture).to receive(:image_file_height) { image_file_height }
|
632
|
+
allow(record).to receive(:settings) { {crop:, size:, upsample:} }
|
624
633
|
end
|
625
634
|
|
626
635
|
subject { record.allow_image_cropping? }
|
627
636
|
|
628
|
-
|
637
|
+
shared_context "with image file" do
|
638
|
+
before do
|
639
|
+
if Alchemy.storage_adapter.dragonfly?
|
640
|
+
expect(picture).to receive(:image_file) { fixture_file_upload("image.png") }
|
641
|
+
elsif Alchemy.storage_adapter.active_storage?
|
642
|
+
expect(picture.image_file).to receive(:attached?) { true }
|
643
|
+
end
|
644
|
+
end
|
645
|
+
end
|
629
646
|
|
630
|
-
|
647
|
+
shared_context "without image file" do
|
631
648
|
before do
|
632
|
-
|
649
|
+
if Alchemy.storage_adapter.dragonfly?
|
650
|
+
expect(picture).to receive(:image_file) { nil }
|
651
|
+
elsif Alchemy.storage_adapter.active_storage?
|
652
|
+
expect(picture.image_file).to receive(:attached?) { false }
|
653
|
+
end
|
633
654
|
end
|
655
|
+
end
|
656
|
+
|
657
|
+
context "with crop set to false" do
|
658
|
+
let(:crop) { false }
|
634
659
|
|
635
660
|
it { is_expected.to be_falsy }
|
661
|
+
end
|
662
|
+
|
663
|
+
context "with crop set to true" do
|
664
|
+
let(:crop) { true }
|
636
665
|
|
637
|
-
context "
|
666
|
+
context "with picture assigned" do
|
638
667
|
before do
|
639
|
-
allow(
|
668
|
+
allow(record).to receive(:picture) { picture }
|
640
669
|
end
|
641
670
|
|
642
|
-
|
671
|
+
context "and image smaller or equal to crop size" do
|
672
|
+
context "if picture.image_file is nil" do
|
673
|
+
include_context "without image file"
|
643
674
|
|
644
|
-
|
645
|
-
before do
|
646
|
-
allow(record).to receive(:settings) { {crop: true} }
|
675
|
+
it { is_expected.to be_falsy }
|
647
676
|
end
|
648
677
|
|
649
|
-
context "if picture.image_file is
|
650
|
-
|
651
|
-
expect(picture).to receive(:image_file) { nil }
|
652
|
-
end
|
678
|
+
context "if picture.image_file is present" do
|
679
|
+
include_context "with image file"
|
653
680
|
|
654
681
|
it { is_expected.to be_falsy }
|
682
|
+
|
683
|
+
context "but with upsample set to true" do
|
684
|
+
let(:upsample) { true }
|
685
|
+
|
686
|
+
it { is_expected.to be(true) }
|
687
|
+
end
|
655
688
|
end
|
689
|
+
end
|
656
690
|
|
657
|
-
|
658
|
-
|
691
|
+
context "and with image larger than crop size" do
|
692
|
+
let(:image_file_width) { 1201 }
|
693
|
+
let(:image_file_height) { 481 }
|
694
|
+
|
695
|
+
it { is_expected.to be_falsy }
|
659
696
|
|
660
|
-
|
697
|
+
context "with crop set to true" do
|
698
|
+
context "if picture.image_file is nil" do
|
699
|
+
include_context "without image file"
|
700
|
+
|
701
|
+
it { is_expected.to be_falsy }
|
702
|
+
end
|
703
|
+
|
704
|
+
context "if picture.image_file is present" do
|
705
|
+
include_context "with image file"
|
706
|
+
|
707
|
+
it { is_expected.to be(true) }
|
708
|
+
|
709
|
+
context "with size setting being nil" do
|
710
|
+
let(:size) { nil }
|
711
|
+
|
712
|
+
it { is_expected.to be_falsey }
|
713
|
+
end
|
714
|
+
end
|
661
715
|
end
|
662
716
|
end
|
663
717
|
end
|
@@ -29,11 +29,11 @@ RSpec.shared_examples_for "an alchemy ingredient" do
|
|
29
29
|
context "with element" do
|
30
30
|
before do
|
31
31
|
expect(element).to receive(:ingredient_definition_for).at_least(:once) do
|
32
|
-
|
32
|
+
Alchemy::IngredientDefinition.new(
|
33
33
|
settings: {
|
34
34
|
linkable: true
|
35
35
|
}
|
36
|
-
|
36
|
+
)
|
37
37
|
end
|
38
38
|
end
|
39
39
|
|
@@ -47,19 +47,19 @@ RSpec.shared_examples_for "an alchemy ingredient" do
|
|
47
47
|
context "without element" do
|
48
48
|
let(:element) { nil }
|
49
49
|
|
50
|
-
it { is_expected.to
|
50
|
+
it { is_expected.to be_a(Alchemy::IngredientDefinition) }
|
51
51
|
end
|
52
52
|
|
53
53
|
context "with element" do
|
54
54
|
let(:definition) do
|
55
|
-
|
55
|
+
Alchemy::IngredientDefinition.new(
|
56
56
|
role: "headline",
|
57
57
|
type: "Text",
|
58
58
|
default: "Hello World",
|
59
59
|
settings: {
|
60
60
|
linkable: true
|
61
61
|
}
|
62
|
-
|
62
|
+
)
|
63
63
|
end
|
64
64
|
|
65
65
|
before do
|
File without changes
|
@@ -0,0 +1,14 @@
|
|
1
|
+
module Alchemy
|
2
|
+
class Upgrader
|
3
|
+
module EightZero
|
4
|
+
def mention_alchemy_config_initializer
|
5
|
+
todo <<~TEXT, "Configuration has changed to initializer"
|
6
|
+
Check the new configuration file `./config/initializers/alchemy.rb` and
|
7
|
+
update values from your `config/alchemy/config.yml` file.
|
8
|
+
|
9
|
+
Then you can safely remove the `config/alchemy/config.yml` file.
|
10
|
+
TEXT
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
data/lib/alchemy/upgrader.rb
CHANGED
@@ -1,29 +1,42 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require "alchemy/shell"
|
4
|
+
require "thor"
|
4
5
|
|
5
6
|
module Alchemy
|
6
7
|
class Upgrader
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
8
|
+
include Alchemy::Shell
|
9
|
+
include Thor::Base
|
10
|
+
include Thor::Actions
|
11
|
+
|
12
|
+
Dir["#{File.dirname(__FILE__)}/upgrader/*.rb"].sort.each { require(_1) }
|
13
|
+
|
14
|
+
VERSION_MODULE_MAP = {
|
15
|
+
"8.0" => "Alchemy::Upgrader::EightZero"
|
16
|
+
}
|
17
|
+
|
18
|
+
source_root Alchemy::Engine.root.join("lib/generators/alchemy/install")
|
19
|
+
|
20
|
+
def initialize(version)
|
21
|
+
super()
|
22
|
+
self.class.include VERSION_MODULE_MAP[version.to_s].constantize
|
23
|
+
end
|
24
|
+
|
25
|
+
def update_config
|
26
|
+
desc "Copy configuration file."
|
27
|
+
@default_config = Alchemy::Configurations::Main.new
|
28
|
+
template("templates/alchemy.rb.tt", "config/initializers/alchemy.rb")
|
29
|
+
end
|
30
|
+
|
31
|
+
def run_migrations
|
32
|
+
ActiveRecord::Migration.check_all_pending!
|
33
|
+
rescue ActiveRecord::PendingMigrationError
|
34
|
+
desc "Pending Database migrations."
|
35
|
+
if yes?("Run database migrations now? (y/N)")
|
36
|
+
log "Migrating Database..."
|
37
|
+
Rake::Task["db:migrate"].invoke
|
38
|
+
else
|
39
|
+
log "Don't forget to run database migrations later with rake `db:migrate`.", :skip
|
27
40
|
end
|
28
41
|
end
|
29
42
|
end
|
data/lib/alchemy/version.rb
CHANGED
data/lib/alchemy.rb
CHANGED
@@ -2,190 +2,212 @@
|
|
2
2
|
|
3
3
|
require "alchemy/admin/preview_url"
|
4
4
|
require "importmap-rails"
|
5
|
+
require "alchemy/configurations/main"
|
6
|
+
require "alchemy/config_missing"
|
5
7
|
|
6
8
|
module Alchemy
|
9
|
+
include Alchemy::ConfigMissing
|
10
|
+
extend Alchemy::ConfigMissing
|
11
|
+
|
7
12
|
YAML_PERMITTED_CLASSES = %w[Symbol Date Regexp]
|
8
13
|
|
9
|
-
#
|
10
|
-
|
11
|
-
|
12
|
-
# that is used as source for the preview frame in the
|
13
|
-
# admin UI.
|
14
|
-
#
|
15
|
-
# == Example
|
16
|
-
#
|
17
|
-
# # lib/acme/preview_source.rb
|
18
|
-
# class Acme::PreviewSource < Alchemy::Admin::PreviewUrl
|
19
|
-
# def url_for(page)
|
20
|
-
# if page.site.name == "Next"
|
21
|
-
# "https://user:#{ENV['PREVIEW_HTTP_PASS']}@next.acme.com"
|
22
|
-
# else
|
23
|
-
# "https://www.acme.com"
|
24
|
-
# end
|
25
|
-
# end
|
26
|
-
# end
|
27
|
-
#
|
28
|
-
# # config/initializers/alchemy.rb
|
29
|
-
# require "acme/preview_source"
|
30
|
-
# Alchemy.preview_sources << Acme::PreviewSource
|
31
|
-
#
|
32
|
-
# # config/locales/de.yml
|
33
|
-
# de:
|
34
|
-
# activemodel:
|
35
|
-
# models:
|
36
|
-
# acme/preview_source: Acme Vorschau
|
37
|
-
#
|
38
|
-
def self.preview_sources
|
39
|
-
@_preview_sources ||= Set.new << Alchemy::Admin::PreviewUrl
|
40
|
-
end
|
14
|
+
# JS Importmap instance
|
15
|
+
singleton_class.attr_accessor :importmap
|
16
|
+
self.importmap = Importmap::Map.new
|
41
17
|
|
42
|
-
|
43
|
-
|
44
|
-
|
18
|
+
class << self
|
19
|
+
def config
|
20
|
+
@_config ||= Alchemy::Configurations::Main.new
|
21
|
+
end
|
45
22
|
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
#
|
50
|
-
# == Example
|
51
|
-
#
|
52
|
-
# Alchemy.importmap.pin "flatpickr/de",
|
53
|
-
# to: "https://ga.jspm.io/npm:flatpickr@4.6.13/dist/l10n/de.js"
|
54
|
-
#
|
55
|
-
# Alchemy.admin_js_imports << "flatpickr/de"
|
56
|
-
#
|
57
|
-
def self.admin_js_imports
|
58
|
-
@_admin_js_imports ||= Set.new
|
59
|
-
end
|
23
|
+
def configure(&blk)
|
24
|
+
yield config
|
25
|
+
end
|
60
26
|
|
61
|
-
|
62
|
-
|
63
|
-
|
27
|
+
enable_searchable_deprecation_msg = "Use `Alchemy.config.show_page_searchable_checkbox` instead."
|
28
|
+
def enable_searchable = config.show_page_searchable_checkbox
|
29
|
+
deprecate :enable_searchable= => enable_searchable_deprecation_msg, :deprecator => Alchemy::Deprecation
|
64
30
|
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
# == Example
|
70
|
-
#
|
71
|
-
# # config/alchemy/importmap.rb
|
72
|
-
# Alchemy.importmap.pin "alchemy_solidus", to: "alchemy_solidus.js", preload: true
|
73
|
-
# Alchemy.importmap.pin_all_from Alchemy::Solidus::Engine.root.join("app/javascript/alchemy_solidus"),
|
74
|
-
# under: "alchemy_solidus",
|
75
|
-
# preload: true
|
76
|
-
#
|
77
|
-
# # lib/alchemy/solidus/engine.rb
|
78
|
-
# initializer "alchemy_solidus.assets", before: "alchemy.importmap" do |app|
|
79
|
-
# Alchemy.admin_importmaps.add({
|
80
|
-
# importmap_path: root.join("config/importmap.rb"),
|
81
|
-
# source_paths: [
|
82
|
-
# root.join("app/javascript")
|
83
|
-
# ],
|
84
|
-
# name: "alchemy_solidus"
|
85
|
-
# })
|
86
|
-
# app.config.assets.precompile << "alchemy_solidus/manifest.js"
|
87
|
-
# end
|
88
|
-
#
|
89
|
-
# @return [Set<Hash>]
|
90
|
-
def self.admin_importmaps
|
91
|
-
@_admin_importmaps ||= Set.new([{
|
92
|
-
importmap_path: Engine.root.join("config/importmap.rb"),
|
93
|
-
source_paths: [
|
94
|
-
Engine.root.join("app/javascript"),
|
95
|
-
Engine.root.join("vendor/javascript")
|
96
|
-
],
|
97
|
-
name: "alchemy_admin"
|
98
|
-
}])
|
99
|
-
end
|
31
|
+
def enable_searchable=(other)
|
32
|
+
config.show_page_searchable_checkbox = other
|
33
|
+
end
|
34
|
+
deprecate enable_searchable: enable_searchable_deprecation_msg, deprecator: Alchemy::Deprecation
|
100
35
|
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
36
|
+
# Define page preview sources
|
37
|
+
#
|
38
|
+
# A preview source is a Ruby class returning an URL
|
39
|
+
# that is used as source for the preview frame in the
|
40
|
+
# admin UI.
|
41
|
+
#
|
42
|
+
# == Example
|
43
|
+
#
|
44
|
+
# # lib/acme/preview_source.rb
|
45
|
+
# class Acme::PreviewSource < Alchemy::Admin::PreviewUrl
|
46
|
+
# def url_for(page)
|
47
|
+
# if page.site.name == "Next"
|
48
|
+
# "https://user:#{ENV['PREVIEW_HTTP_PASS']}@next.acme.com"
|
49
|
+
# else
|
50
|
+
# "https://www.acme.com"
|
51
|
+
# end
|
52
|
+
# end
|
53
|
+
# end
|
54
|
+
#
|
55
|
+
# # config/initializers/alchemy.rb
|
56
|
+
# require "acme/preview_source"
|
57
|
+
# Alchemy.preview_sources << Acme::PreviewSource
|
58
|
+
#
|
59
|
+
# # config/locales/de.yml
|
60
|
+
# de:
|
61
|
+
# activemodel:
|
62
|
+
# models:
|
63
|
+
# acme/preview_source: Acme Vorschau
|
64
|
+
#
|
65
|
+
def preview_sources
|
66
|
+
@_preview_sources ||= Set.new << Alchemy::Admin::PreviewUrl
|
67
|
+
end
|
114
68
|
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
# whenever a user clicks the publish page button.
|
119
|
-
#
|
120
|
-
# Use this to trigger deployment hooks of external
|
121
|
-
# services in an asychronous way.
|
122
|
-
#
|
123
|
-
# == Example
|
124
|
-
#
|
125
|
-
# # app/jobs/publish_job.rb
|
126
|
-
# class PublishJob < ApplicationJob
|
127
|
-
# def perform(page)
|
128
|
-
# RestClient.post(ENV['BUILD_HOOK_URL'])
|
129
|
-
# end
|
130
|
-
# end
|
131
|
-
#
|
132
|
-
# # config/initializers/alchemy.rb
|
133
|
-
# Alchemy.publish_targets << PublishJob
|
134
|
-
#
|
135
|
-
def self.publish_targets
|
136
|
-
@_publish_targets ||= Set.new
|
137
|
-
end
|
69
|
+
def preview_sources=(sources)
|
70
|
+
@_preview_sources = Array(sources)
|
71
|
+
end
|
138
72
|
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
73
|
+
# Additional JS modules to be imported in the Alchemy admin UI
|
74
|
+
#
|
75
|
+
# Be sure to also pin the modules with +Alchemy.importmap+.
|
76
|
+
#
|
77
|
+
# == Example
|
78
|
+
#
|
79
|
+
# Alchemy.importmap.pin "flatpickr/de",
|
80
|
+
# to: "https://ga.jspm.io/npm:flatpickr@4.6.13/dist/l10n/de.js"
|
81
|
+
#
|
82
|
+
# Alchemy.admin_js_imports << "flatpickr/de"
|
83
|
+
#
|
84
|
+
def admin_js_imports
|
85
|
+
@_admin_js_imports ||= Set.new
|
86
|
+
end
|
151
87
|
|
152
|
-
|
153
|
-
|
154
|
-
|
88
|
+
def admin_js_imports=(sources)
|
89
|
+
@_admin_js_imports = Set[sources]
|
90
|
+
end
|
155
91
|
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
92
|
+
# Additional importmaps to be included in the Alchemy admin UI
|
93
|
+
#
|
94
|
+
# Be sure to also pin modules with +Alchemy.importmap+.
|
95
|
+
#
|
96
|
+
# == Example
|
97
|
+
#
|
98
|
+
# # config/alchemy/importmap.rb
|
99
|
+
# Alchemy.importmap.pin "alchemy_solidus", to: "alchemy_solidus.js", preload: true
|
100
|
+
# Alchemy.importmap.pin_all_from Alchemy::Solidus::Engine.root.join("app/javascript/alchemy_solidus"),
|
101
|
+
# under: "alchemy_solidus",
|
102
|
+
# preload: true
|
103
|
+
#
|
104
|
+
# # lib/alchemy/solidus/engine.rb
|
105
|
+
# initializer "alchemy_solidus.assets", before: "alchemy.importmap" do |app|
|
106
|
+
# Alchemy.admin_importmaps.add({
|
107
|
+
# importmap_path: root.join("config/importmap.rb"),
|
108
|
+
# source_paths: [
|
109
|
+
# root.join("app/javascript")
|
110
|
+
# ],
|
111
|
+
# name: "alchemy_solidus"
|
112
|
+
# })
|
113
|
+
# app.config.assets.precompile << "alchemy_solidus/manifest.js"
|
114
|
+
# end
|
115
|
+
#
|
116
|
+
# @return [Set<Hash>]
|
117
|
+
def admin_importmaps
|
118
|
+
@_admin_importmaps ||= Set.new([{
|
119
|
+
importmap_path: Engine.root.join("config/importmap.rb"),
|
120
|
+
source_paths: [
|
121
|
+
Engine.root.join("app/javascript"),
|
122
|
+
Engine.root.join("vendor/javascript")
|
123
|
+
],
|
124
|
+
name: "alchemy_admin"
|
125
|
+
}])
|
126
|
+
end
|
127
|
+
|
128
|
+
# Additional stylesheets to be included in the Alchemy admin UI
|
129
|
+
#
|
130
|
+
# == Example
|
131
|
+
#
|
132
|
+
# # lib/alchemy/devise/engine.rb
|
133
|
+
# initializer "alchemy.devise.stylesheets", before: "alchemy.admin_stylesheets" do
|
134
|
+
# Alchemy.admin_stylesheets << "alchemy/devise/admin.css"
|
135
|
+
# end
|
136
|
+
#
|
137
|
+
# @return [Set<String>]
|
138
|
+
def admin_stylesheets
|
139
|
+
@_admin_stylesheets ||= Set.new(["alchemy/admin/custom.css"])
|
140
|
+
end
|
141
|
+
|
142
|
+
# Define page publish targets
|
143
|
+
#
|
144
|
+
# A publish target is a ActiveJob that gets performed
|
145
|
+
# whenever a user clicks the publish page button.
|
146
|
+
#
|
147
|
+
# Use this to trigger deployment hooks of external
|
148
|
+
# services in an asychronous way.
|
149
|
+
#
|
150
|
+
# == Example
|
151
|
+
#
|
152
|
+
# # app/jobs/publish_job.rb
|
153
|
+
# class PublishJob < ApplicationJob
|
154
|
+
# def perform(page)
|
155
|
+
# RestClient.post(ENV['BUILD_HOOK_URL'])
|
156
|
+
# end
|
157
|
+
# end
|
158
|
+
#
|
159
|
+
# # config/initializers/alchemy.rb
|
160
|
+
# Alchemy.publish_targets << PublishJob
|
161
|
+
#
|
162
|
+
def publish_targets
|
163
|
+
@_publish_targets ||= Set.new
|
164
|
+
end
|
165
|
+
|
166
|
+
# Configure tabs in the link dialog
|
167
|
+
#
|
168
|
+
# With this configuration that tabs in the link dialog can be extended
|
169
|
+
# without overwriting or defacing the Admin Interface.
|
170
|
+
#
|
171
|
+
# == Example
|
172
|
+
#
|
173
|
+
# # components/acme/link_tab.rb
|
174
|
+
# module Acme
|
175
|
+
# class LinkTab < ::Alchemy::Admin::LinkDialog::BaseTab
|
176
|
+
# def title
|
177
|
+
# "Awesome Tab Title"
|
178
|
+
# end
|
179
|
+
#
|
180
|
+
# def name
|
181
|
+
# :unique_name
|
182
|
+
# end
|
183
|
+
#
|
184
|
+
# def fields
|
185
|
+
# [ title_input, target_select ]
|
186
|
+
# end
|
187
|
+
# end
|
188
|
+
# end
|
189
|
+
#
|
190
|
+
# # config/initializers/alchemy.rb
|
191
|
+
# Alchemy.link_dialog_tabs << Acme::LinkTab
|
192
|
+
#
|
193
|
+
def link_dialog_tabs
|
194
|
+
@_link_dialog_tabs ||= Set.new([
|
195
|
+
Alchemy::Admin::LinkDialog::InternalTab,
|
196
|
+
Alchemy::Admin::LinkDialog::AnchorTab,
|
197
|
+
Alchemy::Admin::LinkDialog::ExternalTab,
|
198
|
+
Alchemy::Admin::LinkDialog::FileTab
|
199
|
+
])
|
200
|
+
end
|
201
|
+
end
|
202
|
+
|
203
|
+
# The storage adapter for Pictures and Attachments
|
179
204
|
#
|
180
|
-
#
|
181
|
-
# Alchemy.link_dialog_tabs << Acme::LinkTab
|
205
|
+
# Chose between 'active_storage' (default) or 'dragonfly' (legacy)
|
182
206
|
#
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
Alchemy
|
187
|
-
|
188
|
-
Alchemy::Admin::LinkDialog::FileTab
|
189
|
-
])
|
207
|
+
# Can be set via 'ALCHEMY_STORAGE_ADAPTER' env var.
|
208
|
+
def self.storage_adapter
|
209
|
+
@_storage_adapter ||= Alchemy::StorageAdapter.new(
|
210
|
+
ENV.fetch("ALCHEMY_STORAGE_ADAPTER", Alchemy.config.storage_adapter)
|
211
|
+
)
|
190
212
|
end
|
191
213
|
end
|