alchemy_cms 3.4.2 → 3.5.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.codeclimate.yml +9 -3
- data/.teatro.yml +1 -0
- data/.travis.yml +14 -17
- data/CHANGELOG.md +44 -6
- data/Gemfile +7 -4
- data/README.md +60 -10
- data/Rakefile +1 -1
- data/alchemy_cms.gemspec +5 -8
- data/app/assets/javascripts/alchemy/admin.js +2 -0
- data/app/assets/javascripts/alchemy/alchemy.dialog.js.coffee +1 -0
- data/app/assets/javascripts/alchemy/alchemy.gui.js.coffee +1 -0
- data/app/assets/javascripts/alchemy/alchemy.hotkeys.js.coffee +1 -1
- data/app/assets/javascripts/alchemy/alchemy.initializer.js.coffee +9 -7
- data/app/assets/javascripts/alchemy/alchemy.link_dialog.js.coffee +1 -0
- data/app/assets/javascripts/alchemy/alchemy.preview_window.js.coffee +11 -7
- data/app/assets/javascripts/alchemy/alchemy.sitemap.js.coffee +1 -1
- data/app/assets/javascripts/alchemy/alchemy.tinymce.js.coffee +8 -3
- data/app/assets/javascripts/alchemy/alchemy.tooltips.coffee +10 -0
- data/app/assets/javascripts/alchemy/alchemy.uploader.js.coffee +104 -73
- data/app/assets/stylesheets/alchemy/_defaults.scss +1 -4
- data/app/assets/stylesheets/alchemy/_extends.scss +13 -35
- data/app/assets/stylesheets/alchemy/_mixins.scss +82 -18
- data/app/assets/stylesheets/alchemy/_variables.scss +21 -8
- data/app/assets/stylesheets/alchemy/admin.scss +4 -0
- data/app/assets/stylesheets/alchemy/archive.scss +8 -12
- data/app/assets/stylesheets/alchemy/attachments.scss +39 -0
- data/app/assets/stylesheets/alchemy/base.scss +26 -15
- data/app/assets/stylesheets/alchemy/buttons.scss +59 -31
- data/app/assets/stylesheets/alchemy/dashboard.scss +3 -3
- data/app/assets/stylesheets/alchemy/dialogs.scss +10 -8
- data/app/assets/stylesheets/alchemy/elements.scss +65 -41
- data/app/assets/stylesheets/alchemy/errors.scss +7 -0
- data/app/assets/stylesheets/alchemy/flash.scss +1 -1
- data/app/assets/stylesheets/alchemy/form_fields.scss +0 -37
- data/app/assets/stylesheets/alchemy/forms.scss +18 -27
- data/app/assets/stylesheets/alchemy/frame.scss +104 -204
- data/app/assets/stylesheets/alchemy/hints.scss +62 -0
- data/app/assets/stylesheets/alchemy/icon-font.scss +2 -1
- data/app/assets/stylesheets/alchemy/icons.scss +9 -4
- data/app/assets/stylesheets/alchemy/image_library.scss +6 -6
- data/app/assets/stylesheets/alchemy/jquery-ui.scss +6 -4
- data/app/assets/stylesheets/alchemy/lists.scss +0 -1
- data/app/assets/stylesheets/alchemy/menubar.scss +3 -4
- data/app/assets/stylesheets/alchemy/modules.scss +0 -6
- data/app/assets/stylesheets/alchemy/navigation.scss +242 -0
- data/app/assets/stylesheets/alchemy/pagination.scss +3 -3
- data/app/assets/stylesheets/alchemy/print.scss +1 -0
- data/app/assets/stylesheets/alchemy/resource_info.scss +45 -0
- data/app/assets/stylesheets/alchemy/search.scss +72 -1
- data/app/assets/stylesheets/alchemy/selects.scss +38 -44
- data/app/assets/stylesheets/alchemy/sitemap.scss +89 -79
- data/app/assets/stylesheets/alchemy/tables.scss +6 -10
- data/app/assets/stylesheets/alchemy/toolbar.scss +7 -36
- data/app/assets/stylesheets/alchemy/upload.scss +12 -3
- data/app/assets/stylesheets/tinymce/skins/alchemy/content.min.css.scss +6 -3
- data/app/assets/stylesheets/tinymce/skins/alchemy/fonts/tinymce-small.svg +58 -170
- data/app/assets/stylesheets/tinymce/skins/alchemy/fonts/tinymce-small.ttf +0 -0
- data/app/assets/stylesheets/tinymce/skins/alchemy/fonts/tinymce-small.woff +0 -0
- data/app/assets/stylesheets/tinymce/skins/alchemy/fonts/tinymce.svg +124 -148
- data/app/assets/stylesheets/tinymce/skins/alchemy/fonts/tinymce.ttf +0 -0
- data/app/assets/stylesheets/tinymce/skins/alchemy/fonts/tinymce.woff +0 -0
- data/app/assets/stylesheets/tinymce/skins/alchemy/skin.min.css.scss +426 -144
- data/app/controllers/alchemy/admin/attachments_controller.rb +24 -16
- data/app/controllers/alchemy/admin/clipboard_controller.rb +1 -1
- data/app/controllers/alchemy/admin/essence_files_controller.rb +1 -1
- data/app/controllers/alchemy/admin/essence_pictures_controller.rb +9 -8
- data/app/controllers/alchemy/admin/layoutpages_controller.rb +1 -0
- data/app/controllers/alchemy/admin/pages_controller.rb +2 -2
- data/app/controllers/alchemy/admin/resources_controller.rb +2 -2
- data/app/controllers/alchemy/admin/tags_controller.rb +1 -1
- data/app/controllers/alchemy/api/pages_controller.rb +16 -0
- data/app/controllers/alchemy/messages_controller.rb +1 -1
- data/app/controllers/concerns/alchemy/admin/uploader_responses.rb +2 -2
- data/app/helpers/alchemy/admin/attachments_helper.rb +11 -0
- data/app/helpers/alchemy/admin/base_helper.rb +37 -4
- data/app/helpers/alchemy/admin/contents_helper.rb +11 -4
- data/app/helpers/alchemy/admin/elements_helper.rb +0 -19
- data/app/helpers/alchemy/admin/essences_helper.rb +7 -30
- data/app/helpers/alchemy/admin/navigation_helper.rb +13 -51
- data/app/helpers/alchemy/admin/pages_helper.rb +21 -16
- data/app/helpers/alchemy/admin/pictures_helper.rb +9 -0
- data/app/helpers/alchemy/deprecated_pages_helper.rb +54 -0
- data/app/helpers/alchemy/essences_helper.rb +1 -1
- data/app/helpers/alchemy/pages_helper.rb +8 -109
- data/app/helpers/alchemy/url_helper.rb +8 -13
- data/app/models/alchemy/attachment.rb +7 -4
- data/app/models/alchemy/cell.rb +2 -2
- data/app/models/alchemy/content.rb +2 -2
- data/app/models/alchemy/content/factory.rb +12 -9
- data/app/models/alchemy/element.rb +6 -3
- data/app/models/alchemy/essence_file.rb +1 -1
- data/app/models/alchemy/essence_picture.rb +37 -47
- data/app/models/alchemy/essence_picture_view.rb +8 -1
- data/app/models/alchemy/folded_page.rb +3 -2
- data/app/models/alchemy/legacy_page_url.rb +3 -3
- data/app/models/alchemy/page.rb +50 -5
- data/app/models/alchemy/page/fixed_attributes.rb +63 -0
- data/app/models/alchemy/page/page_elements.rb +10 -7
- data/app/models/alchemy/page/page_natures.rb +19 -0
- data/app/models/alchemy/picture.rb +1 -0
- data/app/models/alchemy/picture/transformations.rb +1 -1
- data/app/models/alchemy/picture/url.rb +82 -0
- data/app/serializers/alchemy/page_tree_serializer.rb +29 -8
- data/app/views/alchemy/_edit_mode.html.erb +2 -0
- data/app/views/alchemy/_menubar.html.erb +1 -1
- data/app/views/alchemy/_preview_mode_code.html.erb +6 -0
- data/app/views/alchemy/admin/attachments/_archive_overlay.html.erb +1 -1
- data/app/views/alchemy/admin/attachments/_attachment.html.erb +25 -5
- data/app/views/alchemy/admin/attachments/_replace_button.html.erb +26 -0
- data/app/views/alchemy/admin/attachments/index.html.erb +1 -1
- data/app/views/alchemy/admin/attachments/show.html.erb +52 -0
- data/app/views/alchemy/admin/elements/_element_header.html.erb +6 -3
- data/app/views/alchemy/admin/elements/create.js.erb +0 -2
- data/app/views/alchemy/admin/elements/trash.js.erb +0 -1
- data/app/views/alchemy/admin/elements/update.js.erb +0 -2
- data/app/views/alchemy/admin/essence_pictures/crop.html.erb +1 -4
- data/app/views/alchemy/admin/essence_pictures/edit.html.erb +1 -1
- data/app/views/alchemy/admin/languages/index.html.erb +1 -0
- data/app/views/alchemy/admin/layoutpages/_layoutpage.html.erb +26 -27
- data/app/views/alchemy/admin/layoutpages/edit.html.erb +1 -1
- data/app/views/alchemy/admin/pages/_form.html.erb +13 -40
- data/app/views/alchemy/admin/pages/_locked_page.html.erb +1 -1
- data/app/views/alchemy/admin/pages/_page.html.erb +119 -61
- data/app/views/alchemy/admin/pages/_page_for_links.html.erb +4 -2
- data/app/views/alchemy/admin/pages/_page_infos.html.erb +12 -12
- data/app/views/alchemy/admin/pages/_page_status.html.erb +1 -1
- data/app/views/alchemy/admin/pages/_publication_fields.html.erb +35 -0
- data/app/views/alchemy/admin/pages/edit.html.erb +13 -2
- data/app/views/alchemy/admin/pages/index.html.erb +3 -8
- data/app/views/alchemy/admin/pages/info.html.erb +15 -2
- data/app/views/alchemy/admin/pages/sort.js.erb +1 -1
- data/app/views/alchemy/admin/pages/update.js.erb +1 -14
- data/app/views/alchemy/admin/partials/_main_navigation_entry.html.erb +12 -8
- data/app/views/alchemy/admin/partials/_remote_search_form.html.erb +4 -4
- data/app/views/alchemy/admin/partials/_search_form.html.erb +1 -1
- data/app/views/alchemy/admin/partials/_sub_navigation.html.erb +9 -6
- data/app/views/alchemy/admin/pictures/_filter_and_size_bar.html.erb +1 -1
- data/app/views/alchemy/admin/pictures/_picture.html.erb +1 -6
- data/app/views/alchemy/admin/pictures/_picture_to_assign.html.erb +1 -6
- data/app/views/alchemy/admin/pictures/index.html.erb +1 -1
- data/app/views/alchemy/admin/pictures/show.html.erb +1 -6
- data/app/views/alchemy/admin/uploader/_button.html.erb +4 -4
- data/app/views/alchemy/base/500.html.erb +15 -1
- data/app/views/alchemy/essences/_essence_boolean_editor.html.erb +13 -15
- data/app/views/alchemy/essences/_essence_boolean_view.html.erb +1 -3
- data/app/views/alchemy/essences/_essence_date_editor.html.erb +0 -2
- data/app/views/alchemy/essences/_essence_date_view.html.erb +0 -2
- data/app/views/alchemy/essences/_essence_file_editor.html.erb +2 -7
- data/app/views/alchemy/essences/_essence_file_view.html.erb +1 -3
- data/app/views/alchemy/essences/_essence_html_editor.html.erb +0 -2
- data/app/views/alchemy/essences/_essence_html_view.html.erb +1 -3
- data/app/views/alchemy/essences/_essence_link_editor.html.erb +0 -2
- data/app/views/alchemy/essences/_essence_link_view.html.erb +0 -2
- data/app/views/alchemy/essences/_essence_picture_editor.html.erb +47 -49
- data/app/views/alchemy/essences/_essence_picture_view.html.erb +1 -3
- data/app/views/alchemy/essences/_essence_richtext_editor.html.erb +0 -2
- data/app/views/alchemy/essences/_essence_richtext_view.html.erb +1 -3
- data/app/views/alchemy/essences/_essence_select_editor.html.erb +27 -29
- data/app/views/alchemy/essences/_essence_select_view.html.erb +1 -3
- data/app/views/alchemy/essences/_essence_text_editor.html.erb +17 -19
- data/app/views/alchemy/essences/_essence_text_view.html.erb +0 -2
- data/app/views/alchemy/pages/_meta_data.html.erb +9 -0
- data/app/views/layouts/alchemy/admin.html.erb +9 -11
- data/bin/alchemy +1 -2
- data/config/alchemy/config.yml +1 -1
- data/config/alchemy/modules.yml +0 -16
- data/config/initializers/dragonfly.rb +0 -18
- data/config/initializers/mini_profiler.rb +6 -0
- data/config/locales/alchemy.de.yml +9 -1
- data/config/locales/alchemy.en.yml +7 -1
- data/config/locales/alchemy.es.yml +6 -0
- data/config/locales/alchemy.fr.yml +2 -0
- data/config/locales/alchemy.it.yml +3 -1
- data/config/locales/alchemy.nl.yml +2 -0
- data/config/locales/alchemy.ru.yml +2 -0
- data/config/routes.rb +3 -8
- data/db/migrate/20160912223112_add_index_to_alchemy_pages_rgt.rb +9 -0
- data/db/migrate/20160927205604_add_foreign_key_indices_and_null_constraints.rb +20 -0
- data/db/migrate/20160928080104_add_foreign_keys.rb +27 -0
- data/lib/alchemy/admin/locale.rb +4 -3
- data/lib/alchemy/engine.rb +2 -4
- data/lib/alchemy/errors.rb +9 -2
- data/lib/alchemy/forms/builder.rb +8 -0
- data/lib/alchemy/modules.rb +20 -19
- data/lib/alchemy/permissions.rb +15 -4
- data/lib/alchemy/resources_helper.rb +4 -2
- data/lib/alchemy/sass_support.rb +9 -0
- data/lib/alchemy/seeder.rb +89 -1
- data/lib/alchemy/test_support/essence_shared_examples.rb +2 -0
- data/lib/alchemy/test_support/factories/attachment_factory.rb +1 -1
- data/lib/alchemy/test_support/factories/content_factory.rb +1 -0
- data/lib/alchemy/test_support/factories/element_factory.rb +1 -0
- data/lib/alchemy/test_support/factories/picture_factory.rb +1 -1
- data/lib/alchemy/test_support/fixtures/image.png +0 -0
- data/lib/alchemy/tinymce.rb +2 -6
- data/lib/alchemy/upgrader.rb +4 -55
- data/lib/alchemy/upgrader/tasks/install_dragonfly_config.rb +14 -0
- data/lib/alchemy/upgrader/three_point_five.rb +32 -0
- data/lib/alchemy/upgrader/three_point_four.rb +2 -8
- data/lib/alchemy/upgrader/three_point_one.rb +30 -30
- data/lib/alchemy/upgrader/three_point_three.rb +31 -31
- data/lib/alchemy/upgrader/three_point_two.rb +25 -25
- data/lib/alchemy/upgrader/three_point_zero.rb +59 -59
- data/lib/alchemy/version.rb +1 -1
- data/lib/rails/generators/alchemy/elements/templates/view.html.erb +1 -1
- data/lib/rails/generators/alchemy/elements/templates/view.html.haml +1 -1
- data/lib/rails/generators/alchemy/elements/templates/view.html.slim +1 -1
- data/lib/rails/generators/alchemy/essence/templates/editor.html.erb +1 -3
- data/lib/rails/generators/alchemy/install/files/_article_view.html.erb +1 -1
- data/lib/rails/generators/alchemy/install/files/application.html.erb +3 -4
- data/lib/rails/generators/alchemy/install/install_generator.rb +4 -0
- data/lib/rails/generators/alchemy/install/templates/dragonfly.rb.tt +35 -0
- data/lib/rails/generators/alchemy/module/module_generator.rb +1 -1
- data/lib/tasks/alchemy/db.rake +6 -0
- data/lib/tasks/alchemy/tidy.rake +85 -0
- data/lib/tasks/alchemy/upgrade.rake +165 -16
- data/vendor/assets/javascripts/clipboard.min.js +7 -0
- data/vendor/assets/javascripts/fileupload/jquery.fileupload-process.js +4 -4
- data/vendor/assets/javascripts/fileupload/jquery.fileupload-validate.js +2 -2
- data/vendor/assets/javascripts/fileupload/jquery.fileupload.js +29 -14
- data/vendor/assets/javascripts/fileupload/jquery.iframe-transport.js +2 -2
- data/vendor/assets/javascripts/tinymce/langs/es.js +2 -2
- data/vendor/assets/javascripts/tinymce/langs/fr.js +1 -1
- data/vendor/assets/javascripts/tinymce/langs/it.js +1 -1
- data/vendor/assets/javascripts/tinymce/langs/nl.js +3 -3
- data/vendor/assets/javascripts/tinymce/tinymce.min.js +15 -12
- metadata +44 -88
- data/app/assets/stylesheets/tinymce/skins/alchemy/fonts/readme.md +0 -1
- data/app/assets/stylesheets/tinymce/skins/alchemy/fonts/tinymce-small.eot +0 -0
- data/app/assets/stylesheets/tinymce/skins/alchemy/fonts/tinymce.eot +0 -0
- data/app/assets/stylesheets/tinymce/skins/alchemy/img/wline.gif +0 -0
- data/app/assets/stylesheets/tinymce/skins/alchemy/skin.ie7.min.css +0 -1
- data/app/controllers/alchemy/pictures_controller.rb +0 -97
- data/app/views/alchemy/admin/elements/_refresh_editor.js.erb +0 -8
- data/vendor/assets/javascripts/tinymce/plugins/anchor/plugin.min.js +0 -1
- data/vendor/assets/javascripts/tinymce/plugins/autoresize/plugin.min.js +0 -1
- data/vendor/assets/javascripts/tinymce/plugins/charmap/plugin.min.js +0 -1
- data/vendor/assets/javascripts/tinymce/plugins/code/plugin.min.js +0 -1
- data/vendor/assets/javascripts/tinymce/plugins/directionality/plugin.min.js +0 -1
- data/vendor/assets/javascripts/tinymce/plugins/fullscreen/plugin.min.js +0 -1
- data/vendor/assets/javascripts/tinymce/plugins/hr/plugin.min.js +0 -1
- data/vendor/assets/javascripts/tinymce/plugins/link/plugin.min.js +0 -1
- data/vendor/assets/javascripts/tinymce/plugins/paste/plugin.min.js +0 -1
- data/vendor/assets/javascripts/tinymce/plugins/tabfocus/plugin.min.js +0 -1
- data/vendor/assets/javascripts/tinymce/plugins/table/plugin.min.js +0 -1
- data/vendor/assets/javascripts/tinymce/themes/modern/theme.min.js +0 -1
@@ -46,27 +46,47 @@ module Alchemy
|
|
46
46
|
protected
|
47
47
|
|
48
48
|
def page_hash(page, has_children, level, folded)
|
49
|
-
{
|
49
|
+
p_hash = {
|
50
50
|
id: page.id,
|
51
51
|
name: page.name,
|
52
|
-
permissions: page_permissions(page, opts[:ability]),
|
53
52
|
public: page.public?,
|
54
53
|
visible: page.visible?,
|
55
54
|
restricted: page.restricted?,
|
56
|
-
status_titles: page_status_titles(page),
|
57
55
|
page_layout: page.page_layout,
|
58
56
|
slug: page.slug,
|
59
57
|
redirects_to_external: page.redirects_to_external?,
|
60
|
-
locked: page.locked?,
|
61
|
-
definition_missing: page.definition.blank?,
|
62
58
|
urlname: page.urlname,
|
63
|
-
external_urlname: page.external_urlname,
|
59
|
+
external_urlname: page.redirects_to_external? ? page.external_urlname : nil,
|
64
60
|
level: level,
|
65
61
|
root: level == 1,
|
66
|
-
folded: folded,
|
67
62
|
root_or_leaf: level == 1 || !has_children,
|
68
63
|
children: []
|
69
64
|
}
|
65
|
+
|
66
|
+
if opts[:elements]
|
67
|
+
p_hash.update(elements: ActiveModel::ArraySerializer.new(page_elements(page)))
|
68
|
+
end
|
69
|
+
|
70
|
+
if opts[:ability].can?(:index, :alchemy_admin_pages)
|
71
|
+
p_hash.merge({
|
72
|
+
definition_missing: page.definition.blank?,
|
73
|
+
folded: folded,
|
74
|
+
locked: page.locked?,
|
75
|
+
locked_notice: page.locked? ? Alchemy.t('This page is locked', name: page.locker_name) : nil,
|
76
|
+
permissions: page_permissions(page, opts[:ability]),
|
77
|
+
status_titles: page_status_titles(page)
|
78
|
+
})
|
79
|
+
else
|
80
|
+
p_hash
|
81
|
+
end
|
82
|
+
end
|
83
|
+
|
84
|
+
def page_elements(page)
|
85
|
+
if opts[:elements] == 'true'
|
86
|
+
page.elements
|
87
|
+
else
|
88
|
+
page.elements.named(opts[:elements].split(',') || [])
|
89
|
+
end
|
70
90
|
end
|
71
91
|
|
72
92
|
def page_permissions(page, ability)
|
@@ -75,7 +95,8 @@ module Alchemy
|
|
75
95
|
configure: ability.can?(:configure, page),
|
76
96
|
copy: ability.can?(:copy, page),
|
77
97
|
destroy: ability.can?(:destroy, page),
|
78
|
-
create: ability.can?(:create, Alchemy::Page)
|
98
|
+
create: ability.can?(:create, Alchemy::Page),
|
99
|
+
edit_content: ability.can?(:edit_content, page)
|
79
100
|
}
|
80
101
|
end
|
81
102
|
|
@@ -1,7 +1,7 @@
|
|
1
1
|
<div id="overlay_toolbar">
|
2
2
|
<% if can? :create, Alchemy::Attachment %>
|
3
3
|
<%= render 'alchemy/admin/uploader/button',
|
4
|
-
|
4
|
+
object: Alchemy::Attachment.new,
|
5
5
|
dropzone: '#assign_file_list',
|
6
6
|
file_attribute: 'file',
|
7
7
|
in_dialog: true,
|
@@ -3,16 +3,16 @@
|
|
3
3
|
<%= render_icon attachment.icon_css_class %>
|
4
4
|
</td>
|
5
5
|
<td class="name">
|
6
|
-
<% if can?(:show, attachment)
|
6
|
+
<% if can?(:show, attachment) %>
|
7
7
|
<%= link_to_dialog(
|
8
8
|
attachment.name,
|
9
9
|
alchemy.admin_attachment_path(attachment),
|
10
10
|
{
|
11
11
|
title: attachment.name,
|
12
|
-
size:
|
12
|
+
size: attachment_preview_size(attachment)
|
13
13
|
},
|
14
14
|
{
|
15
|
-
title: Alchemy.t('
|
15
|
+
title: Alchemy.t('Attachment Preview')
|
16
16
|
}
|
17
17
|
) %>
|
18
18
|
<% else %>
|
@@ -24,14 +24,34 @@
|
|
24
24
|
<td class="file_size"><%= number_to_human_size(attachment.file_size) %></td>
|
25
25
|
<td class="date"><%= l(attachment.created_at, format: :default) %></td>
|
26
26
|
<td class="tools long">
|
27
|
+
<% if can?(:show, attachment) %>
|
28
|
+
<%= link_to_dialog(
|
29
|
+
render_icon(:info),
|
30
|
+
alchemy.admin_attachment_path(attachment),
|
31
|
+
{
|
32
|
+
title: attachment.name,
|
33
|
+
size: attachment_preview_size(attachment)
|
34
|
+
},
|
35
|
+
{
|
36
|
+
title: Alchemy.t('Attachment Preview')
|
37
|
+
}
|
38
|
+
) %>
|
39
|
+
<% end %>
|
27
40
|
<% if can?(:download, attachment) %>
|
28
41
|
<%= link_to(
|
29
42
|
"",
|
30
43
|
alchemy.download_admin_attachment_path(attachment),
|
31
44
|
title: Alchemy.t("download_file", filename: attachment.file_name),
|
32
|
-
class: "icon file_download"
|
45
|
+
class: "icon file_download",
|
46
|
+
target: "_blank"
|
33
47
|
) %>
|
34
48
|
<% end %>
|
49
|
+
<% if can?(:edit, attachment) %>
|
50
|
+
<%= render 'alchemy/admin/attachments/replace_button',
|
51
|
+
redirect_url: alchemy.admin_attachments_path,
|
52
|
+
object: attachment,
|
53
|
+
file_attribute: 'file' %>
|
54
|
+
<% end %>
|
35
55
|
<% if can?(:destroy, attachment) %>
|
36
56
|
<%= link_to_confirm_dialog(
|
37
57
|
"",
|
@@ -53,7 +73,7 @@
|
|
53
73
|
alchemy.edit_admin_attachment_path(attachment, q: params[:q], page: params[:page]),
|
54
74
|
{
|
55
75
|
title: Alchemy.t(:rename_file),
|
56
|
-
size: '
|
76
|
+
size: '500x250'
|
57
77
|
},
|
58
78
|
class: 'icon file_edit',
|
59
79
|
title: Alchemy.t(:rename_file)
|
@@ -0,0 +1,26 @@
|
|
1
|
+
<%= form_for [:admin, object], html: {multipart: true, class: 'upload-button'} do |f| %>
|
2
|
+
<%= f.file_field file_attribute,
|
3
|
+
class: 'fileupload--field',
|
4
|
+
name: "#{f.object_name}[#{file_attribute}]",
|
5
|
+
id: "replace_#{dom_id(object)}" %>
|
6
|
+
<%= label_tag "replace_#{dom_id(object)}", title: Alchemy.t(:replace_file) do %>
|
7
|
+
<%= render_icon :file_change %>
|
8
|
+
<% end %>
|
9
|
+
<% end %>
|
10
|
+
|
11
|
+
<% file_types = local_assigns[:file_types].presence ||
|
12
|
+
configuration(:uploader)['allowed_filetypes'][object.class.model_name.collection] || ['*'] %>
|
13
|
+
|
14
|
+
<script type='text/javascript'>
|
15
|
+
$(function() {
|
16
|
+
var options = {
|
17
|
+
selector: '#replace_<%= dom_id(object) %>',
|
18
|
+
file_types: '<%= file_types.join("|") %>',
|
19
|
+
complete: function() {
|
20
|
+
Alchemy.pleaseWaitOverlay();
|
21
|
+
window.location.href = '<%= redirect_url.html_safe %>';
|
22
|
+
}
|
23
|
+
};
|
24
|
+
Alchemy.Uploader(options);
|
25
|
+
});
|
26
|
+
</script>
|
@@ -1,3 +1,55 @@
|
|
1
|
+
<div class="resource_info">
|
2
|
+
<div class="value">
|
3
|
+
<label>
|
4
|
+
<%= render_icon @attachment.icon_css_class %>
|
5
|
+
</label>
|
6
|
+
<p><%= @attachment.file_name %></p>
|
7
|
+
</div>
|
8
|
+
<div class="value with-icon">
|
9
|
+
<label><%= Alchemy::Attachment.human_attribute_name(:url) %></label>
|
10
|
+
<p><%= alchemy.show_attachment_url(@attachment) %></p>
|
11
|
+
<a data-clipboard-text="<%= alchemy.show_attachment_url(@attachment) %>" class="icon_button--right">
|
12
|
+
<%= render_icon('clipboard full') %>
|
13
|
+
</a>
|
14
|
+
</div>
|
15
|
+
<div class="value with-icon">
|
16
|
+
<label><%= Alchemy::Attachment.human_attribute_name(:download_url) %></label>
|
17
|
+
<p><%= alchemy.download_attachment_url(@attachment) %></p>
|
18
|
+
<a data-clipboard-text="<%= alchemy.download_attachment_url(@attachment) %>" class="icon_button--right">
|
19
|
+
<%= render_icon('clipboard full') %>
|
20
|
+
</a>
|
21
|
+
</div>
|
22
|
+
</div>
|
23
|
+
|
24
|
+
<% case @attachment.icon_css_class %>
|
25
|
+
<% when "image" %>
|
26
|
+
<div class="attachment_preview_container image-preview">
|
27
|
+
<%= image_tag(alchemy.show_attachment_path(@attachment), class: "full_width") %>
|
28
|
+
</div>
|
29
|
+
<% when "audio" %>
|
30
|
+
<div class="attachment_preview_container player-preview">
|
31
|
+
<%= audio_tag(alchemy.show_attachment_path(@attachment), preload: "none", controls: true, class: "full_width") %>
|
32
|
+
</div>
|
33
|
+
<% when "video" %>
|
34
|
+
<div class="attachment_preview_container player-preview">
|
35
|
+
<%= video_tag(alchemy.show_attachment_path(@attachment), preload: "metadata", controls: true, class: "full_width") %>
|
36
|
+
</div>
|
37
|
+
<% when "archive", "file" %>
|
38
|
+
<% else %>
|
1
39
|
<iframe src="<%= alchemy.show_attachment_path(@attachment) %>" frameborder=0 class="full-iframe">
|
2
40
|
Your browser does not support frames.
|
3
41
|
</iframe>
|
42
|
+
<% end %>
|
43
|
+
|
44
|
+
<script type="text/javascript">
|
45
|
+
$(function() {
|
46
|
+
var clipboard = new Clipboard('.icon_button--right');
|
47
|
+
clipboard.on('success', function(e) {
|
48
|
+
Alchemy.growl('<%= Alchemy.t("Copied to clipboard") %>');
|
49
|
+
e.clearSelection();
|
50
|
+
});
|
51
|
+
Alchemy.currentDialog().dialog.on('DialogClose.Alchemy', function() {
|
52
|
+
clipboard.destroy();
|
53
|
+
});
|
54
|
+
});
|
55
|
+
</script>
|
@@ -1,10 +1,13 @@
|
|
1
|
-
<div class="element-header">
|
1
|
+
<div class="element-header<%= ' has-hint' if element.has_hint? %>">
|
2
2
|
<span class="element-handle">
|
3
3
|
<%= render_icon(:element) %>
|
4
4
|
<% if element.definition.blank? %>
|
5
|
-
|
5
|
+
<%= hint_with_tooltip(
|
6
|
+
Alchemy.t(:element_definition_missing),
|
7
|
+
class: 'warning icon'
|
8
|
+
) %>
|
6
9
|
<% else %>
|
7
|
-
|
10
|
+
<%= render_icon("element_#{element.public? ? 'public' : 'draft'}") %>
|
8
11
|
<% end %>
|
9
12
|
</span>
|
10
13
|
<span class="element-title">
|
@@ -11,7 +11,6 @@
|
|
11
11
|
Alchemy.PreviewWindow.refresh(function() {
|
12
12
|
Alchemy.ElementEditors.selectElementInPreview(<%= @element.id %>);
|
13
13
|
});
|
14
|
-
<%= update_essence_select_elements(@page, @element) -%>
|
15
14
|
|
16
15
|
<%- else -%>
|
17
16
|
|
@@ -22,5 +21,4 @@
|
|
22
21
|
Alchemy.Buttons.enable($el);
|
23
22
|
|
24
23
|
<%- end -%>
|
25
|
-
|
26
24
|
})();
|
@@ -8,10 +8,7 @@
|
|
8
8
|
<%= simple_format Alchemy.t(:explain_cropping) %>
|
9
9
|
<% end %>
|
10
10
|
<div class="thumbnail_background">
|
11
|
-
<%= image_tag(
|
12
|
-
show_alchemy_picture_path(@picture, size: '800x600', format: 'png'),
|
13
|
-
id: 'imageToCrop'
|
14
|
-
) %>
|
11
|
+
<%= image_tag @picture.url(size: '800x600', flatten: true), id: 'imageToCrop' %>
|
15
12
|
</div>
|
16
13
|
<%= form_for(
|
17
14
|
@essence_picture,
|
@@ -6,7 +6,7 @@
|
|
6
6
|
<%= f.input :alt_tag %>
|
7
7
|
<%- if @options[:sizes].present? -%>
|
8
8
|
<%= f.input :render_size,
|
9
|
-
collection: [[Alchemy.t('Layout default'), @options[:
|
9
|
+
collection: [[Alchemy.t('Layout default'), @options[:size]]] + @options[:sizes].to_a,
|
10
10
|
include_blank: false,
|
11
11
|
input_html: {class: 'alchemy_selectbox'} %>
|
12
12
|
<%- end -%>
|
@@ -2,26 +2,27 @@
|
|
2
2
|
<div class="sitemap_page<%= layoutpage.locked? ? ' locked' : '' %>">
|
3
3
|
<div class="sitemap_left_images">
|
4
4
|
<% if layoutpage.definition.blank? %>
|
5
|
-
|
5
|
+
<%= page_layout_missing_warning %>
|
6
6
|
<% else %>
|
7
7
|
<%= render_icon(:page) %>
|
8
8
|
<% end %>
|
9
9
|
</div>
|
10
10
|
<div class="sitemap_right_tools">
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
11
|
+
<%- if can?(:configure, layoutpage) -%>
|
12
|
+
<div class="button_with_label sitemap_tool">
|
13
|
+
<%= link_to_dialog(
|
14
|
+
render_icon('configure_page'),
|
15
|
+
alchemy.edit_admin_layoutpage_path(layoutpage),
|
16
|
+
{
|
17
|
+
title: Alchemy.t(:edit_page_properties),
|
18
|
+
size: '410x170'
|
19
|
+
}
|
20
|
+
) -%>
|
21
|
+
<label class="center"><%= Alchemy.t(:edit_page_properties) %></label>
|
22
|
+
</div>
|
23
|
+
<%- end -%>
|
24
|
+
<%- if can?(:copy, layoutpage) -%>
|
25
|
+
<div class="button_with_label sitemap_tool">
|
25
26
|
<%= link_to(
|
26
27
|
render_icon("copy_page"),
|
27
28
|
alchemy.insert_admin_clipboard_path(
|
@@ -29,12 +30,13 @@
|
|
29
30
|
remarkable_id: layoutpage.id
|
30
31
|
),
|
31
32
|
remote: true,
|
32
|
-
method: 'post'
|
33
|
-
class: "sitemap_tool",
|
34
|
-
title: Alchemy.t(:copy_page)
|
33
|
+
method: 'post'
|
35
34
|
) %>
|
36
|
-
|
37
|
-
|
35
|
+
<label class="center"><%= Alchemy.t(:copy_page) %></label>
|
36
|
+
</div>
|
37
|
+
<%- end -%>
|
38
|
+
<%- if can?(:destroy, layoutpage) -%>
|
39
|
+
<div class="button_with_label sitemap_tool">
|
38
40
|
<%= link_to_confirm_dialog(
|
39
41
|
render_icon('delete_page'),
|
40
42
|
Alchemy.t(:confirm_to_delete_page),
|
@@ -42,14 +44,11 @@
|
|
42
44
|
controller: 'pages',
|
43
45
|
action: 'destroy',
|
44
46
|
id: layoutpage.id
|
45
|
-
)
|
46
|
-
{
|
47
|
-
class: "sitemap_tool",
|
48
|
-
title: Alchemy.t(:delete_page)
|
49
|
-
}
|
47
|
+
)
|
50
48
|
) -%>
|
51
|
-
|
52
|
-
</
|
49
|
+
<label class="left"><%= Alchemy.t(:delete_page) %></label>
|
50
|
+
</div>
|
51
|
+
<%- end -%>
|
53
52
|
</div>
|
54
53
|
<div class="sitemap_sitename">
|
55
54
|
<%= link_to(
|
@@ -1,7 +1,7 @@
|
|
1
1
|
<%= alchemy_form_for [:admin, @page], class: 'edit_page' do |f| %>
|
2
2
|
<%= f.input :page_layout,
|
3
3
|
collection: @page_layouts,
|
4
|
-
label: @page
|
4
|
+
label: page_layout_label(@page),
|
5
5
|
include_blank: false,
|
6
6
|
input_html: {class: 'alchemy_selectbox'} %>
|
7
7
|
<%= f.input :name, autofocus: true %>
|
@@ -4,74 +4,47 @@
|
|
4
4
|
label: page_layout_label(@page),
|
5
5
|
include_blank: false,
|
6
6
|
input_html: {class: 'alchemy_selectbox'} %>
|
7
|
+
|
7
8
|
<div class="input check_boxes">
|
8
9
|
<label class="control-label"><%= Alchemy.t(:page_status) %></label>
|
9
10
|
<div class="control_group">
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
<%= content_tag :div, class: [
|
16
|
-
@page.public_on.present? || @page.public_until.present? ? nil : 'hidden',
|
17
|
-
'page-publication-date-fields',
|
18
|
-
'input-row'
|
19
|
-
] do %>
|
20
|
-
<div class="input-column">
|
21
|
-
<label><%= Alchemy.t(:from) %></label>
|
22
|
-
<%= alchemy_datepicker @page, :public_on, type: :datetime %>
|
23
|
-
</div>
|
24
|
-
<div class="input-column">
|
25
|
-
<label><%= Alchemy.t(:until) %></label>
|
26
|
-
<%= alchemy_datepicker @page, :public_until, type: :datetime %>
|
27
|
-
</div>
|
11
|
+
<%= render 'alchemy/admin/pages/publication_fields' %>
|
12
|
+
<%= page_status_checkbox(@page, :visible) %>
|
13
|
+
<%= page_status_checkbox(@page, :restricted) %>
|
14
|
+
<% if configuration(:sitemap)['show_flag'] %>
|
15
|
+
<%= page_status_checkbox(@page, :sitemap) %>
|
28
16
|
<% end %>
|
29
|
-
<label class="checkbox">
|
30
|
-
<%= f.check_box :visible %>
|
31
|
-
<%= f.object.class.human_attribute_name :visible %>
|
32
|
-
</label>
|
33
|
-
<label class="checkbox">
|
34
|
-
<%= f.check_box :restricted %>
|
35
|
-
<%= f.object.class.human_attribute_name :restricted %>
|
36
|
-
</label>
|
37
|
-
<% if configuration(:sitemap)['show_flag'] %>
|
38
|
-
<label class="checkbox">
|
39
|
-
<%= f.check_box :sitemap %>
|
40
|
-
<%= f.object.class.human_attribute_name :sitemap %>
|
41
|
-
</label>
|
42
|
-
<% end %>
|
43
17
|
</div>
|
44
18
|
</div>
|
19
|
+
|
45
20
|
<h2><%= Alchemy.t(:names) %></h2>
|
46
21
|
<%= f.input :name, autofocus: true %>
|
47
22
|
<%= f.input :urlname, as: 'string', input_html: {value: @page.slug} %>
|
48
23
|
<%= f.input :title,
|
49
24
|
input_html: {'data-alchemy-char-counter' => 60} %>
|
25
|
+
|
50
26
|
<h2><%= Alchemy.t(:meta_data) %></h2>
|
51
27
|
<div class="input check_boxes">
|
52
28
|
<label class="control-label"><%= Alchemy.t(:search_engines) %></label>
|
53
29
|
<div class="control_group">
|
54
|
-
|
55
|
-
|
56
|
-
<%= f.object.class.human_attribute_name :robot_index %>
|
57
|
-
</label>
|
58
|
-
<label class="checkbox">
|
59
|
-
<%= f.check_box :robot_follow %>
|
60
|
-
<%= f.object.class.human_attribute_name :robot_follow %>
|
61
|
-
</label>
|
30
|
+
<%= page_status_checkbox(@page, :robot_index) %>
|
31
|
+
<%= page_status_checkbox(@page, :robot_follow) %>
|
62
32
|
</div>
|
63
33
|
</div>
|
34
|
+
|
64
35
|
<%= f.input :meta_description,
|
65
36
|
as: 'text',
|
66
37
|
input_html: {'data-alchemy-char-counter' => 160} %>
|
67
38
|
<%= f.input :meta_keywords,
|
68
39
|
as: 'text',
|
69
40
|
hint: Alchemy.t('pages.update.comma_seperated') %>
|
41
|
+
|
70
42
|
<% if @page.taggable? %>
|
71
43
|
<div class="input string">
|
72
44
|
<%= f.label :tag_list %>
|
73
45
|
<%= render 'alchemy/admin/partials/autocomplete_tag_list', f: f %>
|
74
46
|
</div>
|
75
47
|
<% end %>
|
48
|
+
|
76
49
|
<%= f.submit Alchemy.t(:save) %>
|
77
50
|
<% end %>
|