alchemy_cms 3.0.0.rc5 → 3.0.0.rc6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (124) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +2 -5
  3. data/README.md +32 -5
  4. data/alchemy_cms.gemspec +1 -1
  5. data/app/assets/javascripts/alchemy/alchemy.buttons.js.coffee +3 -3
  6. data/app/assets/javascripts/alchemy/alchemy.char_counter.js.coffee +19 -0
  7. data/app/assets/javascripts/alchemy/alchemy.confirm_dialog.js.coffee +5 -0
  8. data/app/assets/javascripts/alchemy/alchemy.dialog.js.coffee +3 -2
  9. data/app/assets/javascripts/alchemy/alchemy.dragndrop.js.coffee +2 -0
  10. data/app/assets/javascripts/alchemy/alchemy.element_editors.js.coffee +1 -1
  11. data/app/assets/javascripts/alchemy/alchemy.elements_window.js.coffee +2 -26
  12. data/app/assets/javascripts/alchemy/alchemy.file_progress.js.coffee +1 -1
  13. data/app/assets/javascripts/alchemy/alchemy.gui.js.coffee +2 -0
  14. data/app/assets/javascripts/alchemy/alchemy.i18n.js.coffee +12 -7
  15. data/app/assets/javascripts/alchemy/alchemy.js +1 -1
  16. data/app/assets/javascripts/alchemy/alchemy.link_dialog.js.coffee +33 -4
  17. data/app/assets/javascripts/alchemy/alchemy.preview_window.js.coffee +1 -1
  18. data/app/assets/javascripts/alchemy/alchemy.sitemap.js.coffee +2 -13
  19. data/app/assets/javascripts/alchemy/{alchemy.tinymce.js.coffee.erb → alchemy.tinymce.js.coffee} +1 -25
  20. data/app/assets/javascripts/alchemy/alchemy.translations.js.coffee +63 -105
  21. data/app/assets/javascripts/alchemy/alchemy.uploader.js.coffee +3 -3
  22. data/app/assets/stylesheets/alchemy/_extends.scss +2 -8
  23. data/app/assets/stylesheets/alchemy/_mixins.scss +4 -9
  24. data/app/assets/stylesheets/alchemy/base.scss +6 -6
  25. data/app/assets/stylesheets/alchemy/buttons.scss +56 -29
  26. data/app/assets/stylesheets/alchemy/elements.scss +66 -14
  27. data/app/assets/stylesheets/alchemy/form_fields.scss +39 -6
  28. data/app/assets/stylesheets/alchemy/forms.scss +32 -0
  29. data/app/assets/stylesheets/alchemy/frame.scss +44 -44
  30. data/app/assets/stylesheets/alchemy/icons.scss +2 -2
  31. data/app/assets/stylesheets/alchemy/jquery-ui.scss +2 -0
  32. data/app/assets/stylesheets/alchemy/notices.scss +6 -0
  33. data/app/assets/stylesheets/alchemy/selects.scss +10 -0
  34. data/app/assets/stylesheets/alchemy/sitemap.scss +8 -10
  35. data/app/assets/stylesheets/alchemy/toolbar.scss +40 -31
  36. data/app/assets/stylesheets/tinymce/skins/alchemy/skin.min.css.scss +11 -22
  37. data/app/controllers/alchemy/admin/base_controller.rb +14 -1
  38. data/app/controllers/alchemy/admin/elements_controller.rb +4 -2
  39. data/app/controllers/alchemy/admin/layoutpages_controller.rb +5 -0
  40. data/app/controllers/alchemy/admin/legacy_page_urls_controller.rb +39 -0
  41. data/app/controllers/alchemy/admin/pages_controller.rb +0 -3
  42. data/app/controllers/alchemy/base_controller.rb +7 -4
  43. data/app/helpers/alchemy/admin/base_helper.rb +33 -3
  44. data/app/helpers/alchemy/pages_helper.rb +1 -1
  45. data/app/models/alchemy/element.rb +6 -4
  46. data/app/models/alchemy/legacy_page_url.rb +5 -1
  47. data/app/models/alchemy/message.rb +2 -2
  48. data/app/models/alchemy/page.rb +8 -9
  49. data/app/models/alchemy/page/{cells.rb → page_cells.rb} +1 -1
  50. data/app/models/alchemy/page/{elements.rb → page_elements.rb} +1 -1
  51. data/app/models/alchemy/page/{naming.rb → page_naming.rb} +33 -18
  52. data/app/models/alchemy/page/{natures.rb → page_natures.rb} +1 -1
  53. data/app/models/alchemy/page/{scopes.rb → page_scopes.rb} +1 -1
  54. data/app/models/alchemy/page/{users.rb → page_users.rb} +13 -1
  55. data/app/views/alchemy/admin/elements/_add_element_button.html.erb +18 -0
  56. data/app/views/alchemy/admin/elements/_add_picture.html.erb +1 -1
  57. data/app/views/alchemy/admin/elements/_element.html.erb +12 -11
  58. data/app/views/alchemy/admin/elements/_new_element_form.html.erb +3 -0
  59. data/app/views/alchemy/admin/elements/create.js.erb +3 -3
  60. data/app/views/alchemy/admin/elements/index.html.erb +19 -4
  61. data/app/views/alchemy/admin/elements/new.html.erb +3 -0
  62. data/app/views/alchemy/admin/elements/trash.js.erb +16 -12
  63. data/app/views/alchemy/admin/layoutpages/_layoutpage.html.erb +1 -1
  64. data/app/views/alchemy/admin/layoutpages/edit.html.erb +11 -0
  65. data/app/views/alchemy/admin/layoutpages/index.html.erb +4 -16
  66. data/app/views/alchemy/admin/legacy_page_urls/_form.html.erb +5 -0
  67. data/app/views/alchemy/admin/legacy_page_urls/_label.html.erb +1 -0
  68. data/app/views/alchemy/admin/legacy_page_urls/_legacy_page_url.html.erb +13 -0
  69. data/app/views/alchemy/admin/legacy_page_urls/_new.html.erb +20 -0
  70. data/app/views/alchemy/admin/legacy_page_urls/create.js.erb +10 -0
  71. data/app/views/alchemy/admin/legacy_page_urls/destroy.js.erb +6 -0
  72. data/app/views/alchemy/admin/legacy_page_urls/update.js.erb +2 -0
  73. data/app/views/alchemy/admin/pages/_form.html.erb +58 -0
  74. data/app/views/alchemy/admin/pages/_internal_link.html.erb +9 -4
  75. data/app/views/alchemy/admin/pages/_legacy_urls.html.erb +23 -0
  76. data/app/views/alchemy/admin/pages/_locked_page.html.erb +21 -0
  77. data/app/views/alchemy/admin/pages/_page.html.erb +2 -2
  78. data/app/views/alchemy/admin/pages/_page_status.html.erb +11 -9
  79. data/app/views/alchemy/admin/pages/_tinymce_custom_config.html.erb +13 -0
  80. data/app/views/alchemy/admin/pages/configure.html.erb +16 -57
  81. data/app/views/alchemy/admin/pages/edit.html.erb +64 -66
  82. data/app/views/alchemy/admin/pages/index.html.erb +9 -19
  83. data/app/views/alchemy/admin/pages/update.js.erb +1 -1
  84. data/app/views/alchemy/admin/partials/_remote_search_form.html.erb +7 -12
  85. data/app/views/alchemy/admin/partials/_routes.html.erb +25 -0
  86. data/app/views/alchemy/admin/partials/_search_form.html.erb +10 -12
  87. data/app/views/alchemy/admin/pictures/_filter_and_size_bar.html.erb +53 -47
  88. data/app/views/alchemy/admin/pictures/index.html.erb +34 -29
  89. data/app/views/alchemy/essences/shared/_essence_picture_tools.html.erb +1 -1
  90. data/app/views/alchemy/navigation/_link.html.erb +9 -9
  91. data/app/views/alchemy/pages/show.rss.builder +2 -2
  92. data/app/views/layouts/alchemy/admin.html.erb +20 -9
  93. data/bin/alchemy +1 -1
  94. data/config/alchemy/config.yml +1 -0
  95. data/config/locales/alchemy.de.yml +15 -1
  96. data/config/locales/alchemy.en.yml +29 -19
  97. data/config/locales/alchemy.nl.yml +11 -1
  98. data/config/routes.rb +2 -1
  99. data/lib/alchemy/errors.rb +2 -2
  100. data/lib/alchemy/permissions.rb +2 -0
  101. data/lib/alchemy/resource.rb +22 -9
  102. data/lib/alchemy/tinymce.rb +13 -7
  103. data/lib/alchemy/version.rb +1 -1
  104. data/spec/controllers/admin/base_controller_spec.rb +39 -0
  105. data/spec/controllers/admin/elements_controller_spec.rb +17 -14
  106. data/spec/controllers/admin/pages_controller_spec.rb +1 -2
  107. data/spec/controllers/pages_controller_spec.rb +7 -3
  108. data/spec/dummy/app/models/dummy_user.rb +12 -2
  109. data/spec/features/admin/dashboard_spec.rb +45 -0
  110. data/spec/features/admin/legacy_page_url_management_spec.rb +62 -0
  111. data/spec/features/admin/page_editing_feature_spec.rb +66 -6
  112. data/spec/features/page_feature_spec.rb +13 -0
  113. data/spec/helpers/admin/base_helper_spec.rb +36 -0
  114. data/spec/libraries/resource_spec.rb +168 -84
  115. data/spec/libraries/tinymce_spec.rb +10 -0
  116. data/spec/models/element_spec.rb +16 -0
  117. data/spec/models/legacy_page_url_spec.rb +21 -0
  118. data/spec/models/message_spec.rb +23 -7
  119. data/spec/models/page_spec.rb +89 -12
  120. data/vendor/assets/javascripts/tinymce/plugins/anchor/plugin.min.js +1 -0
  121. data/vendor/assets/javascripts/tinymce/plugins/hr/plugin.min.js +1 -0
  122. metadata +96 -75
  123. data/app/assets/javascripts/alchemy/alchemy.routes.js.erb +0 -38
  124. data/spec/models/resource_spec.rb +0 -159
