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
@@ -1,14 +1,19 @@
|
|
1
1
|
var el = $('.element-editor[data-element-id="<%= @element.id %>"]');
|
2
2
|
var icon = el.find('> .element-header > .element-handle > .icon');
|
3
3
|
var label = el.find('> .element-toolbar .publish-element-button label');
|
4
|
+
var eye = el.find('> .element-toolbar .publish-element-button .icon');
|
4
5
|
|
5
6
|
<%- if @element.public? -%>
|
6
7
|
icon.removeClass('fa-window-close fas');
|
7
8
|
icon.addClass('fa-window-maximize far');
|
9
|
+
eye.removeClass('fa-eye');
|
10
|
+
eye.addClass('fa-eye-slash');
|
8
11
|
label.text('<%= Alchemy.t(:hide_element) %>');
|
9
12
|
<%- else -%>
|
10
13
|
icon.removeClass('fa-window-maximize far');
|
11
14
|
icon.addClass('fa-window-close fas');
|
15
|
+
eye.removeClass('fa-eye-slash');
|
16
|
+
eye.addClass('fa-eye');
|
12
17
|
label.text('<%= Alchemy.t(:show_element) %>');
|
13
18
|
<%- end -%>
|
14
19
|
|
@@ -1,11 +1,14 @@
|
|
1
1
|
$('#element_<%= @element.id %>').hide(200, function() {
|
2
2
|
$(this).remove();
|
3
3
|
Alchemy.growl('<%= j Alchemy.t("Element trashed") %>');
|
4
|
-
$('#element_area .
|
4
|
+
$('#element_area .sortable-elements').sortable('refresh');
|
5
5
|
Alchemy.TrashWindow.refresh();
|
6
6
|
$('#element_trash_button .icon').addClass('full');
|
7
7
|
Alchemy.PreviewWindow.refresh();
|
8
8
|
<% @element.richtext_contents_ids.each do |id| %>
|
9
9
|
tinymce.get('tinymce_<%= id %>').remove();
|
10
10
|
<% end %>
|
11
|
+
<% if @element.fixed? %>
|
12
|
+
Alchemy.FixedElements.removeTab(<%= @element.id %>);
|
13
|
+
<% end %>
|
11
14
|
});
|
@@ -6,12 +6,5 @@ $('#<%= @content.dom_id -%>').replaceWith('<%= j(
|
|
6
6
|
options: options_from_params
|
7
7
|
)
|
8
8
|
) %>');
|
9
|
-
|
10
|
-
<% if @content.siblings.essence_pictures.count > 1 %>
|
11
|
-
|
12
|
-
Alchemy.SortableContents('#<%= @content.element.id -%>_contents', '<%= form_authenticity_token %>');
|
13
|
-
|
14
|
-
<% end %>
|
15
|
-
|
16
9
|
Alchemy.closeCurrentDialog();
|
17
10
|
Alchemy.setElementDirty('#element_<%= @content.element.id %>');
|
@@ -1,27 +1,5 @@
|
|
1
1
|
(function() {
|
2
|
-
var $picture_editor = $('#element_<%= @element.id %>_contents');
|
3
|
-
|
4
2
|
$('#essence_picture_<%= @content_id %>').remove();
|
5
|
-
|
6
|
-
<% if max_image_count.present? && @essence_pictures.size < max_image_count.to_i -%>
|
7
|
-
|
8
|
-
if ($('div.add_picture', $picture_editor).length === 0) {
|
9
|
-
$picture_editor.append('<%= j(
|
10
|
-
render "alchemy/admin/elements/add_picture",
|
11
|
-
element: @element,
|
12
|
-
options: options_from_params
|
13
|
-
) %>');
|
14
|
-
}
|
15
|
-
|
16
|
-
<% end -%>
|
17
|
-
|
18
|
-
<% if @essence_pictures.size > 1 %>
|
19
|
-
Alchemy.SortableContents($picture_editor.selector, '<%= form_authenticity_token %>');
|
20
|
-
<% else %>
|
21
|
-
$picture_editor.find('.draggable_picture').removeClass('draggable_picture');
|
22
|
-
$picture_editor.sortable('destroy');
|
23
|
-
<% end %>
|
24
3
|
Alchemy.reloadPreview();
|
25
4
|
Alchemy.pleaseWaitOverlay(false);
|
26
|
-
|
27
5
|
})()
|
@@ -1,6 +1,4 @@
|
|
1
|
-
<% checkbox = check_box_tag :page_public, nil, @page.public?, name: nil,
|
2
|
-
data: {date_format: I18n.t(:datetimepicker, scope: 'time.formats.alchemy')},
|
3
|
-
disabled: @page.attribute_fixed?(:public_on) %>
|
1
|
+
<% checkbox = check_box_tag :page_public, nil, @page.public?, name: nil, disabled: @page.attribute_fixed?(:public_on) %>
|
4
2
|
|
5
3
|
<label class="checkbox">
|
6
4
|
<% if @page.attribute_fixed?(:public_on) || @page.attribute_fixed?(:public_until) %>
|
@@ -32,4 +30,4 @@
|
|
32
30
|
<%= alchemy_datepicker @page, :public_until, type: :datetime,
|
33
31
|
disabled: @page.attribute_fixed?(:public_until) %>
|
34
32
|
</div>
|
35
|
-
<% end %>
|
33
|
+
<% end %>
|
@@ -178,7 +178,7 @@
|
|
178
178
|
Alchemy.ElementEditors.init();
|
179
179
|
Alchemy.SelectBox('.element-editor');
|
180
180
|
Alchemy.Tinymce.init(<%= @page.richtext_contents_ids.to_json %>);
|
181
|
-
$('#
|
181
|
+
$('#fixed-elements').tabs().tabs('paging', {
|
182
182
|
follow: true,
|
183
183
|
followOnSelect: true,
|
184
184
|
prevButton: '<i class="fas fa-angle-double-left"></i>',
|
@@ -45,16 +45,20 @@
|
|
45
45
|
<label><%= Alchemy.t('Show clipboard') %></label>
|
46
46
|
</div>
|
47
47
|
</div>
|
48
|
-
<div class="
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
48
|
+
<div class="search_form">
|
49
|
+
<div class="search_field">
|
50
|
+
<label>
|
51
|
+
<%= text_field_tag 'filter', '',
|
52
|
+
class: 'search_input_field',
|
53
|
+
placeholder: Alchemy.t(:search),
|
54
|
+
id: nil %>
|
55
|
+
<%= render_icon :search %>
|
56
|
+
</label>
|
57
|
+
<%= link_to(render_icon(:times, size: 'xs'), '#', {
|
58
|
+
class: "search_field_clear",
|
59
|
+
title: Alchemy.t(:click_to_show_all)
|
60
|
+
}) %>
|
61
|
+
</div>
|
58
62
|
</div>
|
59
63
|
<% end %>
|
60
64
|
|
@@ -1,5 +1,5 @@
|
|
1
1
|
<% if can? *navigate_module(navigation) %>
|
2
|
-
<%= content_tag :div, class: main_navigation_css_classes(navigation) do %>
|
2
|
+
<%= content_tag :div, class: main_navigation_css_classes(navigation), data: navigation["data"] do %>
|
3
3
|
<%= link_to url_for_module(alchemy_module) do %>
|
4
4
|
<% if navigation["image"] %>
|
5
5
|
<%= image_tag(navigation["image"]) %>
|
@@ -6,11 +6,13 @@
|
|
6
6
|
<%= hidden_field_tag("element_id", @element.blank? ? "" : @element.id) %>
|
7
7
|
<%= hidden_field_tag("content_id", @content.blank? ? "" : @content.id) %>
|
8
8
|
<div class="search_field">
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
9
|
+
<label>
|
10
|
+
<%= render_icon('search') %>
|
11
|
+
<%= f.search_field resource_handler.search_field_name,
|
12
|
+
placeholder: Alchemy.t(:search),
|
13
|
+
class: 'search_input_field',
|
14
|
+
id: nil %>
|
15
|
+
</label>
|
14
16
|
<%= link_to render_icon(:times, size: 'xs'), url_for(
|
15
17
|
action: 'index',
|
16
18
|
element_id: @element.blank? ? '' : @element.id,
|
@@ -16,7 +16,6 @@
|
|
16
16
|
},
|
17
17
|
|
18
18
|
list_admin_elements_path: '<%= alchemy.list_admin_elements_path %>',
|
19
|
-
order_admin_contents_path: '<%= alchemy.order_admin_contents_path %>',
|
20
19
|
order_admin_elements_path: '<%= alchemy.order_admin_elements_path %>',
|
21
20
|
order_admin_pages_path: '<%= alchemy.order_admin_pages_path %>',
|
22
21
|
link_admin_pages_path: '<%= alchemy.link_admin_pages_path %>'
|
@@ -2,10 +2,12 @@
|
|
2
2
|
|
3
3
|
<%= search_form_for @query, url: url, class: 'search_form' do |f| %>
|
4
4
|
<div class="search_field">
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
5
|
+
<label>
|
6
|
+
<%= render_icon('search') %>
|
7
|
+
<%= f.search_field resource_handler.search_field_name,
|
8
|
+
class: 'search_input_field',
|
9
|
+
placeholder: Alchemy.t(:search) %>
|
10
|
+
</label>
|
9
11
|
<% local_assigns.fetch(:additional_query_fields, []).each do |field| %>
|
10
12
|
<%= f.hidden_field field %>
|
11
13
|
<% end %>
|
@@ -1,14 +1,17 @@
|
|
1
1
|
<div class="picture_thumbnail assign_image_list_detail <%= size.blank? ? 'medium' : size %>" name="<%= picture_to_assign.name %>" id="picture_to_assign_<%= picture_to_assign.id %>">
|
2
|
-
<% action_url = create_or_assign_url(picture_to_assign, options) %>
|
3
2
|
<%= link_to(
|
4
3
|
image_tag(
|
5
4
|
picture_to_assign.url(size: preview_size(size), flatten: true),
|
6
5
|
alt: picture_to_assign.name
|
7
6
|
),
|
8
|
-
|
7
|
+
alchemy.assign_admin_essence_pictures_path(
|
8
|
+
picture_id: picture_to_assign.id,
|
9
|
+
content_id: @content,
|
10
|
+
options: options
|
11
|
+
),
|
9
12
|
remote: true,
|
10
13
|
onclick: '$(self).attr("href", "#").off("click"); return false',
|
11
|
-
method:
|
14
|
+
method: 'put',
|
12
15
|
title: Alchemy.t(:assign_image),
|
13
16
|
class: 'thumbnail_background'
|
14
17
|
) %>
|
@@ -55,7 +55,7 @@
|
|
55
55
|
additional_params: [:filter, :tagged_with, :size] %>
|
56
56
|
<% end %>
|
57
57
|
|
58
|
-
<div id="picture_archive" class="resources-table-wrapper">
|
58
|
+
<div id="picture_archive" class="resources-table-wrapper with_tag_filter">
|
59
59
|
<div class="resources-header">
|
60
60
|
<h2>
|
61
61
|
<%= @pictures.total_count %>
|
@@ -8,13 +8,14 @@
|
|
8
8
|
<% end %>
|
9
9
|
<div id="trash_items">
|
10
10
|
<%- @elements.each do |element| -%>
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
11
|
+
<% draggable = @allowed_elements.any? { |e|
|
12
|
+
!e['fixed'] && e['name'] == element.name || element.name.in?(e.fetch('nestable_elements', []))
|
13
|
+
} %>
|
14
|
+
<%= content_tag :div,
|
15
|
+
data: {'element-id' => element.id, 'element-name' => element.name},
|
16
|
+
class: ['element-editor', draggable ? 'draggable' : 'not-draggable'] do %>
|
17
|
+
<%= render 'alchemy/admin/elements/element_header', element: element %>
|
18
|
+
<% end %>
|
18
19
|
<%- end -%>
|
19
20
|
</div>
|
20
21
|
<p>
|
@@ -1,25 +1,10 @@
|
|
1
|
-
<%= content_tag :div, id: content.dom_id, data: {"content-id" => content.id}, class:
|
2
|
-
|
3
|
-
options[:sortable] ? "draggable_picture" : nil,
|
4
|
-
options[:grouped] ? nil : "content_editor"
|
5
|
-
].compact.join(" ") do %>
|
6
|
-
<% unless options[:grouped] %><%= content_label(content) %><br/><% end %>
|
1
|
+
<%= content_tag :div, id: content.dom_id, data: {"content-id" => content.id}, class: "content_editor essence_picture" do %>
|
2
|
+
<%= content_label(content) %>
|
7
3
|
<div class="picture_thumbnail">
|
8
4
|
<span class="picture_tool delete">
|
9
|
-
|
10
|
-
|
11
|
-
alchemy.admin_essence_picture_path(
|
12
|
-
id: content,
|
13
|
-
options: options
|
14
|
-
), {title: Alchemy.t(:delete_image)} %>
|
15
|
-
<% else %>
|
16
|
-
<%= link_to render_icon(:times), '#',
|
17
|
-
onclick: "return Alchemy.removePicture('##{content.form_field_id(:picture_id)}');" %>
|
18
|
-
<% end %>
|
5
|
+
<%= link_to render_icon(:times), '#',
|
6
|
+
onclick: "return Alchemy.removePicture('##{content.form_field_id(:picture_id)}');" %>
|
19
7
|
</span>
|
20
|
-
<%- if content.ingredient -%>
|
21
|
-
<div class="picture_handle" title="<%= Alchemy.t(:drag_to_sort) if options[:sortable] %>"></div>
|
22
|
-
<%- end -%>
|
23
8
|
<div class="picture_image">
|
24
9
|
<div class="thumbnail_background">
|
25
10
|
<%- if content.ingredient -%>
|
@@ -2,6 +2,7 @@
|
|
2
2
|
<html class="no-js">
|
3
3
|
<head>
|
4
4
|
<meta charset="utf-8">
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
5
6
|
<title><%= render_alchemy_title %></title>
|
6
7
|
<link rel="shortcut icon" href="<%= asset_path('alchemy/favicon.ico') %>">
|
7
8
|
<%= csrf_meta_tag %>
|
data/bin/rspec
CHANGED
data/config/alchemy/config.yml
CHANGED
@@ -195,3 +195,6 @@ format_matchers:
|
|
195
195
|
email: !ruby/regexp '/\A[^@\s]+@([^@\s]+\.)+[^@\s]+\z/'
|
196
196
|
url: !ruby/regexp '/\A[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5}(:[0-9]{1,5})?(\/.*)?\z/ix'
|
197
197
|
link_url: !ruby/regexp '/^(mailto:|\/|[a-z]+:\/\/)/'
|
198
|
+
|
199
|
+
# The layout used for rendering the +alchemy/admin/pages#show+ action.
|
200
|
+
admin_page_preview_layout: application
|
data/config/brakeman.ignore
CHANGED
@@ -29,7 +29,7 @@
|
|
29
29
|
"file": "app/views/alchemy/admin/contents/create.js.erb",
|
30
30
|
"line": 1,
|
31
31
|
"link": "http://brakemanscanner.org/docs/warning_types/dynamic_render_path/",
|
32
|
-
"code": "render(action => \"alchemy/essences/#{Content.
|
32
|
+
"code": "render(action => \"alchemy/essences/#{Content.create(Element.find(params[:content][:element_id]), content_params).essence_partial_name}_editor\", { :content => Content.create(Element.find(params[:content][:element_id]), content_params), :options => options_from_params, :html_options => ((params[:html_options] or {})) })",
|
33
33
|
"render_path": [{"type":"controller","class":"Alchemy::Admin::ContentsController","method":"create","line":21,"file":"app/controllers/alchemy/admin/contents_controller.rb"}],
|
34
34
|
"location": {
|
35
35
|
"type": "template",
|
@@ -157,6 +157,7 @@ en:
|
|
157
157
|
site:
|
158
158
|
aliases: Please separate additional domains with spaces or new lines.
|
159
159
|
|
160
|
+
add_nested_element: "Add %{name}"
|
160
161
|
anchor: 'Anchor'
|
161
162
|
attribute_fixed: Value can't be changed for this page type
|
162
163
|
back: 'back'
|
@@ -270,7 +271,6 @@ en:
|
|
270
271
|
"Sort pages": "Reorder pages"
|
271
272
|
"Successfully added content": "Successfully added %{content}"
|
272
273
|
"Successfully deleted content": "Successfully deleted %{content}"
|
273
|
-
"Successfully saved content position": "Successfully saved content position"
|
274
274
|
"Tags": "Tags"
|
275
275
|
"These pictures could not be deleted, because they were in use": "These pictures could not be deleted, because they were in use: %{names}"
|
276
276
|
"This page is locked": "This page is currently locked by %{name}"
|
@@ -299,8 +299,6 @@ en:
|
|
299
299
|
"Your trash is empty": "Your trash is empty"
|
300
300
|
above: "above"
|
301
301
|
add: "Add"
|
302
|
-
"add new content": "Add new content"
|
303
|
-
add_image_to_element: "Add an image"
|
304
302
|
align_in_text: "Alignment in text"
|
305
303
|
all: "all"
|
306
304
|
all_pictures: "All pictures"
|
@@ -414,8 +412,8 @@ en:
|
|
414
412
|
file: "File"
|
415
413
|
internal: "Internal"
|
416
414
|
link_title: "Link title"
|
417
|
-
login: "
|
418
|
-
logout: "
|
415
|
+
login: "Login"
|
416
|
+
logout: "Logout"
|
419
417
|
mail_to: "Recipient"
|
420
418
|
main_content: "Main content"
|
421
419
|
male: "Male"
|
@@ -485,7 +483,6 @@ en:
|
|
485
483
|
comma_seperated: "Separate by comma"
|
486
484
|
password: "Password"
|
487
485
|
paste: "paste"
|
488
|
-
picture_gallery_editor: 'Pictures'
|
489
486
|
picture_library:
|
490
487
|
filter:
|
491
488
|
last_upload: "from last upload"
|
@@ -574,11 +571,11 @@ en:
|
|
574
571
|
you_can_rename_this_tag: "You can rename this tag"
|
575
572
|
zoom_image: "Zoom this image"
|
576
573
|
"Leave Alchemy": "Leave Alchemy"
|
577
|
-
leave: "
|
574
|
+
leave: "Leave"
|
578
575
|
"You are about to leave Alchemy": "You are about to leave Alchemy"
|
579
576
|
"Do you want to": "Do you want to"
|
580
|
-
"stay logged in": "
|
581
|
-
"or to completely": "or
|
577
|
+
"stay logged in": "Stay Logged In"
|
578
|
+
"or to completely": "or completely"
|
582
579
|
"Are you sure?": "Are you sure?"
|
583
580
|
"Create": "Create"
|
584
581
|
"Edit": "Edit"
|
@@ -619,14 +616,11 @@ en:
|
|
619
616
|
time:
|
620
617
|
formats:
|
621
618
|
alchemy:
|
622
|
-
datepicker: "%Y-%m-%d"
|
623
|
-
datetimepicker: "%Y-%m-%d %H:%M"
|
624
619
|
default: "%a, %d %b %Y %H:%M:%S %z"
|
625
620
|
essence_date: "%Y-%m-%d"
|
626
621
|
page_status: "%m.%d.%Y %H:%M"
|
627
622
|
short_datetime: "%d %b %H:%M"
|
628
623
|
time: "%H:%M"
|
629
|
-
timepicker: "%H:%M"
|
630
624
|
|
631
625
|
# Translations for error messages.
|
632
626
|
errors:
|
data/config/routes.rb
CHANGED
@@ -15,11 +15,7 @@ Alchemy::Engine.routes.draw do
|
|
15
15
|
end
|
16
16
|
|
17
17
|
namespace :admin, {path: Alchemy.admin_path, constraints: Alchemy.admin_constraints} do
|
18
|
-
resources :contents, only: [:create]
|
19
|
-
collection do
|
20
|
-
post :order
|
21
|
-
end
|
22
|
-
end
|
18
|
+
resources :contents, only: [:create]
|
23
19
|
|
24
20
|
resources :pages do
|
25
21
|
resources :elements
|
@@ -18,16 +18,6 @@ class AlchemyFourPointZero < ActiveRecord::Migration[5.0]
|
|
18
18
|
end
|
19
19
|
end
|
20
20
|
|
21
|
-
unless table_exists?(:alchemy_cells)
|
22
|
-
create_table :alchemy_cells do |t|
|
23
|
-
t.integer "page_id", null: false
|
24
|
-
t.string "name"
|
25
|
-
t.datetime "created_at", null: false, precision: 6
|
26
|
-
t.datetime "updated_at", null: false, precision: 6
|
27
|
-
t.index ["page_id"], name: "index_alchemy_cells_on_page_id"
|
28
|
-
end
|
29
|
-
end
|
30
|
-
|
31
21
|
unless table_exists?(:alchemy_contents)
|
32
22
|
create_table :alchemy_contents do |t|
|
33
23
|
t.string "name"
|
@@ -56,10 +46,8 @@ class AlchemyFourPointZero < ActiveRecord::Migration[5.0]
|
|
56
46
|
t.datetime "updated_at", null: false, precision: 6
|
57
47
|
t.integer "creator_id"
|
58
48
|
t.integer "updater_id"
|
59
|
-
t.integer "cell_id"
|
60
49
|
t.text "cached_tag_list"
|
61
50
|
t.integer "parent_element_id"
|
62
|
-
t.index ["cell_id"], name: "index_alchemy_elements_on_cell_id"
|
63
51
|
t.index ["page_id", "parent_element_id"], name: "index_alchemy_elements_on_page_id_and_parent_element_id"
|
64
52
|
t.index ["page_id", "position"], name: "index_elements_on_page_id_and_position"
|
65
53
|
end
|
@@ -332,14 +320,6 @@ class AlchemyFourPointZero < ActiveRecord::Migration[5.0]
|
|
332
320
|
end
|
333
321
|
end
|
334
322
|
|
335
|
-
unless foreign_key_exists?(:alchemy_cells, column: :page_id)
|
336
|
-
add_foreign_key :alchemy_cells, :alchemy_pages,
|
337
|
-
column: :page_id,
|
338
|
-
on_update: :cascade,
|
339
|
-
on_delete: :cascade,
|
340
|
-
name: :alchemy_cells_page_id_fkey
|
341
|
-
end
|
342
|
-
|
343
323
|
unless foreign_key_exists?(:alchemy_contents, column: :element_id)
|
344
324
|
add_foreign_key :alchemy_contents, :alchemy_elements,
|
345
325
|
column: :element_id,
|
@@ -355,19 +335,10 @@ class AlchemyFourPointZero < ActiveRecord::Migration[5.0]
|
|
355
335
|
on_delete: :cascade,
|
356
336
|
name: :alchemy_elements_page_id_fkey
|
357
337
|
end
|
358
|
-
|
359
|
-
unless foreign_key_exists?(:alchemy_elements, column: :cell_id)
|
360
|
-
add_foreign_key :alchemy_elements, :alchemy_cells,
|
361
|
-
column: :cell_id,
|
362
|
-
on_update: :cascade,
|
363
|
-
on_delete: :cascade,
|
364
|
-
name: :alchemy_elements_cell_id_fkey
|
365
|
-
end
|
366
338
|
end
|
367
339
|
|
368
340
|
def down
|
369
341
|
drop_table(:alchemy_attachments) if table_exists?(:alchemy_attachments)
|
370
|
-
drop_table(:alchemy_cells) if table_exists?(:alchemy_cells)
|
371
342
|
drop_table(:alchemy_contents) if table_exists?(:alchemy_contents)
|
372
343
|
drop_table(:alchemy_elements) if table_exists?(:alchemy_elements)
|
373
344
|
drop_table(:alchemy_elements_alchemy_pages) if table_exists?(:alchemy_elements_alchemy_pages)
|