alchemy_cms 8.0.6 → 8.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +14 -10
- data/app/assets/builds/alchemy/admin.css +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/{views/alchemy/admin/elements/_element.html.erb → components/alchemy/admin/element_editor.html.erb} +34 -29
- data/app/components/alchemy/admin/element_editor.rb +115 -0
- data/app/components/alchemy/admin/element_select.rb +12 -9
- data/app/components/alchemy/admin/ingredient_editor.rb +54 -0
- data/app/components/alchemy/admin/list_filter.rb +16 -5
- data/app/components/alchemy/admin/page_node.html.erb +214 -0
- data/app/components/alchemy/admin/page_node.rb +70 -0
- data/app/components/alchemy/admin/picture_thumbnail.rb +36 -0
- data/app/components/alchemy/admin/publish_page_button.html.erb +15 -0
- data/app/components/alchemy/admin/publish_page_button.rb +54 -0
- data/app/{helpers/alchemy/admin/tags_helper.rb → components/alchemy/admin/tags_list.rb} +19 -11
- data/app/components/alchemy/admin/toolbar_button.rb +16 -12
- data/app/components/alchemy/ingredients/audio_editor.rb +8 -0
- data/app/components/alchemy/ingredients/base_editor.rb +222 -0
- data/app/components/alchemy/ingredients/boolean_editor.rb +21 -0
- data/app/components/alchemy/ingredients/color_editor.rb +80 -0
- data/app/components/alchemy/ingredients/color_view.rb +13 -0
- data/app/components/alchemy/ingredients/datetime_editor.rb +28 -0
- data/app/components/alchemy/ingredients/file_editor.rb +69 -0
- data/app/components/alchemy/ingredients/headline_editor.rb +88 -0
- data/app/components/alchemy/ingredients/html_editor.rb +11 -0
- data/app/components/alchemy/ingredients/link_editor.rb +29 -0
- data/app/components/alchemy/ingredients/node_editor.rb +23 -0
- data/app/components/alchemy/ingredients/number_editor.rb +28 -0
- data/app/components/alchemy/ingredients/page_editor.rb +19 -0
- data/app/components/alchemy/ingredients/picture_editor.rb +81 -0
- data/app/components/alchemy/ingredients/richtext_editor.rb +31 -0
- data/app/components/alchemy/ingredients/select_editor.rb +37 -0
- data/app/components/alchemy/ingredients/select_view.rb +7 -0
- data/app/components/alchemy/ingredients/text_editor.rb +41 -0
- data/app/components/alchemy/ingredients/video_editor.rb +8 -0
- data/app/controllers/alchemy/admin/attachments_controller.rb +8 -6
- data/app/controllers/alchemy/admin/base_controller.rb +7 -18
- data/app/controllers/alchemy/admin/clipboard_controller.rb +15 -11
- data/app/controllers/alchemy/admin/dashboard_controller.rb +2 -2
- data/app/controllers/alchemy/admin/elements_controller.rb +34 -32
- data/app/controllers/alchemy/admin/ingredients_controller.rb +1 -0
- data/app/controllers/alchemy/admin/layoutpages_controller.rb +2 -1
- data/app/controllers/alchemy/admin/legacy_page_urls_controller.rb +1 -1
- data/app/controllers/alchemy/admin/nodes_controller.rb +24 -1
- data/app/controllers/alchemy/admin/pages_controller.rb +31 -41
- data/app/controllers/alchemy/admin/pictures_controller.rb +2 -5
- data/app/controllers/alchemy/admin/resources_controller.rb +1 -1
- data/app/controllers/alchemy/api/ingredients_controller.rb +1 -1
- data/app/controllers/alchemy/api/pages_controller.rb +5 -3
- data/app/controllers/alchemy/base_controller.rb +6 -6
- data/app/controllers/alchemy/pages_controller.rb +12 -6
- data/app/controllers/concerns/alchemy/admin/archive_overlay.rb +0 -1
- data/app/controllers/concerns/alchemy/admin/clipboard.rb +57 -0
- data/app/controllers/concerns/alchemy/admin/uploader_responses.rb +2 -2
- data/app/controllers/concerns/alchemy/site_redirects.rb +1 -1
- data/app/decorators/alchemy/ingredient_editor.rb +37 -4
- data/app/helpers/alchemy/admin/base_helper.rb +12 -7
- data/app/helpers/alchemy/admin/ingredients_helper.rb +6 -3
- data/app/helpers/alchemy/base_helper.rb +1 -1
- data/app/helpers/alchemy/pages_helper.rb +1 -1
- data/app/javascript/alchemy_admin/components/action.js +5 -1
- data/app/javascript/alchemy_admin/components/color_select.js +73 -0
- data/app/javascript/alchemy_admin/components/element_editor/delete_element_button.js +11 -3
- data/app/javascript/alchemy_admin/components/element_editor/publish_element_button.js +7 -2
- data/app/javascript/alchemy_admin/components/element_editor.js +11 -12
- data/app/javascript/alchemy_admin/components/element_select.js +39 -17
- data/app/javascript/alchemy_admin/components/elements_window.js +0 -2
- data/app/javascript/alchemy_admin/components/file_editor.js +26 -0
- data/app/javascript/alchemy_admin/components/index.js +9 -0
- data/app/javascript/alchemy_admin/components/list_filter.js +57 -8
- data/app/javascript/alchemy_admin/components/message.js +9 -3
- data/app/javascript/alchemy_admin/components/page_node.js +119 -0
- data/app/javascript/alchemy_admin/{page_publication_fields.js → components/page_publication_fields.js} +9 -8
- data/app/javascript/alchemy_admin/{picture_editors.js → components/picture_editor.js} +30 -45
- data/app/javascript/alchemy_admin/components/picture_thumbnail.js +107 -0
- data/app/javascript/alchemy_admin/components/publish_page_button.js +41 -0
- data/app/javascript/alchemy_admin/components/select.js +3 -1
- data/app/javascript/alchemy_admin/components/sitemap.js +210 -0
- data/app/javascript/alchemy_admin/{sortable_elements.js → components/sortable_elements.js} +22 -25
- data/app/javascript/alchemy_admin/components/tinymce.js +10 -5
- data/app/javascript/alchemy_admin/components/update_check.js +1 -1
- data/app/javascript/alchemy_admin/components/uploader.js +30 -0
- data/app/javascript/alchemy_admin/image_overlay.js +0 -2
- data/app/javascript/alchemy_admin/initializer.js +0 -3
- data/app/javascript/alchemy_admin/templates/compiled.js +1 -1
- data/app/javascript/alchemy_admin/utils/ajax.js +15 -3
- data/app/javascript/alchemy_admin.js +0 -6
- data/app/models/alchemy/attachment.rb +4 -4
- data/app/models/alchemy/element/definitions.rb +1 -2
- data/app/models/alchemy/element/element_ingredients.rb +6 -2
- data/app/models/alchemy/element.rb +55 -13
- data/app/models/alchemy/element_definition.rb +5 -1
- data/app/models/alchemy/elements_repository.rb +6 -0
- data/app/models/alchemy/folded_page.rb +2 -2
- data/app/models/alchemy/ingredient.rb +38 -1
- data/app/models/alchemy/ingredient_definition.rb +5 -1
- data/app/models/alchemy/ingredient_validator.rb +6 -2
- data/app/models/alchemy/ingredients/color.rb +10 -0
- data/app/models/alchemy/ingredients/headline.rb +2 -17
- data/app/models/alchemy/ingredients/picture.rb +4 -4
- data/app/models/alchemy/ingredients/select.rb +19 -0
- data/app/models/alchemy/node.rb +28 -1
- data/app/models/alchemy/page/page_naming.rb +0 -7
- data/app/models/alchemy/page/page_natures.rb +7 -3
- data/app/models/alchemy/page/page_scopes.rb +1 -1
- data/app/models/alchemy/page/publisher.rb +14 -2
- data/app/models/alchemy/page.rb +102 -23
- data/app/models/alchemy/page_definition.rb +4 -1
- data/app/models/alchemy/page_version.rb +22 -6
- data/app/models/alchemy/picture.rb +10 -11
- data/app/models/alchemy/picture_variant.rb +1 -3
- data/app/models/alchemy/resource.rb +1 -1
- data/app/models/alchemy/storage_adapter/active_storage.rb +14 -2
- data/app/models/alchemy/storage_adapter/dragonfly.rb +12 -0
- data/app/models/alchemy/storage_adapter.rb +2 -0
- data/app/models/concerns/alchemy/picture_thumbnails.rb +4 -4
- data/app/models/concerns/alchemy/publishable.rb +54 -0
- data/app/serializers/alchemy/page_tree_serializer.rb +11 -31
- data/app/services/alchemy/copy_page.rb +17 -0
- data/app/services/alchemy/duplicate_element.rb +1 -1
- data/app/services/alchemy/page_tree_preloader.rb +105 -0
- data/app/stylesheets/alchemy/_custom-properties.scss +1 -0
- data/app/stylesheets/alchemy/_extends.scss +3 -9
- data/app/stylesheets/alchemy/_mixins.scss +3 -1
- data/app/stylesheets/alchemy/_themes.scss +19 -10
- data/app/stylesheets/alchemy/admin/archive.scss +1 -0
- data/app/stylesheets/alchemy/admin/base.scss +13 -4
- data/app/stylesheets/alchemy/admin/buttons.scss +3 -3
- data/app/stylesheets/alchemy/admin/dialogs.scss +11 -5
- data/app/stylesheets/alchemy/admin/element-select.scss +18 -0
- data/app/stylesheets/alchemy/admin/elements.scss +127 -25
- data/app/stylesheets/alchemy/admin/errors.scss +1 -1
- data/app/stylesheets/alchemy/admin/flash.scss +6 -4
- data/app/stylesheets/alchemy/admin/images.scss +9 -5
- data/app/stylesheets/alchemy/admin/list_filter.scss +4 -4
- data/app/stylesheets/alchemy/admin/notices.scss +1 -2
- data/app/stylesheets/alchemy/admin/preview_window.scss +1 -1
- data/app/stylesheets/alchemy/admin/resource_info.scss +7 -0
- data/app/stylesheets/alchemy/admin/selects.scss +36 -21
- data/app/stylesheets/alchemy/admin/shoelace.scss +14 -1
- data/app/stylesheets/alchemy/admin/sitemap.scss +11 -3
- data/app/stylesheets/alchemy/admin/tags.scss +3 -1
- data/app/stylesheets/alchemy/admin/toolbar.scss +1 -1
- data/app/stylesheets/tinymce/skins/ui/alchemy/skin.scss +2 -2
- data/app/stylesheets/tinymce/skins/ui/alchemy-dark/skin.scss +2 -2
- data/app/views/alchemy/_edit_mode.html.erb +1 -1
- data/app/views/alchemy/_menubar.html.erb +1 -1
- data/app/views/alchemy/admin/attachments/_archive_overlay.html.erb +35 -31
- data/app/views/alchemy/admin/attachments/_library_sidebar.html.erb +6 -0
- data/app/views/alchemy/admin/attachments/_overlay_file_list.html.erb +1 -1
- data/app/views/alchemy/admin/attachments/_replace_button.html.erb +1 -8
- data/app/views/alchemy/admin/attachments/_sorting_select.html.erb +13 -0
- data/app/views/alchemy/admin/attachments/_tag_list.html.erb +2 -3
- data/app/views/alchemy/admin/attachments/index.html.erb +5 -11
- data/app/views/alchemy/admin/attachments/show.html.erb +1 -1
- data/app/views/alchemy/admin/clipboard/_button.html.erb +1 -0
- data/app/views/alchemy/admin/clipboard/index.html.erb +4 -5
- data/app/views/alchemy/admin/clipboard/insert.turbo_stream.erb +1 -1
- data/app/views/alchemy/admin/crop.html.erb +5 -7
- data/app/views/alchemy/admin/elements/_add_nested_element_form.html.erb +6 -6
- data/app/views/alchemy/admin/elements/_fixed_element.html.erb +1 -1
- data/app/views/alchemy/admin/elements/_footer.html.erb +7 -1
- data/app/views/alchemy/admin/elements/_header.html.erb +5 -5
- data/app/views/alchemy/admin/elements/_toolbar.html.erb +33 -8
- data/app/views/alchemy/admin/elements/create.turbo_stream.erb +10 -10
- data/app/views/alchemy/admin/elements/index.html.erb +29 -16
- data/app/views/alchemy/admin/elements/new.html.erb +2 -2
- data/app/views/alchemy/admin/ingredients/update.turbo_stream.erb +3 -5
- data/app/views/alchemy/admin/leave.html.erb +9 -9
- data/app/views/alchemy/admin/nodes/_node.html.erb +19 -0
- data/app/views/alchemy/admin/nodes/edit.html.erb +1 -1
- data/app/views/alchemy/admin/nodes/index.html.erb +3 -1
- data/app/views/alchemy/admin/nodes/new.html.erb +14 -1
- data/app/views/alchemy/admin/pages/_current_page.html.erb +3 -1
- data/app/views/alchemy/admin/pages/_form.html.erb +21 -9
- data/app/views/alchemy/admin/pages/_page_status.html.erb +1 -1
- data/app/views/alchemy/admin/pages/_publication_fields.html.erb +28 -26
- data/app/views/alchemy/admin/pages/_table.html.erb +0 -7
- data/app/views/alchemy/admin/pages/_toolbar.html.erb +3 -5
- data/app/views/alchemy/admin/pages/edit.html.erb +5 -13
- data/app/views/alchemy/admin/pages/flush.turbo_stream.erb +2 -0
- data/app/views/alchemy/admin/pages/fold.turbo_stream.erb +5 -0
- data/app/views/alchemy/admin/pages/index.html.erb +5 -3
- data/app/views/alchemy/admin/pages/new.html.erb +2 -12
- data/app/views/alchemy/admin/pages/publish.turbo_stream.erb +12 -0
- data/app/views/alchemy/admin/pages/tree.html.erb +13 -0
- data/app/views/alchemy/admin/pages/update.turbo_stream.erb +5 -16
- data/app/views/alchemy/admin/partials/_flash_notices.html.erb +1 -1
- data/app/views/alchemy/admin/partials/{_remote_search_form.html.erb → _overlay_search_form.html.erb} +1 -2
- data/app/views/alchemy/admin/partials/_paste_from_clipboard_form.html.erb +12 -0
- data/app/views/alchemy/admin/pictures/_archive_overlay.html.erb +24 -21
- data/app/views/alchemy/admin/pictures/_filter_and_size_bar.html.erb +18 -26
- data/app/views/alchemy/admin/pictures/_picture.html.erb +11 -15
- data/app/views/alchemy/admin/pictures/_picture_to_assign.html.erb +3 -6
- data/app/views/alchemy/admin/pictures/_tag_list.html.erb +2 -3
- data/app/views/alchemy/admin/pictures/index.html.erb +0 -1
- data/app/views/alchemy/admin/pictures/update.turbo_stream.erb +1 -1
- data/app/views/alchemy/admin/resources/_resource_usage_info.html.erb +1 -1
- data/app/views/alchemy/admin/resources/_tag_list.html.erb +2 -3
- data/app/views/alchemy/admin/styleguide/index.html.erb +25 -20
- data/app/views/alchemy/admin/tags/edit.html.erb +1 -1
- data/app/views/alchemy/admin/tinymce/_setup.html.erb +2 -2
- data/app/views/alchemy/admin/uploader/_button.html.erb +1 -15
- data/app/views/alchemy/attachments/show.html.erb +1 -1
- data/app/views/alchemy/base/permission_denied.js.erb +1 -1
- data/app/views/alchemy/ingredients/shared/_anchor.html.erb +9 -7
- data/app/views/alchemy/ingredients/shared/_link_tools.html.erb +12 -5
- data/app/views/alchemy/ingredients/shared/_picture_tools.html.erb +10 -11
- data/app/views/alchemy/language_links/_spacer.html.erb +1 -1
- data/app/views/alchemy/messages_mailer/new.html.erb +1 -1
- data/app/views/alchemy/welcome.html.erb +1 -1
- data/app/views/layouts/alchemy/admin.html.erb +1 -1
- data/config/locales/alchemy.en.yml +12 -2
- data/config/routes.rb +2 -2
- data/db/migrate/20230123112425_add_searchable_to_alchemy_pages.rb +1 -1
- data/db/migrate/20230505132743_add_indexes_to_alchemy_pictures.rb +1 -1
- data/db/migrate/20231113104432_create_page_mutexes.rb +1 -1
- data/db/migrate/20240314105244_create_alchemy_picture_descriptions.rb +1 -1
- data/db/migrate/20250626160259_add_unique_index_to_picture_descriptions.rb +1 -1
- data/db/migrate/20250905140323_add_created_at_index_to_pictures_and_attachments.rb +1 -1
- data/db/migrate/20251106150010_convert_select_value_for_multiple.rb +11 -0
- data/db/migrate/20260102121232_add_metadata_to_page_versions.rb +9 -0
- data/db/migrate/20260115164704_add_publication_timestamps_to_alchemy_elements.rb +30 -0
- data/db/migrate/20260115164705_add_index_to_element_publication_timestamps.rb +13 -0
- data/lib/alchemy/ability_helper.rb +1 -3
- data/lib/alchemy/auth_accessors.rb +51 -117
- data/lib/alchemy/configuration.rb +1 -0
- data/lib/alchemy/configurations/main.rb +63 -0
- data/lib/alchemy/controller_actions.rb +1 -1
- data/lib/alchemy/engine.rb +9 -12
- data/lib/alchemy/error_tracking/error_logger.rb +1 -1
- data/lib/alchemy/errors.rb +1 -1
- data/lib/alchemy/logger.rb +34 -4
- data/lib/alchemy/name_conversions.rb +0 -6
- data/lib/alchemy/seeder.rb +2 -2
- data/lib/alchemy/tasks/usage.rb +4 -4
- data/lib/alchemy/test_support/factories/page_version_factory.rb +3 -0
- data/lib/alchemy/test_support/having_picture_thumbnails_examples.rb +30 -0
- data/lib/alchemy/test_support/shared_ingredient_editor_examples.rb +26 -6
- data/lib/alchemy/test_support/shared_publishable_examples.rb +114 -0
- data/lib/alchemy/upgrader/eight_one.rb +56 -0
- data/lib/alchemy/upgrader.rb +9 -1
- data/lib/alchemy/version.rb +1 -1
- data/lib/alchemy.rb +1 -4
- data/lib/alchemy_cms.rb +0 -1
- data/lib/generators/alchemy/elements/templates/view.html.erb +3 -3
- data/lib/generators/alchemy/ingredient/ingredient_generator.rb +6 -8
- data/lib/generators/alchemy/ingredient/templates/editor_component.rb.tt +22 -0
- data/lib/generators/alchemy/page_layouts/templates/layout.html.erb +1 -1
- data/lib/generators/alchemy/site_layouts/templates/layout.html.erb +1 -1
- data/lib/tasks/alchemy/upgrade.rake +21 -7
- data/vendor/javascript/shoelace.min.js +713 -31
- data/vendor/javascript/tinymce.min.js +1 -1
- metadata +103 -83
- data/app/decorators/alchemy/element_editor.rb +0 -90
- data/app/helpers/alchemy/admin/pictures_helper.rb +0 -14
- data/app/javascript/alchemy_admin/file_editors.js +0 -28
- data/app/javascript/alchemy_admin/image_loader.js +0 -54
- data/app/javascript/alchemy_admin/page_sorter.js +0 -71
- data/app/javascript/alchemy_admin/sitemap.js +0 -154
- data/app/javascript/alchemy_admin/templates/page_folder.hbs +0 -3
- data/app/views/alchemy/admin/attachments/archive_overlay.js.erb +0 -4
- data/app/views/alchemy/admin/pages/_page.html.erb +0 -163
- data/app/views/alchemy/admin/pages/_sitemap.html.erb +0 -30
- data/app/views/alchemy/admin/pages/flush.js.erb +0 -2
- data/app/views/alchemy/admin/pictures/archive_overlay.js.erb +0 -5
- data/app/views/alchemy/admin/pictures/index.js.erb +0 -2
- data/app/views/alchemy/ingredients/_audio_editor.html.erb +0 -5
- data/app/views/alchemy/ingredients/_boolean_editor.html.erb +0 -11
- data/app/views/alchemy/ingredients/_datetime_editor.html.erb +0 -20
- data/app/views/alchemy/ingredients/_file_editor.html.erb +0 -52
- data/app/views/alchemy/ingredients/_headline_editor.html.erb +0 -44
- data/app/views/alchemy/ingredients/_html_editor.html.erb +0 -8
- data/app/views/alchemy/ingredients/_link_editor.html.erb +0 -30
- data/app/views/alchemy/ingredients/_node_editor.html.erb +0 -13
- data/app/views/alchemy/ingredients/_number_editor.html.erb +0 -24
- data/app/views/alchemy/ingredients/_page_editor.html.erb +0 -13
- data/app/views/alchemy/ingredients/_picture_editor.html.erb +0 -59
- data/app/views/alchemy/ingredients/_richtext_editor.html.erb +0 -15
- data/app/views/alchemy/ingredients/_select_editor.html.erb +0 -31
- data/app/views/alchemy/ingredients/_text_editor.html.erb +0 -29
- data/app/views/alchemy/ingredients/_video_editor.html.erb +0 -5
- data/lib/generators/alchemy/ingredient/templates/editor.html.erb +0 -14
- /data/{lib → app/models}/alchemy/permissions.rb +0 -0
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
<alchemy-growl><%= @notice %></alchemy-
|
|
1
|
+
<alchemy-growl><%= @notice %></alchemy-growl>
|
|
2
2
|
<alchemy-action name="closeCurrentDialog"></alchemy-action>
|
|
3
3
|
|
|
4
4
|
<% if @while_page_edit -%>
|
|
5
5
|
<%= turbo_stream.replace "locked_page_#{@page.id}" do %>
|
|
6
6
|
<%= render("alchemy/admin/pages/current_page", current_page: @page) %>
|
|
7
7
|
<% end %>
|
|
8
|
+
<%= turbo_stream.replace "publish_page_button" do %>
|
|
9
|
+
<%= render Alchemy::Admin::PublishPageButton.new(page: @page) %>
|
|
10
|
+
<% end %>
|
|
8
11
|
<alchemy-action name="reloadPreview"></alchemy-action>
|
|
9
12
|
<% else %>
|
|
10
13
|
<%= turbo_stream.replace "locked_page_#{@page.id}" do %>
|
|
@@ -13,27 +16,13 @@
|
|
|
13
16
|
|
|
14
17
|
<% if @view == "list" %>
|
|
15
18
|
<turbo-stream action="refresh"></turbo-stream>
|
|
16
|
-
<% elsif @page.parent_id != @old_parent_id -%>
|
|
17
|
-
<%= turbo_stream.append "sitemap" do %>
|
|
18
|
-
<script type="module">
|
|
19
|
-
Alchemy.currentSitemap.load(<%= @page.get_language_root.id %>);
|
|
20
|
-
</script>
|
|
21
|
-
<% end %>
|
|
22
19
|
<% else -%>
|
|
23
20
|
<% if @page.layoutpage %>
|
|
24
21
|
<%= turbo_stream.replace "page_#{@page.id}" do %>
|
|
25
22
|
<%= render("alchemy/admin/layoutpages/layoutpage", layoutpage: @page) %>
|
|
26
23
|
<% end %>
|
|
27
24
|
<% else %>
|
|
28
|
-
|
|
29
|
-
<script type="module">
|
|
30
|
-
const page = document.getElementById('page_<%= @page.id %>');
|
|
31
|
-
const page_html = "<%= j render('page', page: @page) %>".replace(/__ID__/g, "<%= @page.id %>");
|
|
32
|
-
const compiler = Handlebars.compile(page_html);
|
|
33
|
-
const tree = <%== @tree.to_json %>;
|
|
34
|
-
page.outerHTML = compiler(tree.pages[0]);
|
|
35
|
-
</script>
|
|
36
|
-
<% end %>
|
|
25
|
+
<turbo-stream action="refresh"></turbo-stream>
|
|
37
26
|
<% end %>
|
|
38
27
|
<% end -%>
|
|
39
28
|
<% end %>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<div id="flash_notices">
|
|
1
|
+
<div id="flash_notices" data-auto-dismiss-delay="5000">
|
|
2
2
|
<% flash.keys.each do |flash_type| %>
|
|
3
3
|
<% if flash[flash_type.to_sym].present? %>
|
|
4
4
|
<%= render Alchemy::Admin::Message.new(flash[flash_type.to_sym], type: flash_type, dismissable: true) %>
|
data/app/views/alchemy/admin/partials/{_remote_search_form.html.erb → _overlay_search_form.html.erb}
RENAMED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
size: @size
|
|
7
7
|
)) -%>
|
|
8
8
|
|
|
9
|
-
<%= search_form_for @query, url: url_for(action: 'index', size: @size),
|
|
9
|
+
<%= search_form_for @query, url: url_for(action: 'index', size: @size), html: {class: 'search_form', id: "resource_search"} do |f| %>
|
|
10
10
|
<%= hidden_field_tag :form_field_id, @form_field_id %>
|
|
11
11
|
<% Array(params[:only]).each do |only| %>
|
|
12
12
|
<%= hidden_field_tag("only[]", only, form: "resource_search", id: nil) %>
|
|
@@ -23,7 +23,6 @@
|
|
|
23
23
|
class: 'search_input_field',
|
|
24
24
|
id: nil %>
|
|
25
25
|
<%= link_to render_icon(:times, size: '1x'), clear_url,
|
|
26
|
-
remote: true,
|
|
27
26
|
class: 'search_field_clear',
|
|
28
27
|
title: Alchemy.t(:click_to_show_all),
|
|
29
28
|
style: search_filter_params.fetch(:q, {}).fetch(resource_handler.search_field_name, '').present? ? 'visibility: visible' : 'visibility: hidden' %>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<%= alchemy_form_for [:admin, item] do |f| %>
|
|
2
|
+
<%= f.hidden_field(:parent_id) %>
|
|
3
|
+
<%= f.hidden_field(:language_id) %>
|
|
4
|
+
<div class="input select">
|
|
5
|
+
<label for="paste_from_clipboard" class="control-label"><%= item.class.model_name.human %></label>
|
|
6
|
+
<%= select_tag 'paste_from_clipboard',
|
|
7
|
+
clipboard_select_tag_options(clipboard_items),
|
|
8
|
+
is: 'alchemy-select' %>
|
|
9
|
+
</div>
|
|
10
|
+
<%= f.input :name %>
|
|
11
|
+
<%= f.submit Alchemy.t(:paste) %>
|
|
12
|
+
<% end %>
|
|
@@ -1,23 +1,26 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
<%=
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
<%= turbo_frame_tag "archive_overlay" do %>
|
|
2
|
+
<div id="overlay_toolbar">
|
|
3
|
+
<%= render 'filter_and_size_bar' %>
|
|
4
|
+
<%= render 'alchemy/admin/partials/overlay_search_form' %>
|
|
5
|
+
</div>
|
|
6
|
+
<div id="assign_image_list" class="with_padding<%= search_filter_params[:tagged_with].present? ? ' filtered' : '' %>">
|
|
7
|
+
<%= render "library_sidebar" %>
|
|
8
|
+
<% if @pictures.empty? %>
|
|
9
|
+
<%= render_message do %>
|
|
10
|
+
<% if search_filter_params.empty? %>
|
|
11
|
+
<%= Alchemy.t(:no_images_in_archive) %>
|
|
12
|
+
<% else %>
|
|
13
|
+
<%= Alchemy.t(:no_search_results) %>
|
|
14
|
+
<% end %>
|
|
12
15
|
<% end %>
|
|
13
|
-
<%
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
locals: {size: @size} %>
|
|
16
|
+
<% else %>
|
|
17
|
+
<div id="overlay_picture_list" class="picture-size--<%= @size %>">
|
|
18
|
+
<%= render partial: 'picture_to_assign',
|
|
19
|
+
collection: @pictures,
|
|
20
|
+
locals: {size: @size} %>
|
|
19
21
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
</div>
|
|
22
|
+
<%= render "alchemy/admin/resources/pagination", resources: @pictures, hide_per_page_select: true %>
|
|
23
|
+
</div>
|
|
24
|
+
<% end %>
|
|
25
|
+
</div>
|
|
26
|
+
<% end %>
|
|
@@ -18,46 +18,38 @@
|
|
|
18
18
|
<sl-tooltip content="<%= Alchemy.t(:small_thumbnails) %>">
|
|
19
19
|
<%= link_to(
|
|
20
20
|
render_icon('zoom-out'),
|
|
21
|
-
alchemy.admin_pictures_path(
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}),
|
|
28
|
-
remote: true,
|
|
21
|
+
alchemy.admin_pictures_path(
|
|
22
|
+
search_filter_params.merge(
|
|
23
|
+
size: "small",
|
|
24
|
+
form_field_id: @form_field_id
|
|
25
|
+
)
|
|
26
|
+
),
|
|
29
27
|
class: "icon_button"
|
|
30
28
|
) %>
|
|
31
29
|
</sl-tooltip>
|
|
32
30
|
<sl-tooltip content="<%= Alchemy.t(:medium_thumbnails) %>">
|
|
33
31
|
<%= link_to(
|
|
34
32
|
render_icon('search'),
|
|
35
|
-
alchemy.admin_pictures_path(
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
}),
|
|
42
|
-
remote: true,
|
|
33
|
+
alchemy.admin_pictures_path(
|
|
34
|
+
search_filter_params.merge(
|
|
35
|
+
size: "medium",
|
|
36
|
+
form_field_id: @form_field_id
|
|
37
|
+
)
|
|
38
|
+
),
|
|
43
39
|
class: "icon_button"
|
|
44
40
|
) %>
|
|
45
41
|
</sl-tooltip>
|
|
46
42
|
<sl-tooltip content="<%= Alchemy.t(:big_thumbnails) %>">
|
|
47
43
|
<%= link_to(
|
|
48
44
|
render_icon('zoom-in'),
|
|
49
|
-
alchemy.admin_pictures_path(
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
}),
|
|
56
|
-
remote: true,
|
|
45
|
+
alchemy.admin_pictures_path(
|
|
46
|
+
search_filter_params.merge(
|
|
47
|
+
size: "large",
|
|
48
|
+
form_field_id: @form_field_id
|
|
49
|
+
)
|
|
50
|
+
),
|
|
57
51
|
class: "icon_button"
|
|
58
52
|
) %>
|
|
59
53
|
</sl-tooltip>
|
|
60
|
-
<%= hidden_field_tag('size', @size, id: 'overlay_thumbnails_size') %>
|
|
61
54
|
</div>
|
|
62
|
-
<%= render partial: 'alchemy/admin/partials/remote_search_form' %>
|
|
63
55
|
</div>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<div class="picture_thumbnail <%= @size %>" id="picture_<%= picture.id %>"
|
|
1
|
+
<div class="picture_thumbnail <%= @size %>" id="picture_<%= picture.id %>">
|
|
2
2
|
<span class="picture_tool select">
|
|
3
3
|
<%= check_box_tag "picture_ids[]", picture.id %>
|
|
4
4
|
</span>
|
|
@@ -19,23 +19,19 @@
|
|
|
19
19
|
</sl-tooltip>
|
|
20
20
|
</div>
|
|
21
21
|
<% end %>
|
|
22
|
-
<% picture_url = picture.thumbnail_url(size: preview_size(@size)) %>
|
|
23
|
-
<% image = picture_url ? image_tag(picture_url, alt: picture.name) : '<alchemy-icon name="file-damage"></alchemy-icon>'.html_safe %>
|
|
24
22
|
<% if can?(:edit, picture) %>
|
|
25
23
|
<% picture_index ||= picture_offset + picture_iteration.index %>
|
|
26
|
-
<%= link_to(
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
class: 'thumbnail_background'
|
|
36
|
-
) %>
|
|
24
|
+
<%= link_to alchemy.admin_picture_path(
|
|
25
|
+
picture,
|
|
26
|
+
search_filter_params.merge(
|
|
27
|
+
picture_index: picture_index.to_i + 1,
|
|
28
|
+
size: @size.presence
|
|
29
|
+
).to_h
|
|
30
|
+
) do %>
|
|
31
|
+
<%= render Alchemy::Admin::PictureThumbnail.new(picture, size: @size) %>
|
|
32
|
+
<% end %>
|
|
37
33
|
<% else %>
|
|
38
|
-
<%=
|
|
34
|
+
<%= render Alchemy::Admin::PictureThumbnail.new(picture, size: @size) %>
|
|
39
35
|
<% end %>
|
|
40
36
|
<span class="picture_name" title="<%= picture.name %>">
|
|
41
37
|
<%= picture.name %>
|
|
@@ -2,10 +2,6 @@
|
|
|
2
2
|
<% if picture_to_assign.image_file %>
|
|
3
3
|
<sl-tooltip content="<%= Alchemy.t(:assign_image) %>">
|
|
4
4
|
<%= link_to(
|
|
5
|
-
image_tag(
|
|
6
|
-
picture_to_assign.thumbnail_url(size: preview_size(size)),
|
|
7
|
-
alt: picture_to_assign.name
|
|
8
|
-
),
|
|
9
5
|
alchemy.assign_admin_picture_path(
|
|
10
6
|
id: picture_to_assign.id,
|
|
11
7
|
form_field_id: @form_field_id
|
|
@@ -13,8 +9,9 @@
|
|
|
13
9
|
remote: true,
|
|
14
10
|
onclick: '$(self).attr("href", "#").off("click"); return false',
|
|
15
11
|
method: 'put',
|
|
16
|
-
|
|
17
|
-
|
|
12
|
+
) do %>
|
|
13
|
+
<%= render Alchemy::Admin::PictureThumbnail.new(picture_to_assign) %>
|
|
14
|
+
<% end %>
|
|
18
15
|
</sl-tooltip>
|
|
19
16
|
<% else %>
|
|
20
17
|
<alchemy-icon name="file-damage"></alchemy-icon>
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
<% if Alchemy::Picture.tag_counts.any? %>
|
|
2
2
|
<label><%= Alchemy.t("Filter by tag") %></label>
|
|
3
|
-
<%= render Alchemy::Admin::ListFilter.new(".tag-list li") %>
|
|
3
|
+
<%= render Alchemy::Admin::ListFilter.new(".tag-list li", placeholder: Alchemy.t("Filter tags")) %>
|
|
4
4
|
<ul>
|
|
5
|
-
<%=
|
|
5
|
+
<%= render Alchemy::Admin::TagsList.new('Alchemy::Picture') %>
|
|
6
6
|
</ul>
|
|
7
7
|
<% if search_filter_params[:tagged_with].present? %>
|
|
8
8
|
<%= link_to(
|
|
9
9
|
render_icon(:close, size: '1x') + Alchemy.t('Remove tag filter'),
|
|
10
10
|
url_for(search_filter_params.except(:tagged_with)),
|
|
11
|
-
remote: request.xhr?,
|
|
12
11
|
class: 'secondary button small with_icon'
|
|
13
12
|
) %>
|
|
14
13
|
<% end %>
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
<li class="<%= cycle('even', 'odd') %>">
|
|
18
18
|
<% page_link = link_to element.display_name_with_preview_text,
|
|
19
19
|
edit_admin_page_path(page, anchor: "element_#{element.id}") %>
|
|
20
|
-
<% ingredients = related_ingredients.map
|
|
20
|
+
<% ingredients = related_ingredients.map(&:translated_role).to_sentence %>
|
|
21
21
|
<%= element.definition.icon_file %>
|
|
22
22
|
<p>
|
|
23
23
|
<%== Alchemy.t(:pictures_in_page, page: page_link, pictures: ingredients) %>
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
<div class="tag-list<%= ' with_filter_bar' if resource_has_filters %><%= ' filtered' if search_filter_params[:tagged_with].present? %>">
|
|
2
2
|
<h3><%= Alchemy.t("Filter by tag") %></h3>
|
|
3
|
-
<%= render Alchemy::Admin::ListFilter.new(".tag-list li") %>
|
|
3
|
+
<%= render Alchemy::Admin::ListFilter.new(".tag-list li", placeholder: Alchemy.t("Filter tags")) %>
|
|
4
4
|
<ul>
|
|
5
|
-
<%=
|
|
5
|
+
<%= render Alchemy::Admin::TagsList.new(resource_model.name) %>
|
|
6
6
|
</ul>
|
|
7
7
|
<% if search_filter_params[:tagged_with].present? %>
|
|
8
8
|
<%= link_to(
|
|
9
9
|
render_icon(:times, size: '1x') + Alchemy.t('Remove tag filter'),
|
|
10
10
|
url_for(search_filter_params.except(:tagged_with)),
|
|
11
|
-
remote: request.xhr?,
|
|
12
11
|
class: 'secondary button small with_icon'
|
|
13
12
|
) %>
|
|
14
13
|
<% end %>
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
<select class="select" id="select" is="alchemy-select">
|
|
33
33
|
<option value="">Please choose</option>
|
|
34
34
|
<option value="1">Option 1</option>
|
|
35
|
-
<option selected
|
|
35
|
+
<option selected value="2">Option 2</option>
|
|
36
36
|
<option value="3">Option 3</option>
|
|
37
37
|
</select>
|
|
38
38
|
</div>
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
<div class="input">
|
|
48
48
|
<label class="control-label" for="datetime_picker">Date Time Picker</label>
|
|
49
49
|
<alchemy-datepicker input-type="datetime">
|
|
50
|
-
<input type="text" id="datetime_picker">
|
|
50
|
+
<input type="text" id="datetime_picker" autocomplete="off">
|
|
51
51
|
</alchemy-datepicker>
|
|
52
52
|
</div>
|
|
53
53
|
|
|
@@ -57,12 +57,12 @@
|
|
|
57
57
|
<div class="input-row">
|
|
58
58
|
<div class="input-column">
|
|
59
59
|
<alchemy-datepicker input-type="date">
|
|
60
|
-
<input type="text" id="date_picker">
|
|
60
|
+
<input type="text" id="date_picker" autocomplete="off">
|
|
61
61
|
</alchemy-datepicker>
|
|
62
62
|
</div>
|
|
63
63
|
<div class="input-column">
|
|
64
64
|
<alchemy-datepicker input-type="time">
|
|
65
|
-
<input type="text" id="time_picker">
|
|
65
|
+
<input type="text" id="time_picker" autocomplete="off">
|
|
66
66
|
</alchemy-datepicker>
|
|
67
67
|
</div>
|
|
68
68
|
</div>
|
|
@@ -71,23 +71,23 @@
|
|
|
71
71
|
|
|
72
72
|
<div class="input">
|
|
73
73
|
<label class="control-label" for="optional_string">String</label>
|
|
74
|
-
<input type="text" id="optional_string">
|
|
74
|
+
<input type="text" id="optional_string" autocomplete="off">
|
|
75
75
|
</div>
|
|
76
76
|
<div class="input required">
|
|
77
77
|
<label class="required control-label" for="required_string">
|
|
78
78
|
Required String<abbr title="required">*</abbr>
|
|
79
79
|
</label>
|
|
80
|
-
<input type="text" id="required_string">
|
|
80
|
+
<input type="text" id="required_string" autocomplete="off">
|
|
81
81
|
</div>
|
|
82
82
|
<div class="input field_with_errors">
|
|
83
83
|
<label class="control-label" for="string_with_error">String with error</label>
|
|
84
|
-
<input type="text" id="string_with_error">
|
|
84
|
+
<input type="text" id="string_with_error" autocomplete="off">
|
|
85
85
|
<small class="error">Error message</small>
|
|
86
86
|
</div>
|
|
87
87
|
<alchemy-char-counter max-chars="60">
|
|
88
88
|
<div class="input">
|
|
89
89
|
<label class="control-label" for="string_with_counter">String with char counter</label>
|
|
90
|
-
<input type="text" id="string_with_counter">
|
|
90
|
+
<input type="text" id="string_with_counter" autocomplete="off">
|
|
91
91
|
</div>
|
|
92
92
|
</alchemy-char-counter>
|
|
93
93
|
|
|
@@ -95,7 +95,7 @@
|
|
|
95
95
|
<label class="control-label">Check Boxes</label>
|
|
96
96
|
<div class="control_group">
|
|
97
97
|
<label class="checkbox">
|
|
98
|
-
<input type="checkbox" value="1" checked
|
|
98
|
+
<input type="checkbox" value="1" checked>
|
|
99
99
|
Checked
|
|
100
100
|
</label>
|
|
101
101
|
<label class="checkbox">
|
|
@@ -140,7 +140,7 @@
|
|
|
140
140
|
<h2>Selects</h2>
|
|
141
141
|
|
|
142
142
|
<div style="display: flex; gap: 1em;">
|
|
143
|
-
<div style="width:
|
|
143
|
+
<div style="width: 20%">
|
|
144
144
|
<h3>Select with Search</h3>
|
|
145
145
|
<select is="alchemy-select" class="full_width">
|
|
146
146
|
<option value="1">Option 1</option>
|
|
@@ -153,24 +153,29 @@
|
|
|
153
153
|
</select>
|
|
154
154
|
</div>
|
|
155
155
|
|
|
156
|
-
<div style="width:
|
|
156
|
+
<div style="width: 20%">
|
|
157
157
|
<h3>Page Select</h3>
|
|
158
158
|
<%= render Alchemy::Admin::PageSelect.new do %>
|
|
159
|
-
<input name="page" class="full_width"
|
|
159
|
+
<input name="page" class="full_width">
|
|
160
160
|
<% end %>
|
|
161
161
|
</div>
|
|
162
162
|
|
|
163
|
-
<div style="width:
|
|
163
|
+
<div style="width: 20%">
|
|
164
|
+
<h3>Element Select</h3>
|
|
165
|
+
<%= render Alchemy::Admin::ElementSelect.new(Alchemy::Element.definitions) %>
|
|
166
|
+
</div>
|
|
167
|
+
|
|
168
|
+
<div style="width: 20%">
|
|
164
169
|
<h3>Node Select</h3>
|
|
165
170
|
<%= render Alchemy::Admin::NodeSelect.new do %>
|
|
166
|
-
<input name="node" class="full_width"
|
|
171
|
+
<input name="node" class="full_width">
|
|
167
172
|
<% end %>
|
|
168
173
|
</div>
|
|
169
174
|
|
|
170
|
-
<div style="width:
|
|
175
|
+
<div style="width: 20%">
|
|
171
176
|
<h3>Attachment Select</h3>
|
|
172
177
|
<%= render Alchemy::Admin::AttachmentSelect.new do %>
|
|
173
|
-
<input name="attachment" class="full_width"
|
|
178
|
+
<input name="attachment" class="full_width">
|
|
174
179
|
<% end %>
|
|
175
180
|
</div>
|
|
176
181
|
</div>
|
|
@@ -179,7 +184,7 @@
|
|
|
179
184
|
|
|
180
185
|
<div style="width: 25%">
|
|
181
186
|
<alchemy-tags-autocomplete>
|
|
182
|
-
<input type="text" class="full_width"
|
|
187
|
+
<input type="text" class="full_width" autocomplete="off">
|
|
183
188
|
</alchemy-tags-autocomplete>
|
|
184
189
|
</div>
|
|
185
190
|
|
|
@@ -198,19 +203,19 @@
|
|
|
198
203
|
<h3>Info Message</h3>
|
|
199
204
|
|
|
200
205
|
<%= render_message do %>
|
|
201
|
-
<p>Lorem ipsum <strong>dolor</strong> sit amet, <a href="">consectetur</a> adipiscing elit.</p>
|
|
206
|
+
<p>Lorem ipsum <strong>dolor</strong> sit amet, <a href="#">consectetur</a> adipiscing elit.</p>
|
|
202
207
|
<% end %>
|
|
203
208
|
|
|
204
209
|
<h3>Warning Message</h3>
|
|
205
210
|
|
|
206
211
|
<%= render_message :warning do %>
|
|
207
|
-
<p>Lorem ipsum dolor sit amet, <a href="">consectetur</a> adipiscing elit.</p>
|
|
212
|
+
<p>Lorem ipsum dolor sit amet, <a href="#">consectetur</a> adipiscing elit.</p>
|
|
208
213
|
<% end %>
|
|
209
214
|
|
|
210
215
|
<h3>Error Message</h3>
|
|
211
216
|
|
|
212
217
|
<%= render_message :error do %>
|
|
213
|
-
<p>Lorem ipsum dolor sit amet, <a href="">consectetur</a> adipiscing elit.</p>
|
|
218
|
+
<p>Lorem ipsum dolor sit amet, <a href="#">consectetur</a> adipiscing elit.</p>
|
|
214
219
|
<% end %>
|
|
215
220
|
|
|
216
221
|
<h3>Growl Messages</h3>
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
<div class="input tags">
|
|
14
14
|
<label class="control-label"><%= Alchemy.t('Tags') %></label>
|
|
15
15
|
<div class="control_group" id="tags_tag_list">
|
|
16
|
-
<%= render Alchemy::Admin::ListFilter.new(".tag-list li") %>
|
|
16
|
+
<%= render Alchemy::Admin::ListFilter.new(".tag-list li", placeholder: Alchemy.t("Filter tags")) %>
|
|
17
17
|
<ul class="tags tag-list">
|
|
18
18
|
<%= render partial: "radio_tag", collection: @tags, locals: {name: "tag"} %>
|
|
19
19
|
</ul>
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<% tinymce_base_path = "#{Rails.application.config.assets.prefix}/tinymce" %>
|
|
2
2
|
|
|
3
|
-
<link rel="preload" href="<%= asset_path("#{tinymce_base_path}/skins/ui/alchemy/skin.min.css") %>" as="style"
|
|
3
|
+
<link rel="preload" href="<%= asset_path("#{tinymce_base_path}/skins/ui/alchemy/skin.min.css") %>" as="style">
|
|
4
4
|
<% if Alchemy::Tinymce.init[:content_css] %>
|
|
5
|
-
<link rel="preload" href="<%= asset_path(Alchemy::Tinymce.init[:content_css]) %>" as="style"
|
|
5
|
+
<link rel="preload" href="<%= asset_path(Alchemy::Tinymce.init[:content_css]) %>" as="style">
|
|
6
6
|
<% end %>
|
|
7
7
|
<% Alchemy::Tinymce.preloadable_plugins.each do |plugin| %>
|
|
8
8
|
<link rel="preload" href="<%= asset_path("#{tinymce_base_path}/plugins/#{plugin}/plugin.min.js") %>" as="script">
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<% file_types = Alchemy.config.uploader.allowed_filetypes[object.class.model_name.collection] || ['*'] %>
|
|
2
2
|
<% accept ||= file_types.to_a == ["*"] ? nil : file_types.map {|type| ".#{type}"}.join(", ") %>
|
|
3
3
|
|
|
4
|
-
<alchemy-uploader dropzone="<%= local_assigns[:dropzone] || "#main_content" %>">
|
|
4
|
+
<alchemy-uploader redirect-url="<%= redirect_url %>" dropzone="<%= local_assigns[:dropzone] || "#main_content" %>">
|
|
5
5
|
<%= form_for [:admin, object], html: { multipart: true, class: 'upload-button' } do |f| %>
|
|
6
6
|
<%= f.file_field file_attribute,
|
|
7
7
|
class: 'fileupload fileupload--field', multiple: true, accept: accept,
|
|
@@ -15,17 +15,3 @@
|
|
|
15
15
|
<% end %>
|
|
16
16
|
<% end %>
|
|
17
17
|
</alchemy-uploader>
|
|
18
|
-
|
|
19
|
-
<script type='text/javascript'>
|
|
20
|
-
document.querySelector("alchemy-uploader").addEventListener("Alchemy.upload.successful", (evt) => {
|
|
21
|
-
setTimeout(() => {
|
|
22
|
-
var url = '<%= redirect_url.html_safe %>';
|
|
23
|
-
evt.target.uploadProgress.visible = false;
|
|
24
|
-
<% if local_assigns[:in_dialog] %>
|
|
25
|
-
$.get(url, null, null, 'script');
|
|
26
|
-
<% else %>
|
|
27
|
-
Turbo.visit(url);
|
|
28
|
-
<% end %>
|
|
29
|
-
}, 1000)
|
|
30
|
-
})
|
|
31
|
-
</script>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<%#= @attachment.public_filename %>
|
|
1
|
+
<%#= @attachment.public_filename %>
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
<span class="edit-ingredient-anchor-link">
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
{
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
<% disabled = cannot?(:edit, ingredient) %>
|
|
3
|
+
<%= content_tag "sl-tooltip", content: Alchemy.t(:edit_anchor), disabled: disabled do %>
|
|
4
|
+
<%= link_to_dialog render_icon(:bookmark, { style: ingredient.dom_id.present? ? "fill" : "line" }),
|
|
5
|
+
disabled ? nil : alchemy.edit_admin_ingredient_path(id: ingredient.id),
|
|
6
|
+
{
|
|
7
|
+
title: Alchemy.t(:edit_anchor),
|
|
8
|
+
size: "380x125"
|
|
9
|
+
} %>
|
|
10
|
+
<% end %>
|
|
9
11
|
</span>
|
|
@@ -1,10 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
<% disabled = cannot?(:edit, ingredient) %>
|
|
2
|
+
<%= content_tag "alchemy-link-buttons", class: local_assigns[:wrapper_class], data: {ingredient_id: ingredient.id} do %>
|
|
3
|
+
<%= content_tag "sl-tooltip",
|
|
4
|
+
content: Alchemy.t(:place_link),
|
|
5
|
+
disabled: disabled do %>
|
|
3
6
|
<%= content_tag "button", "", is: "alchemy-link-button",
|
|
4
|
-
|
|
7
|
+
disabled: disabled,
|
|
8
|
+
class: [ingredient.linked? ? "linked" : nil] %>
|
|
5
9
|
<% end %>
|
|
6
|
-
<%= content_tag "sl-tooltip",
|
|
10
|
+
<%= content_tag "sl-tooltip",
|
|
11
|
+
content: Alchemy.t(:unlink),
|
|
12
|
+
disabled: disabled do %>
|
|
7
13
|
<%= content_tag "button", "", is: "alchemy-unlink-button",
|
|
8
|
-
|
|
14
|
+
disabled: disabled,
|
|
15
|
+
class: [ingredient.linked? ? "linked" : "disabled"] %>
|
|
9
16
|
<% end %>
|
|
10
17
|
<% end %>
|
|
@@ -1,27 +1,26 @@
|
|
|
1
1
|
<% linkable = picture_editor.settings[:linkable] != false %>
|
|
2
2
|
<% croppable = picture_editor.allow_image_cropping? %>
|
|
3
|
+
<% disabled = cannot?(:edit, picture_editor.ingredient) %>
|
|
3
4
|
|
|
4
|
-
<%= content_tag "sl-tooltip", content: Alchemy.t("Edit Picturemask"), placement: "top-start", disabled: !croppable do %>
|
|
5
|
+
<%= content_tag "sl-tooltip", content: Alchemy.t("Edit Picturemask"), placement: "top-start", disabled: !croppable || disabled do %>
|
|
5
6
|
<%= link_to_dialog render_icon(:crop),
|
|
6
|
-
alchemy.crop_admin_ingredient_path(picture_editor.ingredient, {
|
|
7
|
+
(croppable && !disabled) ? alchemy.crop_admin_ingredient_path(picture_editor.ingredient, {
|
|
7
8
|
crop_from_form_field_id: picture_editor.form_field_id(:crop_from),
|
|
8
9
|
crop_size_form_field_id: picture_editor.form_field_id(:crop_size),
|
|
9
10
|
picture_id: picture_editor.picture&.id
|
|
10
|
-
}), {
|
|
11
|
+
}) : nil, {
|
|
11
12
|
size: "1080x615",
|
|
12
13
|
title: Alchemy.t("Edit Picturemask"),
|
|
13
14
|
image_loader: false,
|
|
14
15
|
padding: false
|
|
15
16
|
}, {
|
|
16
|
-
class:
|
|
17
|
-
tabindex: croppable ? nil : "-1",
|
|
18
|
-
onclick: "return false"
|
|
17
|
+
class: "crop_link icon_button"
|
|
19
18
|
} %>
|
|
20
19
|
<% end %>
|
|
21
20
|
|
|
22
|
-
<%= content_tag "sl-tooltip", content: picture_editor.picture ? Alchemy.t(:swap_image) : Alchemy.t(:insert_image) do %>
|
|
21
|
+
<%= content_tag "sl-tooltip", content: picture_editor.picture ? Alchemy.t(:swap_image) : Alchemy.t(:insert_image), disabled: disabled do %>
|
|
23
22
|
<%= link_to_dialog render_icon("image-add"),
|
|
24
|
-
alchemy.admin_pictures_path(
|
|
23
|
+
disabled ? nil : alchemy.admin_pictures_path(
|
|
25
24
|
form_field_id: picture_editor.form_field_id(:picture_id)
|
|
26
25
|
),
|
|
27
26
|
{
|
|
@@ -33,15 +32,15 @@
|
|
|
33
32
|
<% end %>
|
|
34
33
|
|
|
35
34
|
<% if linkable %>
|
|
36
|
-
<%= render "alchemy/ingredients/shared/link_tools",
|
|
35
|
+
<%= render "alchemy/ingredients/shared/link_tools", ingredient: picture_editor.ingredient %>
|
|
37
36
|
<% else %>
|
|
38
37
|
<span class="icon_button disabled"><%= render_icon("link", style: "m") %></span>
|
|
39
38
|
<span class="icon_button disabled"><%= render_icon("link-unlink", style: "m") %></span>
|
|
40
39
|
<% end %>
|
|
41
40
|
|
|
42
|
-
<%= content_tag "sl-tooltip", content: Alchemy.t(:edit_image_properties), placement: "top-end" do %>
|
|
41
|
+
<%= content_tag "sl-tooltip", content: Alchemy.t(:edit_image_properties), placement: "top-end", disabled: disabled do %>
|
|
43
42
|
<%= link_to_dialog render_icon(:edit),
|
|
44
|
-
alchemy.edit_admin_ingredient_path(id: picture_editor.id, language_id: @page.language_id),
|
|
43
|
+
disabled ? nil : alchemy.edit_admin_ingredient_path(id: picture_editor.id, language_id: @page.language_id),
|
|
45
44
|
{
|
|
46
45
|
title: Alchemy.t(:edit_image_properties),
|
|
47
46
|
size: "380x255"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<%= options[:spacer].html_safe %>
|
|
1
|
+
<%= options[:spacer].html_safe %>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<%= render_elements %>
|
|
1
|
+
<%= render_elements %>
|