@@ -1,26 +1,14 @@
1
- <% content_for(:subnav_additions) do %>
2
- <% unless @locked_pages.blank? %>
1
+ <% if @locked_pages.present? %>
2
+ <% content_for(:subnav_additions) do %>
3
3
  <label><%= _t('Active Pages') %> &raquo;</label>
4
- <% @locked_pages.each do |page| %>
5
- <div class="subnavi_tab wide" id="locked_page_<%= page.id %>">
6
- <%= link_to alchemy.edit_admin_page_path(page) do %>
7
- <span class="page_name" title="<%= page.name %>">
8
- <%= truncate page.name, length: 15 %>
9
- </span>
10
- <% end %>
11
- <%= form_tag(alchemy.unlock_admin_page_path(page), remote: true) do %>
12
- <button class="icon_button small" title="<%= _t(:explain_unlocking) %>">
13
- <%= render_icon('close small') %>
14
- </button>
15
- <% end %>
16
- </div>
17
- <% end %>
4
+ <%= render partial: 'alchemy/admin/pages/locked_page', collection: @locked_pages %>
18
5
  <% end %>
19
6
  <% end %>
20
7
 
21
8
  <% content_for :toolbar do %>
22
9
  <div class="toolbar_buttons">
23
10
  <%= render partial: 'alchemy/admin/partials/language_tree_select' %>
