alchemy_cms 4.1.2 → 4.2.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/ISSUE_TEMPLATE/Bug_report.md +0 -5
- data/.rubocop.yml +4 -1
- data/.travis.yml +3 -3
- data/CHANGELOG.md +29 -10
- data/Gemfile +5 -7
- data/README.md +114 -62
- data/Rakefile +2 -2
- data/alchemy_cms.gemspec +5 -5
- data/app/assets/images/alchemy/icon.svg +1 -1
- data/app/assets/javascripts/alchemy/admin.js +2 -0
- data/app/assets/javascripts/alchemy/alchemy.base.js.coffee +0 -24
- data/app/assets/javascripts/alchemy/alchemy.datepicker.js.coffee +11 -9
- data/app/assets/javascripts/alchemy/alchemy.dragndrop.js.coffee +7 -24
- data/app/assets/javascripts/alchemy/alchemy.element_editors.js.coffee +9 -8
- data/app/assets/javascripts/alchemy/alchemy.fixed_elements.js +38 -0
- data/app/assets/javascripts/alchemy/alchemy.sitemap.js.coffee +2 -4
- data/app/assets/javascripts/alchemy/alchemy.translations.js.coffee +1 -1
- data/app/assets/stylesheets/alchemy/_mixins.scss +2 -1
- data/app/assets/stylesheets/alchemy/_variables.scss +7 -2
- data/app/assets/stylesheets/alchemy/admin.scss +2 -1
- data/app/assets/stylesheets/alchemy/archive.scss +18 -4
- data/app/assets/stylesheets/alchemy/buttons.scss +1 -1
- data/app/assets/stylesheets/alchemy/dialogs.scss +1 -1
- data/app/assets/stylesheets/alchemy/elements.scss +154 -90
- data/app/assets/stylesheets/alchemy/filter_field.scss +30 -0
- data/app/assets/stylesheets/alchemy/flatpickr.scss +839 -0
- data/app/assets/stylesheets/alchemy/forms.scss +5 -1
- data/app/assets/stylesheets/alchemy/frame.scss +6 -14
- data/app/assets/stylesheets/alchemy/navigation.scss +109 -98
- data/app/assets/stylesheets/alchemy/search.scss +11 -29
- data/app/assets/stylesheets/alchemy/tables.scss +0 -23
- data/app/assets/stylesheets/alchemy/tags.scss +4 -27
- data/app/assets/stylesheets/alchemy/toolbar.scss +12 -2
- data/app/assets/stylesheets/tinymce/skins/alchemy/skin.min.css.scss +4 -33
- data/app/controllers/alchemy/admin/attachments_controller.rb +1 -12
- data/app/controllers/alchemy/admin/contents_controller.rb +2 -24
- data/app/controllers/alchemy/admin/elements_controller.rb +11 -49
- data/app/controllers/alchemy/admin/pages_controller.rb +1 -1
- data/app/controllers/alchemy/admin/pictures_controller.rb +1 -14
- data/app/controllers/alchemy/api/contents_controller.rb +1 -1
- data/app/controllers/alchemy/api/elements_controller.rb +1 -1
- data/app/controllers/alchemy/api/pages_controller.rb +1 -1
- data/app/controllers/concerns/alchemy/admin/archive_overlay.rb +20 -0
- data/app/helpers/alchemy/admin/base_helper.rb +8 -18
- data/app/helpers/alchemy/admin/elements_helper.rb +55 -85
- data/app/helpers/alchemy/admin/pictures_helper.rb +0 -23
- data/app/helpers/alchemy/elements_helper.rb +80 -120
- data/app/helpers/alchemy/pages_helper.rb +5 -24
- data/app/models/alchemy/content.rb +0 -1
- data/app/models/alchemy/content/factory.rb +33 -57
- data/app/models/alchemy/element.rb +46 -66
- data/app/models/alchemy/element/element_contents.rb +2 -2
- data/app/models/alchemy/page.rb +34 -4
- data/app/models/alchemy/page/page_elements.rb +30 -122
- data/app/serializers/alchemy/attachment_serializer.rb +0 -2
- data/app/serializers/alchemy/content_serializer.rb +0 -2
- data/app/serializers/alchemy/element_serializer.rb +0 -3
- data/app/serializers/alchemy/essence_boolean_serializer.rb +0 -2
- data/app/serializers/alchemy/essence_date_serializer.rb +0 -2
- data/app/serializers/alchemy/essence_file_serializer.rb +0 -2
- data/app/serializers/alchemy/essence_html_serializer.rb +0 -2
- data/app/serializers/alchemy/essence_link_serializer.rb +0 -2
- data/app/serializers/alchemy/essence_picture_serializer.rb +0 -2
- data/app/serializers/alchemy/essence_richtext_serializer.rb +0 -2
- data/app/serializers/alchemy/essence_select_serializer.rb +0 -2
- data/app/serializers/alchemy/essence_text_serializer.rb +0 -2
- data/app/serializers/alchemy/legacy_element_serializer.rb +0 -3
- data/app/serializers/alchemy/page_serializer.rb +2 -8
- data/app/serializers/alchemy/page_tree_serializer.rb +1 -1
- data/app/serializers/alchemy/picture_serializer.rb +0 -2
- data/app/views/alchemy/admin/clipboard/index.html.erb +2 -2
- data/app/views/alchemy/admin/clipboard/insert.js.erb +9 -12
- data/app/views/alchemy/admin/contents/create.js.erb +4 -30
- data/app/views/alchemy/admin/elements/_element.html.erb +27 -12
- data/app/views/alchemy/admin/elements/_element_toolbar.html.erb +1 -1
- data/app/views/alchemy/admin/elements/_new_element_form.html.erb +0 -10
- data/app/views/alchemy/admin/elements/create.js.erb +12 -12
- data/app/views/alchemy/admin/elements/fold.js.erb +1 -1
- data/app/views/alchemy/admin/elements/index.html.erb +20 -19
- data/app/views/alchemy/admin/elements/publish.js.erb +5 -0
- data/app/views/alchemy/admin/elements/trash.js.erb +4 -1
- data/app/views/alchemy/admin/essence_pictures/assign.js.erb +0 -7
- data/app/views/alchemy/admin/essence_pictures/destroy.js.erb +0 -22
- data/app/views/alchemy/admin/pages/_publication_fields.html.erb +2 -4
- data/app/views/alchemy/admin/pages/edit.html.erb +1 -1
- data/app/views/alchemy/admin/pages/index.html.erb +14 -10
- data/app/views/alchemy/admin/partials/_language_tree_select.html.erb +1 -1
- data/app/views/alchemy/admin/partials/_main_navigation_entry.html.erb +1 -1
- data/app/views/alchemy/admin/partials/_remote_search_form.html.erb +7 -5
- data/app/views/alchemy/admin/partials/_routes.html.erb +0 -1
- data/app/views/alchemy/admin/partials/_search_form.html.erb +6 -4
- data/app/views/alchemy/admin/pictures/_picture_to_assign.html.erb +6 -3
- data/app/views/alchemy/admin/pictures/index.html.erb +1 -1
- data/app/views/alchemy/admin/trash/index.html.erb +8 -7
- data/app/views/alchemy/elements/_editor_not_found.html.erb +1 -1
- data/app/views/alchemy/essences/_essence_picture_editor.html.erb +4 -19
- data/app/views/layouts/alchemy/admin.html.erb +1 -0
- data/bin/rspec +0 -5
- data/config/alchemy/config.yml +3 -0
- data/config/brakeman.ignore +1 -1
- data/config/locales/alchemy.en.yml +6 -12
- data/config/routes.rb +1 -5
- data/db/migrate/20180226123013_alchemy_four_point_zero.rb +0 -29
- data/db/migrate/20180519204655_add_fixed_to_alchemy_elements.rb +6 -0
- data/lib/alchemy/admin/locale.rb +1 -1
- data/lib/alchemy/cache_digests/template_tracker.rb +4 -27
- data/lib/alchemy/elements_finder.rb +111 -0
- data/lib/alchemy/errors.rb +0 -4
- data/lib/alchemy/modules.rb +49 -18
- data/lib/alchemy/tasks/tidy.rb +3 -40
- data/lib/alchemy/test_support/controller_requests.rb +1 -1
- data/lib/alchemy/test_support/essence_shared_examples.rb +1 -1
- data/lib/alchemy/test_support/factories/attachment_factory.rb +5 -3
- data/lib/alchemy/test_support/factories/content_factory.rb +4 -4
- data/lib/alchemy/test_support/factories/dummy_user_factory.rb +5 -5
- data/lib/alchemy/test_support/factories/element_factory.rb +12 -7
- data/lib/alchemy/test_support/factories/essence_text_factory.rb +1 -1
- data/lib/alchemy/test_support/factories/language_factory.rb +13 -13
- data/lib/alchemy/test_support/factories/page_factory.rb +18 -17
- data/lib/alchemy/test_support/factories/picture_factory.rb +6 -4
- data/lib/alchemy/test_support/factories/site_factory.rb +6 -6
- data/lib/alchemy/tinymce.rb +1 -1
- data/lib/alchemy/upgrader/four_point_two.rb +68 -0
- data/lib/alchemy/upgrader/tasks/cells_migration.rb +41 -0
- data/lib/alchemy/upgrader/tasks/cells_upgrader.rb +146 -0
- data/lib/alchemy/upgrader/tasks/picture_gallery_migration.rb +65 -0
- data/lib/alchemy/upgrader/tasks/picture_gallery_upgrader.rb +195 -0
- data/lib/alchemy/version.rb +1 -1
- data/lib/alchemy_cms.rb +1 -0
- data/lib/rails/generators/alchemy/elements/elements_generator.rb +1 -0
- data/lib/rails/generators/alchemy/elements/templates/editor.html.erb +0 -3
- data/lib/rails/generators/alchemy/elements/templates/editor.html.haml +0 -3
- data/lib/rails/generators/alchemy/elements/templates/editor.html.slim +0 -3
- data/lib/rails/generators/alchemy/elements/templates/view.html.erb +3 -14
- data/lib/rails/generators/alchemy/elements/templates/view.html.haml +3 -10
- data/lib/rails/generators/alchemy/elements/templates/view.html.slim +3 -10
- data/lib/tasks/alchemy/tidy.rake +1 -23
- data/lib/tasks/alchemy/upgrade.rake +44 -1
- data/vendor/assets/javascripts/flatpickr/flatpickr.min.js +2 -0
- data/vendor/assets/javascripts/tinymce/license.txt +0 -0
- data/vendor/assets/javascripts/tinymce/tinymce.min.js +2 -2
- metadata +25 -31
- data/app/assets/stylesheets/alchemy/jquery.datetimepicker.scss +0 -478
- data/app/models/alchemy/cell.rb +0 -95
- data/app/models/alchemy/page/page_cells.rb +0 -69
- data/app/serializers/alchemy/cell_serializer.rb +0 -19
- data/app/views/alchemy/admin/contents/new.html.erb +0 -11
- data/app/views/alchemy/admin/contents/order.js.erb +0 -3
- data/app/views/alchemy/admin/elements/_add_picture.html.erb +0 -14
- data/app/views/alchemy/admin/elements/_picture_gallery_editor.html.erb +0 -24
- data/bin/spring +0 -16
- data/lib/alchemy/test_support/factories/cell_factory.rb +0 -9
- data/vendor/assets/javascripts/date-formatter.js +0 -161
- data/vendor/assets/javascripts/jquery_plugins/jquery.datetimepicker.full.min.js +0 -2
@@ -2,8 +2,6 @@
|
|
2
2
|
|
3
3
|
module Alchemy
|
4
4
|
class PageSerializer < ActiveModel::Serializer
|
5
|
-
self.root = false
|
6
|
-
|
7
5
|
attributes :id,
|
8
6
|
:name,
|
9
7
|
:urlname,
|
@@ -17,14 +15,10 @@ module Alchemy
|
|
17
15
|
:updated_at,
|
18
16
|
:status
|
19
17
|
|
20
|
-
has_many :elements
|
18
|
+
has_many :elements
|
21
19
|
|
22
20
|
def elements
|
23
|
-
|
24
|
-
object.elements.not_in_cell.published
|
25
|
-
else
|
26
|
-
object.elements.published
|
27
|
-
end
|
21
|
+
object.elements.published
|
28
22
|
end
|
29
23
|
end
|
30
24
|
end
|
@@ -67,7 +67,7 @@ module Alchemy
|
|
67
67
|
}
|
68
68
|
|
69
69
|
if opts[:elements]
|
70
|
-
p_hash.update(elements: ActiveModel::
|
70
|
+
p_hash.update(elements: ActiveModel::Serializer::CollectionSerializer.new(page_elements(page)))
|
71
71
|
end
|
72
72
|
|
73
73
|
if opts[:ability].can?(:index, :alchemy_admin_pages)
|
@@ -10,14 +10,14 @@
|
|
10
10
|
<li id="clipboard_item_<%= item.id -%>" class="<%= item_class -%>">
|
11
11
|
<% if item_class == 'pages' %>
|
12
12
|
<%= render_icon(:file, style: 'regular') %>
|
13
|
-
<%= item.name %>
|
13
|
+
<%= truncate(item.name, length: 50) %>
|
14
14
|
<% else %>
|
15
15
|
<% if item.public? %>
|
16
16
|
<%= render_icon('window-maximize', style: 'regular', class: 'element') %>
|
17
17
|
<% else %>
|
18
18
|
<%= render_icon('window-close', class: 'element') %>
|
19
19
|
<% end %>
|
20
|
-
<%= item.display_name_with_preview_text(
|
20
|
+
<%= truncate(item.display_name_with_preview_text(50), length: 50) %>
|
21
21
|
<% end %>
|
22
22
|
<span class="float_right">
|
23
23
|
<%= link_to render_icon(:times, size: 'xs'),
|
@@ -1,19 +1,16 @@
|
|
1
1
|
<% if params[:remove] -%>
|
2
|
+
$(".element-editor[data-element-id='<%= @item.id %>']").remove();
|
2
3
|
|
3
|
-
|
4
|
+
<% if @item.class.name == 'Alchemy::Element' -%>
|
5
|
+
$('#element_area .sortable-elements').sortable('refresh');
|
4
6
|
|
5
|
-
<% if @item.
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
<% end -%>
|
10
|
-
|
11
|
-
Alchemy.growl('<%= j Alchemy.t("item moved to clipboard", name: @item.class.to_s == "Alchemy::Element" ? @item.display_name_with_preview_text : @item.name) %>');
|
7
|
+
<% if @item.fixed? -%>
|
8
|
+
Alchemy.FixedElements.removeTab(<%= @item.id %>);
|
9
|
+
<% end -%>
|
10
|
+
<% end -%>
|
12
11
|
|
12
|
+
Alchemy.growl('<%= j Alchemy.t("item moved to clipboard", name: @item.class.name == "Alchemy::Element" ? @item.display_name_with_preview_text : @item.name) %>');
|
13
13
|
<% else -%>
|
14
|
-
|
15
|
-
Alchemy.growl('<%= j Alchemy.t("item copied to clipboard", name: @item.class.to_s == "Alchemy::Element" ? @item.display_name_with_preview_text : @item.name) %>')
|
16
|
-
|
14
|
+
Alchemy.growl('<%= j Alchemy.t("item copied to clipboard", name: @item.class.name == "Alchemy::Element" ? @item.display_name_with_preview_text : @item.name) %>')
|
17
15
|
<% end -%>
|
18
|
-
|
19
16
|
$('#clipboard_button .icon').removeClass('fa-clipboard').addClass('fa-paste');
|
@@ -2,41 +2,15 @@ var editor_html = '<%= j(render "alchemy/essences/#{@content.essence_partial_nam
|
|
2
2
|
content: @content, options: options_from_params, html_options: @html_options
|
3
3
|
}) %>';
|
4
4
|
|
5
|
-
|
5
|
+
$("[data-element-<%= @content.element_id %>-missing-content=\"<%= @content.name %>\"]").replaceWith(editor_html);
|
6
6
|
|
7
|
-
|
7
|
+
<% if @content.essence_type == "Alchemy::EssencePicture" && @content.ingredient %>
|
8
8
|
|
9
|
-
<% else %>
|
10
|
-
|
11
|
-
$("<%= @content_dom_id %>").before(editor_html);
|
12
|
-
Alchemy.Buttons.enable();
|
13
|
-
Alchemy.growl('<%= j Alchemy.t("Successfully added content") % {content: @content.name_for_label} %>')
|
14
|
-
|
15
|
-
<% end %>
|
16
|
-
|
17
|
-
<% if @content.essence_type == "Alchemy::EssencePicture" %>
|
18
|
-
|
19
|
-
<% if @content.ingredient %>
|
20
9
|
$('#picture_to_assign_<%= @content.ingredient.id %> a').attr('href', '#').off('click');
|
21
|
-
<% end %>
|
22
|
-
|
23
|
-
<% if @gallery_pictures %>
|
24
|
-
|
25
|
-
<% if @gallery_pictures.size > 1 %>
|
26
|
-
$('#element_<%= @element.id %>_contents .essence_picture').addClass('draggable_picture');
|
27
|
-
<% end %>
|
28
|
-
|
29
|
-
<% if !max_image_count.blank? && @gallery_pictures.size >= max_image_count %>
|
30
|
-
$("#add_picture_<%= @element.id %>").remove();
|
31
|
-
<% end %>
|
32
|
-
|
33
|
-
Alchemy.SortableContents('#element_<%= @element.id %>_contents', '<%= form_authenticity_token %>');
|
34
|
-
|
35
|
-
<% end %>
|
36
10
|
|
37
11
|
<% elsif @content.essence_type == "Alchemy::EssenceDate" %>
|
38
12
|
|
39
|
-
Alchemy.Datepicker('#element_<%= @
|
13
|
+
Alchemy.Datepicker('#element_<%= @content.element_id %>');
|
40
14
|
|
41
15
|
<% elsif @content.essence_type == "Alchemy::EssenceRichtext" %>
|
42
16
|
|
@@ -46,4 +20,4 @@ Alchemy.Tinymce.initEditor(<%= @content.id %>);
|
|
46
20
|
|
47
21
|
Alchemy.reloadPreview();
|
48
22
|
Alchemy.closeCurrentDialog();
|
49
|
-
Alchemy.SelectBox("#element_<%= @
|
23
|
+
Alchemy.SelectBox("#element_<%= @content.element_id %>");
|
@@ -1,11 +1,13 @@
|
|
1
1
|
<%= content_tag :div,
|
2
2
|
id: "element_#{element.id}",
|
3
3
|
data: {'element-id' => element.id, 'element-name' => element.name},
|
4
|
-
class: element_editor_classes(element
|
4
|
+
class: element_editor_classes(element) do %>
|
5
5
|
|
6
|
-
|
6
|
+
<% unless element.fixed? %>
|
7
|
+
<%= render 'alchemy/admin/elements/element_header', element: element %>
|
8
|
+
<% end %>
|
7
9
|
|
8
|
-
<% if element.expanded? %>
|
10
|
+
<% if element.expanded? || element.fixed? %>
|
9
11
|
<%= render 'alchemy/admin/elements/element_toolbar', element: element %>
|
10
12
|
|
11
13
|
<%= form_for [alchemy, :admin, element], remote: true,
|
@@ -38,15 +40,28 @@
|
|
38
40
|
<%= render partial: 'alchemy/admin/elements/element', collection: element.nested_elements %>
|
39
41
|
<% end %>
|
40
42
|
|
41
|
-
<% if element.expanded? %>
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
43
|
+
<% if element.expanded? || element.fixed? %>
|
44
|
+
<% if element.nestable_elements.length == 1 %>
|
45
|
+
<% nestable_element = element.nestable_elements.first %>
|
46
|
+
<%= form_for [:admin, Alchemy::Element.new(name: nestable_element)],
|
47
|
+
remote: true, html: { class: 'add-nested-element-form', id: nil } do |f| %>
|
48
|
+
<%= f.hidden_field :name %>
|
49
|
+
<%= f.hidden_field :page_id, value: element.page_id %>
|
50
|
+
<%= f.hidden_field :parent_element_id, value: element.id %>
|
51
|
+
<button class="button add-nestable-element-button" data-alchemy-button>
|
52
|
+
<%= Alchemy.t(:add_nested_element) % { name: Alchemy.t(nestable_element, scope: 'element_names') } %>
|
53
|
+
</button>
|
54
|
+
<% end %>
|
55
|
+
<% else %>
|
56
|
+
<%= link_to_dialog Alchemy.t("New Element"),
|
57
|
+
alchemy.new_admin_element_path(
|
58
|
+
parent_element_id: element.id,
|
59
|
+
page_id: element.page.id
|
60
|
+
), {
|
61
|
+
size: "320x125",
|
62
|
+
title: Alchemy.t("New Element")
|
63
|
+
}, class: "button add-nestable-element-button" %>
|
64
|
+
<% end %>
|
50
65
|
<% end %>
|
51
66
|
</div>
|
52
67
|
<% end %>
|
@@ -5,21 +5,11 @@
|
|
5
5
|
<%- else -%>
|
6
6
|
<%= alchemy_form_for [:admin, @element] do |form| %>
|
7
7
|
<%= form.hidden_field :page_id %>
|
8
|
-
<%- if @page.can_have_cells? && @parent_element.blank? -%>
|
9
|
-
<%= form.input :name,
|
10
|
-
label: Alchemy.t(:element_of_type),
|
11
|
-
collection: grouped_elements_for_select(@elements),
|
12
|
-
as: :grouped_select,
|
13
|
-
group_method: :second,
|
14
|
-
prompt: Alchemy.t(:select_element),
|
15
|
-
input_html: {class: 'alchemy_selectbox', autofocus: true} %>
|
16
|
-
<%- else -%>
|
17
8
|
<%= form.input :name,
|
18
9
|
label: Alchemy.t(:element_of_type),
|
19
10
|
collection: elements_for_select(@elements),
|
20
11
|
prompt: Alchemy.t(:select_element),
|
21
12
|
input_html: {class: 'alchemy_selectbox', autofocus: true} %>
|
22
|
-
<%- end -%>
|
23
13
|
<%= form.hidden_field :parent_element_id, value: @parent_element.try(:id) %>
|
24
14
|
<%= form.submit Alchemy.t(:add) %>
|
25
15
|
<%- end -%>
|
@@ -3,22 +3,22 @@
|
|
3
3
|
var $element_area;
|
4
4
|
var element_html = '<%= j render("element", element: @element, draggable: true) %>';
|
5
5
|
|
6
|
-
<%- if @
|
7
|
-
$('.element-editor[data-element-id="<%= @
|
6
|
+
<%- if @cut_element_id -%>
|
7
|
+
$('.element-editor[data-element-id="<%= @cut_element_id %>"]').remove();
|
8
8
|
<%- end -%>
|
9
9
|
|
10
|
-
|
11
|
-
if ($('#
|
12
|
-
Alchemy.
|
10
|
+
<% if @element.fixed? %>
|
11
|
+
if ($('#fixed-elements').length == 0) {
|
12
|
+
Alchemy.FixedElements.buildTabs('<%= Alchemy.t(:main_content) %>');
|
13
13
|
}
|
14
|
-
Alchemy.
|
15
|
-
|
16
|
-
|
17
|
-
<%- if @element.parent_element -%>
|
14
|
+
Alchemy.FixedElements.createTab('<%= @element.id %>', '<%= @element.display_name %>');
|
15
|
+
$element_area = $('#fixed-element-<%= @element.id %>');
|
16
|
+
<% elsif @element.parent_element %>
|
18
17
|
$element_area = $('#element_<%= @element.parent_element_id %> > .nestable-elements > .nested-elements');
|
19
|
-
|
20
|
-
|
21
|
-
|
18
|
+
Alchemy.Buttons.enable('.nestable-elements');
|
19
|
+
<% else %>
|
20
|
+
$element_area = $('#main-content-elements');
|
21
|
+
<% end %>
|
22
22
|
|
23
23
|
<%- if @insert_at_top -%>
|
24
24
|
$element_area.prepend(element_html);
|
@@ -10,7 +10,7 @@
|
|
10
10
|
|
11
11
|
$el.replaceWith('<%= j render(partial: "element", object: @element) %>');
|
12
12
|
$el = $('#element_<%= @element.id %>');
|
13
|
-
$('#element_area .
|
13
|
+
$('#element_area .sortable-elements').sortable('refresh');
|
14
14
|
|
15
15
|
<% if @element.folded? -%>
|
16
16
|
|
@@ -1,32 +1,33 @@
|
|
1
|
-
<% if @
|
2
|
-
<div id="
|
1
|
+
<% if @fixed_elements.any? %>
|
2
|
+
<div id="fixed-elements">
|
3
3
|
<ul>
|
4
|
-
<li
|
5
|
-
|
4
|
+
<li>
|
5
|
+
<a href="#main-content-elements">
|
6
|
+
<%= Alchemy.t(:main_content) %>
|
7
|
+
</a>
|
8
|
+
</li>
|
9
|
+
<% @fixed_elements.each do |element| %>
|
6
10
|
<li>
|
7
|
-
<a href="#
|
8
|
-
<%=
|
11
|
+
<a href="#fixed-element-<%= element.id %>">
|
12
|
+
<%= element.display_name %>
|
9
13
|
</a>
|
10
14
|
</li>
|
11
15
|
<% end %>
|
12
16
|
</ul>
|
13
|
-
<div id="
|
14
|
-
|
15
|
-
data-droppable-elements="<%= @page.element_names_from_definition.join(' ') %>">
|
16
|
-
<%= render partial: 'alchemy/admin/elements/element',
|
17
|
-
collection: @page.elements.not_trashed.not_in_cell %>
|
17
|
+
<div id="main-content-elements" class="sortable-elements" data-droppable-elements="<%= @page.element_definition_names.join(' ') %>">
|
18
|
+
<%= render partial: 'alchemy/admin/elements/element', collection: @elements %>
|
18
19
|
</div>
|
19
|
-
<% @
|
20
|
-
|
21
|
-
id
|
22
|
-
class
|
23
|
-
data
|
24
|
-
<%= render
|
25
|
-
|
20
|
+
<% @fixed_elements.each do |element| %>
|
21
|
+
<div
|
22
|
+
id="fixed-element-<%= element.id %>"
|
23
|
+
class="sortable-elements"
|
24
|
+
data-droppable-elements="<%= element.nestable_elements.join(' ') %>">
|
25
|
+
<%= render 'alchemy/admin/elements/element', element: element %>
|
26
|
+
</div>
|
26
27
|
<% end %>
|
27
28
|
</div>
|
28
29
|
<% else %>
|
29
|
-
<div
|
30
|
+
<div id="main-content-elements" class="sortable-elements" data-droppable-elements="<%= @page.element_definition_names.join(' ') %>">
|
30
31
|
<%= render partial: 'alchemy/admin/elements/element', collection: @elements %>
|
31
32
|
</div>
|
32
33
|
<% end %>
|