alchemy_cms 2.6.3 → 2.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.simplecov +14 -0
- data/.travis.yml +1 -1
- data/Gemfile +7 -6
- data/README.md +15 -5
- data/alchemy_cms.gemspec +3 -2
- data/app/assets/javascripts/alchemy/alchemy.base.js.coffee +9 -17
- data/app/assets/javascripts/alchemy/alchemy.dirty.js.coffee +70 -0
- data/app/assets/javascripts/alchemy/alchemy.dragndrop.js.coffee +80 -0
- data/app/assets/javascripts/alchemy/alchemy.element_editors.js.coffee +43 -19
- data/app/assets/javascripts/alchemy/alchemy.gui.js.coffee +3 -1
- data/app/assets/javascripts/alchemy/alchemy.js +4 -2
- data/app/assets/javascripts/alchemy/alchemy.onload.js.coffee +1 -1
- data/app/assets/javascripts/alchemy/alchemy.spinner.js.coffee +14 -0
- data/app/assets/javascripts/alchemy/alchemy.tinymce.js.coffee.erb +96 -0
- data/app/assets/javascripts/alchemy/alchemy.translations.js.coffee +22 -0
- data/app/assets/javascripts/alchemy/alchemy.windows.js.coffee +28 -17
- data/app/assets/stylesheets/alchemy/base.scss +6 -0
- data/app/assets/stylesheets/alchemy/elements.scss +2 -28
- data/app/assets/stylesheets/alchemy/errors.scss +1 -1
- data/app/assets/stylesheets/alchemy/menubar.css.scss +2 -0
- data/app/assets/stylesheets/alchemy/sitemap.scss +21 -34
- data/app/assets/stylesheets/alchemy/tables.scss +13 -3
- data/app/controllers/alchemy/admin/attachments_controller.rb +10 -5
- data/app/controllers/alchemy/admin/base_controller.rb +19 -0
- data/app/controllers/alchemy/admin/contents_controller.rb +1 -4
- data/app/controllers/alchemy/admin/dashboard_controller.rb +2 -1
- data/app/controllers/alchemy/admin/elements_controller.rb +1 -1
- data/app/controllers/alchemy/admin/essence_files_controller.rb +1 -1
- data/app/controllers/alchemy/admin/essence_pictures_controller.rb +70 -56
- data/app/controllers/alchemy/admin/pages_controller.rb +37 -114
- data/app/controllers/alchemy/admin/pictures_controller.rb +5 -12
- data/app/controllers/alchemy/admin/resources_controller.rb +3 -1
- data/app/controllers/alchemy/admin/trash_controller.rb +1 -1
- data/app/controllers/alchemy/attachments_controller.rb +1 -1
- data/app/controllers/alchemy/base_controller.rb +3 -15
- data/app/controllers/alchemy/messages_controller.rb +4 -10
- data/app/controllers/alchemy/pages_controller.rb +6 -6
- data/app/controllers/alchemy/passwords_controller.rb +1 -1
- data/app/controllers/alchemy/user_sessions_controller.rb +1 -1
- data/app/helpers/alchemy/admin/base_helper.rb +49 -230
- data/app/helpers/alchemy/admin/contents_helper.rb +5 -1
- data/app/helpers/alchemy/admin/elements_helper.rb +19 -47
- data/app/helpers/alchemy/admin/essences_helper.rb +59 -17
- data/app/helpers/alchemy/admin/navigation_helper.rb +204 -0
- data/app/helpers/alchemy/admin/pages_helper.rb +22 -79
- data/app/helpers/alchemy/admin/pictures_helper.rb +1 -1
- data/app/helpers/alchemy/admin/tags_helper.rb +42 -0
- data/app/helpers/alchemy/base_helper.rb +0 -11
- data/app/helpers/alchemy/elements_helper.rb +48 -25
- data/app/helpers/alchemy/essences_helper.rb +0 -20
- data/app/helpers/alchemy/pages_helper.rb +18 -14
- data/app/helpers/alchemy/url_helper.rb +1 -0
- data/app/mailers/alchemy/messages.rb +4 -6
- data/app/models/alchemy/attachment.rb +3 -0
- data/app/models/alchemy/cell.rb +33 -35
- data/app/models/alchemy/content.rb +20 -111
- data/app/models/alchemy/content/factory.rb +188 -0
- data/app/models/alchemy/element.rb +51 -200
- data/app/models/alchemy/element/definitions.rb +52 -0
- data/app/models/alchemy/element/presenters.rb +87 -0
- data/app/models/alchemy/essence_date.rb +1 -1
- data/app/models/alchemy/essence_file.rb +6 -7
- data/app/models/alchemy/essence_picture.rb +19 -4
- data/app/models/alchemy/message.rb +18 -14
- data/app/models/alchemy/page.rb +120 -214
- data/app/models/alchemy/page/elements.rb +145 -36
- data/app/models/alchemy/page/natures.rb +90 -0
- data/app/models/alchemy/page/scopes.rb +93 -0
- data/app/models/alchemy/page/users.rb +25 -0
- data/app/models/alchemy/picture.rb +15 -0
- data/app/models/alchemy/site.rb +15 -1
- data/app/models/alchemy/site/layout.rb +38 -0
- data/app/models/alchemy/user.rb +13 -3
- data/app/views/alchemy/admin/attachments/_archive_overlay.html.erb +7 -7
- data/app/views/alchemy/admin/attachments/_file_to_assign.html.erb +8 -8
- data/app/views/alchemy/admin/attachments/_tag_list.html.erb +1 -16
- data/app/views/alchemy/admin/attachments/destroy.js.erb +1 -4
- data/app/views/alchemy/admin/contents/create.js.erb +1 -1
- data/app/views/alchemy/admin/dashboard/index.html.erb +14 -13
- data/app/views/alchemy/admin/elements/_element_head.html.erb +7 -7
- data/app/views/alchemy/admin/elements/_refresh_editor.js.erb +10 -0
- data/app/views/alchemy/admin/elements/create.js.erb +44 -44
- data/app/views/alchemy/admin/elements/fold.js.erb +22 -26
- data/app/views/alchemy/admin/elements/trash.js.erb +1 -1
- data/app/views/alchemy/admin/elements/update.js.erb +22 -25
- data/app/views/alchemy/admin/essence_files/assign.js.erb +8 -3
- data/app/views/alchemy/admin/essence_pictures/crop.html.erb +14 -12
- data/app/views/alchemy/admin/essence_pictures/edit.html.erb +22 -39
- data/app/views/alchemy/admin/pages/_page.html.erb +73 -80
- data/app/views/alchemy/admin/pages/destroy.js.erb +2 -2
- data/app/views/alchemy/admin/pages/edit.html.erb +21 -18
- data/app/views/alchemy/admin/pages/fold.js.erb +1 -0
- data/app/views/alchemy/admin/pages/info.html.erb +32 -0
- data/app/views/alchemy/admin/partials/_main_navigation_entry.html.erb +11 -13
- data/app/views/alchemy/admin/partials/_remote_search_form.html.erb +20 -20
- data/app/views/alchemy/admin/partials/_sub_navigation.html.erb +8 -0
- data/app/views/alchemy/admin/partials/_toolbar_button.html.erb +25 -0
- data/app/views/alchemy/admin/partials/_upload_form.html.erb +15 -15
- data/app/views/alchemy/admin/pictures/_filter_and_size_bar.html.erb +39 -39
- data/app/views/alchemy/admin/pictures/_picture_to_assign.html.erb +10 -10
- data/app/views/alchemy/admin/pictures/_tag_list.html.erb +1 -16
- data/app/views/alchemy/admin/resources/destroy.js.erb +1 -1
- data/app/views/alchemy/base/500.html.erb +1 -1
- data/app/views/alchemy/base/permission_denied.js.erb +1 -1
- data/app/views/alchemy/base/redirect.js.erb +1 -1
- data/app/views/alchemy/essences/_essence_link_editor.html.erb +1 -1
- data/app/views/alchemy/essences/_essence_picture_editor.html.erb +1 -1
- data/app/views/alchemy/essences/_essence_richtext_editor.html.erb +1 -1
- data/app/views/alchemy/essences/_essence_text_editor.html.erb +1 -1
- data/app/views/alchemy/essences/{_essence_picture_tools.html.erb → shared/_essence_picture_tools.html.erb} +5 -5
- data/app/views/alchemy/essences/{_linkable_essence_tools.html.erb → shared/_linkable_essence_tools.html.erb} +0 -0
- data/app/views/alchemy/messages/contact_form_mail.de.text.erb +12 -0
- data/app/views/alchemy/messages/contact_form_mail.en.text.erb +12 -0
- data/app/views/alchemy/notifications/reset_password_instructions.de.text.erb +1 -1
- data/app/views/alchemy/notifications/reset_password_instructions.en.text.erb +2 -2
- data/app/views/alchemy/pages/sitemap.xml.erb +3 -5
- data/app/views/alchemy/user_sessions/leave.html.erb +1 -1
- data/app/views/layouts/alchemy/admin.html.erb +4 -2
- data/app/views/layouts/alchemy/sitemap.xml.erb +1 -1
- data/bin/alchemy +7 -13
- data/config/alchemy/config.yml +1 -0
- data/config/authorization_rules.rb +2 -3
- data/config/initializers/dragonfly.rb +2 -0
- data/config/locales/alchemy.de.yml +8 -9
- data/config/locales/alchemy.en.yml +7 -4
- data/config/routes.rb +3 -0
- data/db/migrate/{20130214233001_alchemy_two_point_five.rb → 20130827094554_alchemy_two_point_six.rb} +29 -6
- data/lib/alchemy/auth/engine.rb +9 -0
- data/lib/alchemy/capistrano.rb +37 -12
- data/lib/alchemy/config.rb +48 -35
- data/lib/alchemy/engine.rb +35 -6
- data/lib/alchemy/essence.rb +25 -29
- data/lib/alchemy/ferret/search.rb +86 -0
- data/lib/alchemy/{scoped_pagination_url_helper.rb → kaminari/scoped_pagination_url_helper.rb} +0 -0
- data/lib/alchemy/logger.rb +3 -4
- data/lib/alchemy/page_layout.rb +124 -55
- data/lib/alchemy/resource.rb +0 -10
- data/lib/alchemy/resources_helper.rb +0 -5
- data/lib/alchemy/seeder.rb +1 -32
- data/lib/alchemy/shell.rb +6 -1
- data/lib/alchemy/tinymce.rb +41 -32
- data/lib/alchemy/upgrader.rb +3 -1
- data/lib/alchemy/upgrader/two_point_five.rb +15 -8
- data/lib/alchemy/upgrader/two_point_one.rb +10 -10
- data/lib/alchemy/upgrader/two_point_two.rb +96 -51
- data/lib/alchemy/version.rb +1 -1
- data/lib/alchemy_cms.rb +5 -46
- data/lib/rails/generators/alchemy/deploy_script/templates/deploy.rb.tt +1 -1
- data/lib/rails/generators/alchemy/devise/devise_generator.rb +9 -4
- data/lib/rails/generators/alchemy/essence/essence_generator.rb +7 -6
- data/lib/rails/generators/alchemy/essence/templates/editor.html.erb +1 -1
- data/lib/rails/generators/alchemy/scaffold/files/_standard.html.erb +1 -0
- data/lib/rails/generators/alchemy/scaffold/scaffold_generator.rb +1 -0
- data/lib/rails/generators/alchemy/site_layouts/site_layouts_generator.rb +23 -0
- data/lib/rails/generators/alchemy/site_layouts/templates/layout.html.erb +1 -0
- data/lib/rails/generators/alchemy/site_layouts/templates/layout.html.haml +1 -0
- data/lib/rails/generators/alchemy/site_layouts/templates/layout.html.slim +1 -0
- data/lib/rails/templates/alchemy.rb +2 -2
- data/lib/tasks/alchemy/db.rake +3 -1
- data/lib/tasks/alchemy/tidy.rake +82 -0
- data/lib/tasks/alchemy/upgrade.rake +2 -1
- data/spec/controllers/admin/attachments_controller_spec.rb +124 -0
- data/spec/controllers/admin/base_controller_spec.rb +35 -0
- data/spec/controllers/admin/clipboard_controller_spec.rb +1 -1
- data/spec/controllers/admin/contents_controller_spec.rb +17 -26
- data/spec/controllers/admin/dashboard_controller_spec.rb +121 -0
- data/spec/controllers/admin/elements_controller_spec.rb +1 -1
- data/spec/controllers/admin/essence_files_controller_spec.rb +67 -0
- data/spec/controllers/admin/essence_pictures_controller_spec.rb +161 -0
- data/spec/controllers/admin/languages_controller_spec.rb +1 -1
- data/spec/controllers/admin/layoutpages_controller_spec.rb +28 -0
- data/spec/controllers/admin/pages_controller_spec.rb +164 -118
- data/spec/controllers/admin/pictures_controller_spec.rb +89 -0
- data/spec/controllers/admin/trash_controller_spec.rb +21 -31
- data/spec/controllers/admin/users_controller_spec.rb +114 -85
- data/spec/controllers/attachments_controller_spec.rb +6 -2
- data/spec/controllers/base_controller_spec.rb +22 -0
- data/spec/controllers/elements_controller_spec.rb +1 -1
- data/spec/controllers/messages_controller_spec.rb +200 -0
- data/spec/controllers/pictures_controller_spec.rb +1 -1
- data/spec/controllers/user_sessions_controller_spec.rb +7 -6
- data/spec/controllers/users_controller_spec.rb +2 -2
- data/spec/dummy/config/alchemy/cells.yml +2 -0
- data/spec/dummy/config/application.rb +19 -8
- data/spec/dummy/db/migrate/{20130214233001_alchemy_two_point_five.rb → 20130827094554_alchemy_two_point_six.rb} +29 -6
- data/spec/dummy/db/schema.rb +1 -1
- data/spec/fast_specs.rb +15 -0
- data/spec/helpers/admin/base_helper_spec.rb +53 -34
- data/spec/helpers/admin/contents_helper_spec.rb +15 -7
- data/spec/helpers/admin/elements_helper_spec.rb +79 -34
- data/spec/helpers/admin/essences_helper_spec.rb +45 -31
- data/spec/helpers/admin/navigation_helper_spec.rb +204 -0
- data/spec/helpers/admin/pages_helper_spec.rb +25 -15
- data/spec/helpers/admin/tags_helper_spec.rb +62 -2
- data/spec/helpers/elements_helper_spec.rb +202 -138
- data/spec/helpers/pages_helper_spec.rb +48 -0
- data/spec/helpers/url_helper_spec.rb +7 -0
- data/spec/libraries/config_spec.rb +110 -3
- data/spec/libraries/essence_spec.rb +29 -9
- data/spec/libraries/page_layout_spec.rb +134 -0
- data/spec/libraries/resource_spec.rb +3 -16
- data/spec/libraries/resources_helper_spec.rb +4 -8
- data/spec/libraries/shell_spec.rb +1 -0
- data/spec/libraries/tinymce_spec.rb +61 -0
- data/spec/mailers/messages_spec.rb +23 -0
- data/spec/models/attachment_spec.rb +45 -0
- data/spec/models/cell_spec.rb +62 -9
- data/spec/models/content_spec.rb +110 -28
- data/spec/models/element_spec.rb +275 -253
- data/spec/models/essence_date_spec.rb +25 -0
- data/spec/models/essence_file_spec.rb +23 -0
- data/spec/models/essence_html_spec.rb +13 -0
- data/spec/models/essence_picture_spec.rb +16 -0
- data/spec/models/essence_text_spec.rb +29 -0
- data/spec/models/language_spec.rb +34 -0
- data/spec/models/message_spec.rb +43 -0
- data/spec/models/page_spec.rb +726 -567
- data/spec/models/picture_spec.rb +98 -0
- data/spec/models/site_spec.rb +60 -2
- data/spec/models/tag_spec.rb +31 -0
- data/spec/models/user_spec.rb +4 -4
- data/spec/spec_helper.rb +49 -58
- data/spec/support/alchemy/controller_helpers.rb +35 -0
- data/spec/support/alchemy/{specs_helpers.rb → integration_helpers.rb} +4 -8
- data/spec/{factories.rb → support/factories.rb} +11 -1
- data/vendor/assets/javascripts/jquery_plugins/jquery.ui.nestedSortable.js +2 -8
- metadata +166 -106
- data/Guardfile +0 -16
- data/app/assets/javascripts/alchemy/alchemy.dirty.js +0 -93
- data/app/assets/javascripts/alchemy/alchemy.dragndrop.js +0 -122
- data/app/models/alchemy/tree_node.rb +0 -4
- data/app/views/alchemy/admin/pages/_page_infos.html.erb +0 -3
- data/app/views/alchemy/admin/partials/_sub_navigation_tab.html.erb +0 -8
- data/app/views/alchemy/messages/contact_form_mail.text.erb +0 -12
- data/config/initializers/kaminari_config.rb +0 -9
- data/db/migrate/20130221200514_migrate_attachments_to_dragonfly.rb +0 -21
- data/db/migrate/20130312205327_change_alchemy_users_role_to_roles.rb +0 -11
- data/lib/alchemy/auth_engine.rb +0 -7
- data/lib/alchemy/authentication_helpers.rb +0 -9
- data/lib/alchemy/ferret_search.rb +0 -84
- data/lib/extensions/array.rb +0 -25
- data/lib/extensions/hash.rb +0 -34
- data/spec/dummy/db/migrate/20130221200514_migrate_attachments_to_dragonfly.rb +0 -21
- data/spec/dummy/db/migrate/20130312205327_change_alchemy_users_role_to_roles.rb +0 -11
- data/spec/models/page_layout_spec.rb +0 -60
@@ -1,25 +1,22 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
$('div.element_handle span.icon', $el).removeClass('element_<%= @element.public? ? "draft" : "public" %>').addClass('element_<%= @element.public? ? "public" : "draft" %>');
|
5
|
-
$('.element_heading .preview_text_element_name', $el).html('<%= @element.display_name %>');
|
6
|
-
$('.element_heading .preview_text_quote', $el).html('<%= escape_javascript(@element.preview_text) %>');
|
7
|
-
$('div.content_editor').removeClass('validation_failed');
|
8
|
-
$("#element_<%= @element.id %>_errors").hide();
|
9
|
-
Alchemy.setElementSaved($el);
|
10
|
-
Alchemy.growl('<%= _t(:element_saved) %>');
|
11
|
-
Alchemy.PreviewWindow.refresh();
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
$('
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
Alchemy.Buttons.enable($el);
|
24
|
-
|
25
|
-
<% end %>
|
1
|
+
(function() {
|
2
|
+
var $el = $('#element_<%= @element.id %>');
|
3
|
+
<%- if @element_validated -%>
|
4
|
+
$('div.element_handle span.icon', $el).removeClass('element_<%= @element.public? ? "draft" : "public" %>').addClass('element_<%= @element.public? ? "public" : "draft" %>');
|
5
|
+
$('.element_heading .preview_text_element_name', $el).html('<%= @element.display_name %>');
|
6
|
+
$('.element_heading .preview_text_quote', $el).html('<%= escape_javascript(@element.preview_text) %>');
|
7
|
+
$('div.content_editor').removeClass('validation_failed');
|
8
|
+
$("#element_<%= @element.id %>_errors").hide();
|
9
|
+
Alchemy.setElementSaved($el);
|
10
|
+
Alchemy.growl('<%= _t(:element_saved) %>');
|
11
|
+
Alchemy.PreviewWindow.refresh();
|
12
|
+
<%= update_essence_select_elements(@page, @element) -%>
|
13
|
+
<%- else -%>
|
14
|
+
Alchemy.growl('<%= escape_javascript(@notice) %>', 'warn');
|
15
|
+
$('#element_<%= @element.id %>_errors').html('<%= escape_javascript(@error_message) %><ul><li><%= escape_javascript(@element.essence_error_messages.join("</li><li>").html_safe) %></li></ul>');
|
16
|
+
$("#element_<%= @element.id %>_errors").show();
|
17
|
+
$('div.content_editor').removeClass('validation_failed');
|
18
|
+
$('<%= @element.contents_with_errors.map { |content| "#" + content_dom_id(content) }.join(", ") %>').addClass('validation_failed');
|
19
|
+
Alchemy.ElementEditors.scrollToElement('#element_<%= @element.id %>');
|
20
|
+
Alchemy.Buttons.enable($el);
|
21
|
+
<%- end -%>
|
22
|
+
})();
|
@@ -1,10 +1,15 @@
|
|
1
1
|
(function($) {
|
2
|
-
|
3
2
|
var $el = $('#element_<%= @content.element.id %>');
|
4
|
-
$('#<%= content_dom_id(@content) %>').replaceWith('<%= escape_javascript(
|
3
|
+
$('#<%= content_dom_id(@content) %>').replaceWith('<%= escape_javascript(
|
4
|
+
render partial: "alchemy/essences/essence_file_editor",
|
5
|
+
formats: [:html],
|
6
|
+
locals: {
|
7
|
+
content: @content,
|
8
|
+
options: @options
|
9
|
+
}
|
10
|
+
) %>');
|
5
11
|
Alchemy.closeCurrentWindow();
|
6
12
|
Alchemy.reloadPreview();
|
7
13
|
Alchemy.setElementDirty($el);
|
8
14
|
Alchemy.overlayObserver($el);
|
9
|
-
|
10
15
|
})(jQuery);
|
@@ -1,6 +1,6 @@
|
|
1
1
|
<div id="jscropper">
|
2
2
|
<% if @no_image_notice %>
|
3
|
-
<%= render_message do %>
|
3
|
+
<%= render_message :warn do %>
|
4
4
|
<%= @no_image_notice %>
|
5
5
|
<% end %>
|
6
6
|
<% else %>
|
@@ -9,27 +9,28 @@
|
|
9
9
|
<% end %>
|
10
10
|
<div class="thumbnail_background">
|
11
11
|
<%= image_tag(
|
12
|
-
show_alchemy_picture_path(@
|
13
|
-
:
|
12
|
+
show_alchemy_picture_path(@picture, size: '800x600', format: 'png'),
|
13
|
+
id: 'imageToCrop'
|
14
14
|
) %>
|
15
15
|
</div>
|
16
16
|
<%= form_for(
|
17
17
|
@essence_picture,
|
18
|
-
:
|
19
|
-
:
|
20
|
-
:
|
18
|
+
url: alchemy.admin_essence_picture_path(@essence_picture, options: @options.to_json),
|
19
|
+
id: 'image_cropper_form',
|
20
|
+
remote: true
|
21
21
|
) do |f| %>
|
22
22
|
<%= f.hidden_field :crop_from %>
|
23
23
|
<%= f.hidden_field :crop_size %>
|
24
24
|
<%= hidden_field_tag :content_id, @content.id %>
|
25
25
|
<%= link_to(render_icon('delete-small') + _t('Reset Imagemask'), '#', {
|
26
|
-
:
|
27
|
-
:
|
26
|
+
onclick: 'Alchemy.ImageCropper.reset()',
|
27
|
+
class: 'button with_icon'
|
28
28
|
}) %>
|
29
|
-
<%= f.button _t(:apply), :
|
29
|
+
<%= f.button _t(:apply), class: 'button' %>
|
30
30
|
<% end %>
|
31
|
-
<% end %>
|
32
31
|
</div>
|
32
|
+
<% end %>
|
33
|
+
<% if @initial_box && @default_box %>
|
33
34
|
<script type="text/javascript">
|
34
35
|
Alchemy.ImageLoader('#jscropper .thumbnail_background');
|
35
36
|
$('#imageToCrop').load(function() {
|
@@ -39,7 +40,8 @@
|
|
39
40
|
<%= @size_y %>,
|
40
41
|
[<%= @default_box[:x1] %>, <%= @default_box[:y1] %>, <%= @default_box[:x2] %>, <%= @default_box[:y2] %>],
|
41
42
|
<%= @ratio %>,
|
42
|
-
[<%= @
|
43
|
+
[<%= @picture.image_file_width %>, <%= @picture.image_file_height %>]
|
43
44
|
);
|
44
45
|
});
|
45
|
-
</script>
|
46
|
+
</script>
|
47
|
+
<% end %>
|
@@ -1,84 +1,67 @@
|
|
1
1
|
<%= form_for(
|
2
2
|
@essence_picture,
|
3
|
-
:
|
4
|
-
:
|
3
|
+
url: alchemy.admin_essence_picture_path(@essence_picture, options: @options.to_json),
|
4
|
+
remote: true
|
5
5
|
) do |f| %>
|
6
6
|
<table>
|
7
7
|
<tr>
|
8
8
|
<td class="label"><%= f.label "caption" %></td>
|
9
9
|
<td class="input">
|
10
10
|
<%- if @options[:caption_as_textarea] == 'true' -%>
|
11
|
-
<%= f.text_area "caption", :
|
11
|
+
<%= f.text_area "caption", class: 'thin_border' %>
|
12
12
|
<%- else -%>
|
13
|
-
<%= f.text_field "caption", :
|
13
|
+
<%= f.text_field "caption", class: 'thin_border' %>
|
14
14
|
<%- end -%>
|
15
15
|
</td>
|
16
16
|
</tr>
|
17
17
|
<tr>
|
18
18
|
<td class="label"><%= f.label "title" %></td>
|
19
|
-
<td class="input"><%= f.text_field "title", :
|
19
|
+
<td class="input"><%= f.text_field "title", class: 'thin_border' %></td>
|
20
20
|
</tr>
|
21
21
|
<tr>
|
22
22
|
<td class="label"><%= f.label "alt_tag" %></td>
|
23
|
-
<td class="input"><%= f.text_field "alt_tag", :
|
23
|
+
<td class="input"><%= f.text_field "alt_tag", class: 'thin_border' %></td>
|
24
24
|
</tr>
|
25
|
-
|
26
|
-
<%- if @options[:sizes].is_a?(HashWithIndifferentAccess) -%>
|
25
|
+
<%- if @options[:sizes].present? -%>
|
27
26
|
<tr>
|
28
27
|
<td class="label"><%= f.label "render_size" %></td>
|
29
28
|
<td class="select">
|
30
|
-
<%= f.select(
|
31
|
-
|
32
|
-
|
33
|
-
[[_t('Layout default'), @options[:image_size]]] + @options[:sizes].sort,
|
34
|
-
@essence_picture.render_size
|
35
|
-
), :class => 'alchemy_selectbox'
|
29
|
+
<%= f.select(:render_size,
|
30
|
+
[[_t('Layout default'), @options[:image_size]]] + @options[:sizes].to_a,
|
31
|
+
{}, {class: 'alchemy_selectbox'}
|
36
32
|
) %>
|
37
33
|
</td>
|
38
34
|
</tr>
|
39
|
-
<%- elsif @options[:sizes] && !@options[:sizes].is_a?(HashWithIndifferentAccess) -%>
|
40
|
-
<tr>
|
41
|
-
<td colspan="2">
|
42
|
-
<%= warning("Did not passed a Hash as sizes option", "Sizes Selector Error. Please provide a Hash.") %>
|
43
|
-
</td>
|
44
|
-
</tr>
|
45
35
|
<%- end -%>
|
46
|
-
<%- if @options[:image_float_selector]
|
36
|
+
<%- if @options[:image_float_selector] -%>
|
47
37
|
<tr>
|
48
38
|
<td class="label"><%= f.label "css_class" %></td>
|
49
39
|
<td class="select">
|
50
|
-
<%= f.select(
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
40
|
+
<%= f.select(:css_class, [
|
41
|
+
[_t("Layout default"), ""],
|
42
|
+
[_t(:above), "no_float"],
|
43
|
+
[_t(:left), "left"],
|
44
|
+
[_t(:right), "right"]
|
45
|
+
], {}, {class: 'alchemy_selectbox'}
|
55
46
|
) %>
|
56
47
|
</td>
|
57
48
|
</tr>
|
58
|
-
|
59
|
-
<%- elsif @options[:css_classes].is_a?(HashWithIndifferentAccess) -%>
|
49
|
+
<%- elsif @options[:css_classes].present? -%>
|
60
50
|
<tr>
|
61
51
|
<td class="label"><%= f.label "css_class" %></td>
|
62
52
|
<td class="select">
|
63
|
-
<%= f.select(
|
64
|
-
|
65
|
-
options_for_select([[_t('None'), '']] + @options[:css_classes].sort, @essence_picture.css_class),
|
53
|
+
<%= f.select(:css_class,
|
54
|
+
[[_t('None'), '']] + @options[:css_classes].to_a,
|
66
55
|
{},
|
67
|
-
{:
|
56
|
+
{class: 'alchemy_selectbox'}
|
68
57
|
) %>
|
69
58
|
</td>
|
70
59
|
</tr>
|
71
|
-
<%- elsif @options[:css_classes] && !@options[:css_classes].is_a?(HashWithIndifferentAccess) -%>
|
72
|
-
<tr>
|
73
|
-
<td colspan="2">
|
74
|
-
<%= warning("Did not passed a Hash as css_classes option", "CSS Class Selector Error. Please provide a Hash.") %>
|
75
|
-
</td>
|
76
|
-
</tr>
|
77
60
|
<%- end -%>
|
78
61
|
<tr>
|
79
62
|
<td colspan="2" class="submit">
|
80
63
|
<%= hidden_field_tag 'content_id', @content.id %>
|
81
|
-
<%= f.button _t(:apply), :
|
64
|
+
<%= f.button _t(:apply), class: 'button' %>
|
82
65
|
</td>
|
83
66
|
</tr>
|
84
67
|
</table>
|
@@ -1,91 +1,85 @@
|
|
1
|
-
<li id="page_<%= page.id %>" class="page_level_<%= "#{page.level} #{page.page_layout}" %>"
|
1
|
+
<li id="page_<%= page.id %>" class="page_level_<%= "#{page.level} #{page.page_layout}" %>">
|
2
2
|
<div class="sitemap_page<%= page.locked ? ' locked' : '' %>" name="<%= page.name %>">
|
3
3
|
<div class="sitemap_left_images">
|
4
|
-
<%=
|
5
|
-
<div class="site_status <%= @sorting && page.level > 1 ? 'handle' : nil %>">
|
6
|
-
<div class="tooltip">
|
7
|
-
<h3><%= _t(:page_type) %>:</h3>
|
8
|
-
<p><%= page.layout_display_name %></p>
|
9
|
-
<h3><%= _t(:page_status) %>:</h3>
|
10
|
-
<p><%= combined_page_status(page) %></p>
|
11
|
-
<h3><%= _t(:created_at) %>:</h3>
|
12
|
-
<p><%= l(page.created_at) %></p>
|
13
|
-
<h3><%= _t(:created_by) %>:</h3>
|
14
|
-
<p><%= page.creator %></p>
|
15
|
-
<h3><%= _t(:updated_at) %>:</h3>
|
16
|
-
<p><%= l(page.updated_at) %></p>
|
17
|
-
<h3><%= _t(:updated_by) %>:</h3>
|
18
|
-
<p><%= page.updater %></p>
|
19
|
-
<%- if page.locked? -%>
|
20
|
-
<h3><%= _t(:currently_edited_by) %>:</h3>
|
21
|
-
<p><%= page.current_editor %></p>
|
22
|
-
<%- end -%>
|
23
|
-
</div>
|
24
|
-
</div>
|
4
|
+
<%= sitemap_folder_link(page) unless page.level == 1 || page.children.blank? || @sorting %>
|
5
|
+
<div class="site_status <%= @sorting && page.level > 1 ? 'handle' : nil %>"></div>
|
25
6
|
</div>
|
26
7
|
<div class="sitemap_right_tools">
|
27
8
|
<%- unless @sorting -%>
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
<%- permitted_to?([:new, :destroy, :copy], :alchemy_admin_pages) do -%>
|
41
|
-
<span class="sitemap_sitetools">
|
42
|
-
<%- permitted_to?(:copy, :alchemy_admin_pages) do -%>
|
43
|
-
<%= link_to(
|
44
|
-
render_icon("copy_page"),
|
45
|
-
alchemy.insert_admin_clipboard_path(
|
46
|
-
:remarkable_type => page.class.name.demodulize.underscore.pluralize,
|
47
|
-
:remarkable_id => page.id
|
48
|
-
),
|
49
|
-
:remote => true,
|
50
|
-
:method => :post,
|
51
|
-
:class => "",
|
52
|
-
:title => _t(:copy_page)
|
53
|
-
) %>
|
9
|
+
<%- permitted_to?(:info, :alchemy_admin_pages) do -%>
|
10
|
+
<%= link_to_overlay_window(
|
11
|
+
render_icon('info'),
|
12
|
+
alchemy.info_admin_page_path(page),
|
13
|
+
{
|
14
|
+
title: _t(:page_infos),
|
15
|
+
size: '460x320'
|
16
|
+
},
|
17
|
+
{
|
18
|
+
title: _t(:page_infos)
|
19
|
+
}
|
20
|
+
) %>
|
54
21
|
<%- end -%>
|
55
|
-
<%- permitted_to?(:
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
:class => "",
|
66
|
-
:title => _t(:delete_page)
|
67
|
-
}
|
68
|
-
) -%>
|
22
|
+
<%- permitted_to?(:configure, :alchemy_admin_pages) do -%>
|
23
|
+
<%= link_to_overlay_window(
|
24
|
+
render_icon('configure_page'),
|
25
|
+
alchemy.configure_admin_page_path(page),
|
26
|
+
{
|
27
|
+
:title => _t(:edit_page_properties),
|
28
|
+
:size => page.redirects_to_external? ? '410x270' : '410x655'
|
29
|
+
},
|
30
|
+
:title => _t(:edit_page_properties)
|
31
|
+
) -%>
|
69
32
|
<%- end -%>
|
70
|
-
<%- permitted_to?(:new, :alchemy_admin_pages) do -%>
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
33
|
+
<%- permitted_to?([:new, :destroy, :copy], :alchemy_admin_pages) do -%>
|
34
|
+
<span class="sitemap_sitetools">
|
35
|
+
<%- permitted_to?(:copy, :alchemy_admin_pages) do -%>
|
36
|
+
<%= link_to(
|
37
|
+
render_icon("copy_page"),
|
38
|
+
alchemy.insert_admin_clipboard_path(
|
39
|
+
:remarkable_type => page.class.name.demodulize.underscore.pluralize,
|
40
|
+
:remarkable_id => page.id
|
41
|
+
),
|
42
|
+
:remote => true,
|
43
|
+
:method => :post,
|
44
|
+
:title => _t(:copy_page)
|
45
|
+
) %>
|
46
|
+
<%- end -%>
|
47
|
+
<%- permitted_to?(:destroy, :alchemy_admin_pages) do -%>
|
48
|
+
<%= link_to_confirmation_window(
|
49
|
+
render_icon('delete_page'),
|
50
|
+
_t(:confirm_to_delete_page),
|
51
|
+
url_for(
|
52
|
+
:controller => 'pages',
|
53
|
+
:action => 'destroy',
|
54
|
+
:id => page.id
|
55
|
+
),
|
56
|
+
{
|
57
|
+
:title => _t(:delete_page)
|
58
|
+
}
|
59
|
+
) -%>
|
60
|
+
<%- end -%>
|
61
|
+
<%- permitted_to?(:new, :alchemy_admin_pages) do -%>
|
62
|
+
<%= link_to_overlay_window(
|
63
|
+
render_icon('add_page'),
|
64
|
+
alchemy.new_admin_page_path(:parent_id => page.id),
|
65
|
+
{
|
66
|
+
:title => _t(:create_page),
|
67
|
+
:size => '340x150',
|
68
|
+
:overflow => true
|
69
|
+
},
|
70
|
+
{
|
71
|
+
:title => _t(:create_page)
|
72
|
+
}
|
73
|
+
) -%>
|
74
|
+
<%- end -%>
|
75
|
+
</span>
|
82
76
|
<%- end -%>
|
83
|
-
</span>
|
84
|
-
<%- end -%>
|
85
77
|
<%- end -%>
|
86
78
|
</div>
|
87
79
|
<div class="page_infos" id="page_<%= page.id %>_infos">
|
88
|
-
<%=
|
80
|
+
<span class="page_status <%= page.public ? 'public' : 'not_public' %>" title="<%= page.status_title(:public) %>"></span>
|
81
|
+
<span class="page_status <%= page.visible ? 'visible' : 'not_visible' %>" title="<%= page.status_title(:visible) %>"></span>
|
82
|
+
<span class="page_status <%= page.restricted ? 'restricted' : 'not_restricted' %>" title="<%= page.status_title(:restricted) %>"></span>
|
89
83
|
</div>
|
90
84
|
<div class="sitemap_sitename">
|
91
85
|
<%- if page.redirects_to_external? -%>
|
@@ -95,14 +89,13 @@
|
|
95
89
|
<%= h page.urlname %>
|
96
90
|
</span>
|
97
91
|
<%- else -%>
|
98
|
-
<%- cycle_class = cycle('even', 'odd') -%>
|
99
92
|
<%= link_to_unless(
|
100
93
|
@sorting,
|
101
94
|
page.name,
|
102
95
|
alchemy.edit_admin_page_path(page),
|
103
96
|
:title => _t(:edit_page),
|
104
|
-
:class => "sitemap_pagename_link
|
105
|
-
) { content_tag('span', page.name, :class => "sitemap_pagename_link
|
97
|
+
:class => "sitemap_pagename_link"
|
98
|
+
) { content_tag('span', page.name, :class => "sitemap_pagename_link") } -%>
|
106
99
|
<%- end -%>
|
107
100
|
</div>
|
108
101
|
</div>
|
@@ -2,7 +2,7 @@ $('#locked_page_<%= @page_id -%>').remove();
|
|
2
2
|
|
3
3
|
<% if @layoutpage %>
|
4
4
|
|
5
|
-
window.location.
|
5
|
+
window.location.href = '<%= alchemy.admin_layoutpages_path -%>';
|
6
6
|
|
7
7
|
<% elsif @page_root %>
|
8
8
|
|
@@ -12,7 +12,7 @@ Alchemy.overlayObserver('#sitemap');
|
|
12
12
|
|
13
13
|
<% else %>
|
14
14
|
|
15
|
-
window.location.
|
15
|
+
window.location.href = '<%= alchemy.admin_pages_path -%>';
|
16
16
|
|
17
17
|
<% end %>
|
18
18
|
|
@@ -42,6 +42,22 @@
|
|
42
42
|
<% end %>
|
43
43
|
</div>
|
44
44
|
<% end %>
|
45
|
+
<div class="button_with_label">
|
46
|
+
<%= link_to_overlay_window(
|
47
|
+
render_icon('info'),
|
48
|
+
alchemy.info_admin_page_path(@page),
|
49
|
+
{
|
50
|
+
title: _t(:page_infos),
|
51
|
+
size: '460x320'
|
52
|
+
},
|
53
|
+
{
|
54
|
+
class: 'icon_button',
|
55
|
+
title: _t(:page_infos),
|
56
|
+
'data-alchemy-hotkey' => 'alt-i'
|
57
|
+
}
|
58
|
+
) %>
|
59
|
+
<label><%= _t(:page_infos) %></label>
|
60
|
+
</div>
|
45
61
|
<div class="button_with_label">
|
46
62
|
<%= link_to_overlay_window(
|
47
63
|
render_icon('settings'),
|
@@ -92,7 +108,6 @@
|
|
92
108
|
<% end %>
|
93
109
|
|
94
110
|
<% content_for :javascripts do %>
|
95
|
-
<%= tinymce_javascript_tags %>
|
96
111
|
<script type="text/javascript" charset="utf-8">
|
97
112
|
|
98
113
|
Alchemy.openPreviewWindow = function() {
|
@@ -150,16 +165,10 @@
|
|
150
165
|
Alchemy.SortableElements(<%= @page.id %>, '<%= form_authenticity_token %>');
|
151
166
|
Alchemy.ElementEditors.init();
|
152
167
|
Alchemy.SelectBox('.element_editor');
|
153
|
-
Alchemy.Tinymce.init(
|
154
|
-
|
155
|
-
});
|
156
|
-
if (Alchemy.Tinymce.customInits) {
|
157
|
-
for (var i = Alchemy.Tinymce.customInits.length - 1; i >= 0; i--) {
|
158
|
-
Alchemy.Tinymce.customInits[i].call();
|
159
|
-
}
|
160
|
-
}
|
168
|
+
Alchemy.Tinymce.init();
|
169
|
+
Alchemy.Tinymce.initCustomEditors(<%= raw @page.custom_tinymce_contents_selectors.to_json %>);
|
161
170
|
jQuery('#cells').tabs().tabs('paging', { follow: true, followOnSelect: true } );
|
162
|
-
|
171
|
+
Alchemy.ElementDirtyObserver('#element_area');
|
163
172
|
if (window.location.hash) {
|
164
173
|
$(window.location.hash).trigger('Alchemy.SelectElementEditor');
|
165
174
|
}
|
@@ -167,18 +176,12 @@
|
|
167
176
|
}
|
168
177
|
|
169
178
|
jQuery(function($) {
|
170
|
-
var texts = {
|
171
|
-
title: '<%= _t("Warning!") %>',
|
172
|
-
message: '<%= _t(:element_dirty_page_leave_warning) %>',
|
173
|
-
okLabel: '<%= _t("Yes") %>',
|
174
|
-
cancelLabel: '<%= _t("No") %>'
|
175
|
-
};
|
176
179
|
$('#unlock_page_form, #visit_page_form, #publish_page_form').on('submit', function(event) {
|
177
|
-
var not_dirty = Alchemy.checkPageDirtyness(this
|
180
|
+
var not_dirty = Alchemy.checkPageDirtyness(this);
|
178
181
|
if (!not_dirty) Alchemy.pleaseWaitOverlay(false);
|
179
182
|
return not_dirty;
|
180
183
|
});
|
181
|
-
Alchemy.PageLeaveObserver(
|
184
|
+
Alchemy.PageLeaveObserver();
|
182
185
|
Alchemy.openElementsWindow();
|
183
186
|
Alchemy.openPreviewWindow();
|
184
187
|
|