11
+ <div class="toolbar_spacer"></div>
24
12
  <%= toolbar_button(
25
13
  icon: 'add_page',
26
14
  url: alchemy.new_admin_page_path(parent_id: @layout_root.id, layoutpage: true),
@@ -0,0 +1,5 @@
1
+ <%= alchemy_form_for [:admin, @legacy_page_url ||= Alchemy::LegacyPageUrl.new] do |f| %>
2
+ <%= hidden_field_tag :page_id, @page.id %>
3
+ <%= f.input :urlname %>
4
+ <%= f.submit _t(:save) %>
5
+ <% end %>
@@ -0,0 +1 @@
1
+ (<%= count %>) <%= Alchemy::LegacyPageUrl.model_name.human(count: count) %>
@@ -0,0 +1,13 @@
1
+ <tr class="even" id="<%= dom_id(legacy_page_url) %>">
2
+ <td class="name"><%= legacy_page_url.urlname %></td>
3
+ <td class="tools">
4
+ <%= link_to_dialog render_icon(:edit),
5
+ edit_admin_legacy_page_url_path(legacy_page_url, page_id: @page.id),
6
+ {size: '400x125', title: _t('Edit link')},
7
+ {title: _t(:edit)} %>
8
+ <%= link_to_confirm_dialog render_icon(:destroy),
9
+ _t('Are you sure?'),
10
+ admin_legacy_page_url_path(legacy_page_url, page_id: @page.id),
11
+ {title: _t(:remove)} %>
12
+ </td>
13
+ </tr>
@@ -0,0 +1,20 @@
1
+ <%= alchemy_form_for [:admin, @legacy_page_url ||= @page.legacy_urls.build],
2
+ id: 'new_legacy_page_url' do |f| %>
3
+ <% if @legacy_page_url.errors.any? %>
4
+ <%= render_message :error do %>
5
+ <%= @legacy_page_url.errors.full_messages.join %>
6
+ <% end %>
7
+ <% end %>
8
+ <%= hidden_field_tag :page_id, @page.id %>
9
+ <div class="inline-input">
10
+ <div class="left-column">
11
+ <%= f.text_field :urlname, placeholder: Alchemy::LegacyPageUrl.human_attribute_name(:urlname) %>
12
+ </div>
13
+ <div class="right-column">
14
+ <button class="with_icon">
15
+ <%= render_icon(:create) %>
16
+ <%= _t(:add) %>
17
+ </button>
18
+ </div>
19
+ </div>
20
+ <% end %>
@@ -0,0 +1,10 @@
1
+ <% if @legacy_page_url.valid? %>
2
+ $('.error.message', '#new_legacy_page_url').remove();
3
+ $('#legacy_urls_label').text('<%=j render("label", count: @page.legacy_urls.size) %>');
4
+ $('#legacy_page_url_urlname').val('');
5
+ $('#no_page_links_notice').hide();
6
+ $('#legacy_page_urls').append('<%=j render "legacy_page_url", legacy_page_url: @legacy_page_url %>');
7
+ Alchemy.watchForDialogs('#<%= dom_id(@legacy_page_url) %>');
8
+ <% else %>
9
+ $('#new_legacy_page_url').replaceWith('<%=j render("new") %>');
10
+ <% end %>
@@ -0,0 +1,6 @@
1
+ $('#legacy_urls_label').text('<%=j render("label", count: @page.legacy_urls.size) %>');
2
+ $('#<%= dom_id(@legacy_page_url) %>').remove();
3
+ Alchemy.pleaseWaitOverlay(false);
4
+ <% if @page.legacy_urls.size == 0 %>
5
+ $('#no_page_links_notice').show();
6
+ <% end %>
@@ -0,0 +1,2 @@
1
+ Alchemy.closeCurrentDialog();
2
+ $('td.name', '#<%= dom_id(@legacy_page_url) %>').text('<%= @legacy_page_url.urlname %>');
@@ -0,0 +1,58 @@
1
+ <%= alchemy_form_for [:admin, @page], class: 'edit_page' do |f| %>
2
+ <%= f.input :page_layout, collection: @page_layouts, label: _t(:page_type), include_blank: false, input_html: {class: 'alchemy_selectbox'} %>
3
+ <div class="input check_boxes">
4
+ <label class="control-label"><%= _t(:page_status) %></label>
5
+ <div class="control_group">
6
+ <label class="checkbox">
7
+ <%= f.check_box :public %>
8
+ <%= f.object.class.human_attribute_name :public %>
9
+ </label>
10
+ <label class="checkbox">
11
+ <%= f.check_box :visible %>
12
+ <%= f.object.class.human_attribute_name :visible %>
13
+ </label>
14
+ <label class="checkbox">
15
+ <%= f.check_box :restricted %>
16
+ <%= f.object.class.human_attribute_name :restricted %>
17
+ </label>
18
+ <% if configuration(:sitemap)['show_flag'] %>
19
+ <label class="checkbox">
20
+ <%= f.check_box :sitemap %>
21
+ <%= f.object.class.human_attribute_name :sitemap %>
22
+ </label>
23
+ <% end %>
24
+ </div>
25
+ </div>
26
+ <h2><%= _t(:names) %></h2>
27
+ <%= f.input :name, autofocus: true %>
28
+ <%= f.input :urlname, as: 'string', input_html: {value: @page.slug} %>
29
+ <%= f.input :title,
30
+ input_html: {'data-alchemy-char-counter' => 60} %>
31
+ <h2><%= _t(:meta_data) %></h2>
32
+ <div class="input check_boxes">
33
+ <label class="control-label"><%= _t(:search_engines) %></label>
34
+ <div class="control_group">
35
+ <label class="checkbox">
36
+ <%= f.check_box :robot_index %>
37
+ <%= f.object.class.human_attribute_name :robot_index %>
38
+ </label>
39
+ <label class="checkbox">
40
+ <%= f.check_box :robot_follow %>
41
+ <%= f.object.class.human_attribute_name :robot_follow %>
42
+ </label>
43
+ </div>
44
+ </div>
45
+ <%= f.input :meta_description,
46
+ as: 'text',
47
+ input_html: {'data-alchemy-char-counter' => 160} %>
48
+ <%= f.input :meta_keywords,
49
+ as: 'text',
50
+ hint: _t('pages.update.comma_seperated') %>
51
+ <% if @page.taggable? %>
52
+ <div class="input string">
53
+ <%= f.label :tag_list %>
54
+ <%= render 'alchemy/admin/partials/autocomplete_tag_list', f: f %>
55
+ </div>
56
+ <% end %>
57
+ <%= f.submit _t(:save) %>
58
+ <% end %>
@@ -1,6 +1,8 @@
1
1
  <%= form_tag do %>
2
2
  <%= render_message do %>
3
3
  <h2><%= _t(:internal_link_headline) %></h2>
4
+ <p><%= _t(:internal_link_page_elements_explanation) %></p>
5
+ <p><%= _t(:internal_link_page_anchors_explanation) %></p>
4
6
  <% end %>
5
7
  <div id="page_selector_container">
6
8
  <% if @page_root %>
@@ -9,11 +11,13 @@
9
11
  </ul>
10
12
  <% end %>
11
13
  </div>
12
- <div class="input text">
13
- <label for="internal_urlname" class="control-label">
14
- <%= _t(:url) %>
14
+ <div class="input select">
15
+ <label for="internal_anchor" class="control-label">
16
+ <%= _t(:anchor) %>
15
17
  </label>
16
- <%= text_field_tag(:internal_urlname) %>
18
+ <%= select_tag(:internal_anchor,
19
+ options_for_select([[_t('Please choose'), '']]),
20
+ class: 'alchemy_selectbox') %>
17
21
  </div>
18
22
  <div class="input text">
19
23
  <label for="internal_link_title" class="control-label">
@@ -30,6 +34,7 @@
30
34
  class: 'alchemy_selectbox link_target' %>
31
35
  </div>
32
36
  <div class="submit">
37
+ <%= hidden_field_tag(:internal_urlname) %>
33
38
  <%= hidden_field_tag(:page_anchor) %>
34
39
  <%= link_to _t(:apply), '', class: 'create-link button', 'data-link-type' => 'internal' %>
35
40
  </div>
@@ -0,0 +1,23 @@
1
+ <%= render_message do %>
2
+ <p><%== _t(:legacy_url_info_text) %></p>
3
+ <% end %>
4
+
5
+ <table class="list" id="legacy_page_urls">
6
+ <tr>
7
+ <th class="name">
8
+ <%= Alchemy::LegacyPageUrl.human_attribute_name(:urlname) %>
9
+ </th>
10
+ <th class="tools"></th>
11
+ </tr>
12
+ <%= render partial: 'alchemy/admin/legacy_page_urls/legacy_page_url',
13
+ collection: @page.legacy_urls %>
14
+ <tr class="even" id="no_page_links_notice" style="display: <%= @page.legacy_urls.any? ? 'none' : 'table-row' %>">
15
+ <td><%= _t('No page links for this page found') %></td>
16
+ <td class="tools"></td>
17
+ </tr>
18
+ </table>
19
+
20
+ <fieldset>
21
+ <legend><%= _t('Add page link') %></legend>
22
+ <%= render 'alchemy/admin/legacy_page_urls/new' %>
23
+ </fieldset>
@@ -0,0 +1,21 @@
1
+ <% if @page == locked_page %>
2
+ <%= render 'page_status' %>
3
+ <% else %>
4
+ <div class="subnavi_tab wide" id="locked_page_<%= locked_page.id %>">
5
+ <%= link_to alchemy.edit_admin_page_path(locked_page) do %>
6
+ <span class="page_name" title="<%= locked_page.name %>">
7
+ <%= truncate locked_page.name, length: 15 %>
8
+ </span>
9
+ <%- if multi_language? -%>
10
+ <span class="page_language" title="<%= locked_page.language.name %>">
11
+ <%= locked_page.language_code %>
12
+ </span>
13
+ <%- end -%>
14
+ <% end %>
15
+ <%= form_tag(alchemy.unlock_admin_page_path(locked_page), remote: true) do %>
16
+ <button class="icon_button small" title="<%= _t(:explain_unlocking) %>">
17
+ <%= render_icon('close small') %>
18
+ </button>
19
+ <% end %>
20
+ </div>
21
+ <% end %>
@@ -26,7 +26,7 @@
26
26
  alchemy.configure_admin_page_path(page),
27
27
  {
28
28
  title: _t(:edit_page_properties),
29
- size: page.redirects_to_external? ? '410x330' : '410x660'
29
+ size: page.redirects_to_external? ? '450x330' : '450x720'
30
30
  },
31
31
  title: _t(:edit_page_properties),
32
32
  class: 'sitemap_tool'
@@ -87,7 +87,7 @@
87
87
  <span class="sitemap_pagename_link inactive"><%= page.name %></span>
88
88
  <span class="redirect_url" title="<%= h page.urlname %>">
89
89
  &raquo; <%= _t('Redirects to') %>:
90
- <%= h page.urlname %>
90
+ <%= h page.external_urlname %>
91
91
  </span>
92
92
  <%- else -%>
93
93
  <%= link_to_unless(
@@ -1,9 +1,11 @@
1
- <span class="page_status_and_name" id="page_<%= @page.id %>_status">
2
- <span class="page_name"><%= @page.name %></span>
3
- <%- if multi_language? -%>
4
- <span class="page_language"><%= @page.language_code %></span>
5
- <%- end -%>
6
- <span class="page_status <%= @page.public ? 'public' : 'not_public' %>" title="<%= @page.status_title(:public) %>"></span>
7
- <span class="page_status <%= @page.visible ? 'visible' : 'not_visible' %>" title="<%= @page.status_title(:visible) %>"></span>
8
- <span class="page_status <%= @page.restricted ? 'restricted' : 'not_restricted' %>" title="<%= @page.status_title(:restricted) %>"></span>
9
- </span>
1
+ <div class="page_status_and_name" id="page_<%= @page.id %>_status">
2
+ <span class="page_name"><%= @page.name %></span>
3
+ <%- if multi_language? -%>
4
+ <span class="page_language" title="<%= @page.language.name %>">
5
+ <%= @page.language_code %>
6
+ </span>
7
+ <%- end -%>
8
+ <span class="page_status <%= @page.public ? 'public' : 'not_public' %>" title="<%= @page.status_title(:public) %>"></span>
9
+ <span class="page_status <%= @page.visible ? 'visible' : 'not_visible' %>" title="<%= @page.status_title(:visible) %>"></span>
10
+ <span class="page_status <%= @page.restricted ? 'restricted' : 'not_restricted' %>" title="<%= @page.status_title(:restricted) %>"></span>
11
+ </div>
@@ -0,0 +1,13 @@
1
+ <script>
2
+ // Holds custom tinymce configurations
3
+ Alchemy.Tinymce.customConfigs = {};
4
+
5
+ // Populate custom tinymce configurations
6
+ <% Alchemy::Tinymce.custom_config_contents(@page).each do |content| %>
7
+ Alchemy.Tinymce.customConfigs["<%= content['element'] %>_<%= content['name'] %>"] = {
8
+ <% content.fetch('settings', {}).fetch('tinymce', {}).each do |k, v| %>
9
+ <%= k %>: <%== v.to_json %>,
10
+ <% end %>
11
+ };
12
+ <% end %>
13
+ </script>
@@ -1,57 +1,16 @@
1
- <%= alchemy_form_for [:admin, @page], class: 'edit_page' do |f| %>
2
- <%= f.input :page_layout, collection: @page_layouts, label: _t(:page_type), include_blank: false, input_html: {class: 'alchemy_selectbox'} %>
3
- <% unless @page.layoutpage %>
4
- <div class="input check_boxes">
5
- <label class="control-label"><%= _t(:page_status) %></label>
6
- <div class="control_group">
7
- <label class="checkbox">
8
- <%= f.check_box :public %>
9
- <%= f.object.class.human_attribute_name :public %>
10
- </label>
11
- <label class="checkbox">
12
- <%= f.check_box :visible %>
13
- <%= f.object.class.human_attribute_name :visible %>
14
- </label>
15
- <label class="checkbox">
16
- <%= f.check_box :restricted %>
17
- <%= f.object.class.human_attribute_name :restricted %>
18
- </label>
19
- <% if configuration(:sitemap)['show_flag'] %>
20
- <label class="checkbox">
21
- <%= f.check_box :sitemap %>
22
- <%= f.object.class.human_attribute_name :sitemap %>
23
- </label>
24
- <% end %>
25
- </div>
26
- </div>
27
- <h2><%= _t(:names) %></h2>
28
- <% end %>
29
- <%= f.input :name, autofocus: true %>
30
- <% unless @page.layoutpage %>
31
- <%= f.input :urlname, as: 'string', input_html: {value: @page.slug} %>
32
- <%= f.input :title %>
33
- <h2><%= _t(:meta_data) %></h2>
34
- <div class="input check_boxes">
35
- <label class="control-label"><%= _t(:search_engines) %></label>
36
- <div class="control_group">
37
- <label class="checkbox">
38
- <%= f.check_box :robot_index %>
39
- <%= f.object.class.human_attribute_name :robot_index %>
40
- </label>
41
- <label class="checkbox">
42
- <%= f.check_box :robot_follow %>
43
- <%= f.object.class.human_attribute_name :robot_follow %>
44
- </label>
45
- </div>
46
- </div>
47
- <%= f.input :meta_description, as: 'text' %>
48
- <%= f.input :meta_keywords, as: 'text', hint: _t('pages.update.comma_seperated') %>
49
- <% end %>
50
- <% if @page.taggable? %>
51
- <div class="input string">
52
- <%= f.label :tag_list %>
53
- <%= render 'alchemy/admin/partials/autocomplete_tag_list', f: f %>
54
- </div>
55
- <% end %>
56
- <%= f.submit _t(:save) %>
57
- <% end %>
1
+ <div id="overlay_tabs">
2
+ <ul>
3
+ <li><a href="#page_properties"><%= _t('Properties') %></a></li>
4
+ <li>
5
+ <a href="#legacy_urls" id="legacy_urls_label">
6
+ <%= render 'alchemy/admin/legacy_page_urls/label', count: @page.legacy_urls.size %>
7
+ </a>
8
+ </li>
9
+ </ul>
10
+ <div id="page_properties">
11
+ <%= render 'form' %>
12
+ </div>
13
+ <div id="legacy_urls">
14
+ <%= render 'legacy_urls' %>
15
+ </div>
16
+ </div>
@@ -2,24 +2,7 @@
2
2
 
3
3
  <% content_for(:subnav_additions) do %>
4
4
  <label><%= _t('Active Pages') %> &raquo;</label>
5
- <% @locked_pages.each do |page| %>
6
- <% if @page == page %>
7
- <%= render partial: 'page_status' %>
8
- <% else %>
9
- <div class="subnavi_tab wide" id="locked_page_<%= page.id %>">
10
- <%= link_to alchemy.edit_admin_page_path(page) do %>
11
- <span class="page_name" title="<%= page.name %>">
12
- <%= truncate page.name, length: 15 %>
13
- </span>
14
- <% end %>
15
- <%= form_tag(alchemy.unlock_admin_page_path(page), remote: true) do %>
16
- <button class="icon_button small" title="<%= _t(:explain_unlocking) %>">
17
- <%= render_icon('close small') %>
18
- </button>
19
- <% end %>
20
- </div>
21
- <% end %>
22
- <% end %>
5
+ <%= render partial: 'locked_page', collection: @locked_pages %>
23
6
  <% end %>
24
7
 
25
8
  <% content_for(:toolbar) do %>
@@ -32,6 +15,7 @@
32
15
  <label><%= _t(:unlock_page) %></label>
33
16
  <% end %>
34
17
  </div>
18
+ <div class="toolbar_spacer"></div>
35
19
  <% unless @page.layoutpage? %>
36
20
  <div class="button_with_label">
37
21
  <%= form_tag alchemy.visit_admin_page_path(@page), id: 'visit_page_form' do %>
@@ -59,17 +43,31 @@
59
43
  <label><%= _t(:page_infos) %></label>
60
44
  </div>
61
45
  <div class="button_with_label">
62
- <%= link_to_dialog(
63
- render_icon('settings'),
64
- alchemy.configure_admin_page_path(@page),
65
- {
46
+ <% if @page.layoutpage? %>
47
+ <%= link_to_dialog(
48
+ render_icon('settings'),
49
+ alchemy.edit_admin_layoutpage_path(@page),
50
+ {
51
+ title: _t(:edit_page_properties),
52
+ size: '450x170'
53
+ },
54
+ class: :icon_button,
66
55
  title: _t(:edit_page_properties),
67
- size: @page.layoutpage? ? '410x150' : '410x660'
68
- },
69
- class: :icon_button,
70
- title: _t(:edit_page_properties),
71
- 'data-alchemy-hotkey' => 'alt+e'
72
- ) %>
56
+ 'data-alchemy-hotkey' => 'alt+e'
57
+ ) %>
58
+ <% else %>
59
+ <%= link_to_dialog(
60
+ render_icon('settings'),
61
+ alchemy.configure_admin_page_path(@page),
62
+ {
63
+ title: _t(:edit_page_properties),
64
+ size: '450x720'
65
+ },
66
+ class: :icon_button,
67
+ title: _t(:edit_page_properties),
68
+ 'data-alchemy-hotkey' => 'alt+e'
69
+ ) %>
70
+ <% end %>
73
71
  <label><%= _t(:page_properties) %></label>
74
72
  </div>
75
73
  <% if configuration(:cache_pages) && !@page.layoutpage? %>
@@ -83,10 +81,13 @@
83
81
  </div>
84
82
  <% end %>
85
83
  <div class="toolbar_spacer"></div>
86
- <div class="button_with_label">
87
- <%= select_tag('preview_size', preview_sizes_for_select, class: 'alchemy_selectbox medium') %>
84
+ <div class="select_with_label">
88
85
  <label><%= _t(:preview_size) %></label>
86
+ <%= select_tag 'preview_size',
87
+ preview_sizes_for_select,
88
+ class: 'alchemy_selectbox medium' %>
89
89
  </div>
90
+ <div class="toolbar_spacer"></div>
90
91
  <div class="button_with_label">
91
92
  <%= link_to render_icon(:reload), '#', {
92
93
  title: _t('Reload Preview'),
@@ -97,6 +98,35 @@
97
98
  </div>
98
99
  </div>
99
100
  <div class="toolbar_buttons right">
101
+ <% if can?(:create, Alchemy::Element) %>
102
+ <div class="button_with_label" id="clipboard_button">
103
+ <%= link_to_dialog(
104
+ render_icon("clipboard#{clipboard_empty?('elements') ? '' : ' full'}"),
105
+ alchemy.admin_clipboard_path(remarkable_type: "elements"),
106
+ {
107
+ title: _t('Clipboard'),
108
+ size: '380x305'
109
+ },
110
+ {
111
+ title: _t('Show clipboard'),
112
+ class: 'icon_button'
113
+ }
114
+ ) %>
115
+ <label><%= _t('Show clipboard') %></label>
116
+ </div>
117
+ <% end %>
118
+ <div class="button_with_label" id="element_trash_button">
119
+ <%= link_to(
120
+ render_icon("trash#{trash_empty?('elements') ? '' : ' full'}"),
121
+ '',
122
+ {
123
+ title: _t('Show trash'),
124
+ onclick: "Alchemy.TrashWindow.open(#{@page.id}, '#{_t('Trash')}'); return false",
125
+ class: 'icon_button'
126
+ }
127
+ ) %>
128
+ <label><%= _t('Show trash') %></label>
129
+ </div>
100
130
  <div class="button_with_label" id="element_window_button">
101
131
  <%= link_to render_icon(:element_window), '', {
102
132
  title: _t('Hide Elements'),
@@ -108,6 +138,9 @@
108
138
  <% end %>
109
139
 
110
140
  <% content_for :javascripts do %>
141
+ <% if Alchemy::Tinymce.custom_config_contents(@page).any? %>
142
+ <%= render 'tinymce_custom_config' %>
143
+ <% end %>
111
144
  <script type="text/javascript" charset="utf-8">
112
145
 
113
146
  $(function() {
@@ -127,42 +160,7 @@
127
160
  cancel_label: '<%= _t("No") %>',
128
161
  hideElements: '<%= _t("Hide Elements") %>',
129
162
  showElements: '<%= _t("Show Elements") %>'
130
- },
131
- toolbarButtons: [
132
- {
133
- title: '<%= _t("New Element") %>',
134
- label: '<%= _t("New Element") %>',
135
- hotkey: 'alt+n',
136
- iconClass: 'new_element',
137
- onClick: function() {
138
- Alchemy.openDialog('<%= alchemy.new_admin_element_path(page_id: @page.id) %>', {
139
- title: '<%= _t("New Element") %>',
140
- size: '320x125'
141
- });
142
- }
143
- },
144
- {
145
- title: '<%= _t("Clipboard") %>',
146
- label: '<%= _t("Show clipboard") %>',
147
- iconClass: 'clipboard<%= clipboard_empty?("elements") ? "" : " full" %>',
148
- buttonId: 'clipboard_button',
149
- onClick: function() {
150
- Alchemy.openDialog('<%= alchemy.admin_clipboard_path(remarkable_type: "elements") %>', {
151
- title :'<%= _t("Clipboard") %>',
152
- size: '380x305'
153
- });
154
- }
155
- },
156
- {
157
- title: '<%= _t("Show trash") %>',
158
- label: '<%= _t("Show trash") %>',
159
- iconClass: 'trash<%= trash_empty?("elements") ? "" : " full" %>',
160
- buttonId: 'element_trash_button',
161
- onClick: function() {
162
- Alchemy.TrashWindow.open(<%= @page.id %>, '<%= _t("Trash") %>');
163
- }
164
- }
165
- ]
163
+ }
166
164
  }, function() {
167
165
  Alchemy.ImageLoader('#element_area');
168
166
  Alchemy.SortableElements(<%= @page.id %>, '<%= form_authenticity_token %>');