alchemy_cms 2.2.4 → 2.3.rc5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (215) hide show
  1. data/.gitignore +1 -1
  2. data/.travis.yml +3 -4
  3. data/Gemfile +1 -0
  4. data/README.md +10 -6
  5. data/alchemy_cms.gemspec +5 -2
  6. data/app/assets/images/alchemy/icons.png +0 -0
  7. data/app/assets/images/sassy-ie-overlay.png +0 -0
  8. data/app/assets/javascripts/alchemy/alchemy.base.js +50 -59
  9. data/app/assets/javascripts/alchemy/alchemy.buttons.js +14 -4
  10. data/app/assets/javascripts/alchemy/alchemy.datepicker.js +8 -2
  11. data/app/assets/javascripts/alchemy/alchemy.elements_window.js +11 -3
  12. data/app/assets/javascripts/alchemy/alchemy.gui.js.coffee +1 -1
  13. data/app/assets/javascripts/alchemy/alchemy.link_overlay.js.coffee +14 -1
  14. data/app/assets/javascripts/alchemy/alchemy.preview.js +1 -1
  15. data/app/assets/javascripts/alchemy/alchemy.preview_window.js +12 -4
  16. data/app/assets/javascripts/alchemy/alchemy.uploader.js +4 -1
  17. data/app/assets/javascripts/alchemy/alchemy.windows.js +18 -8
  18. data/app/assets/stylesheets/alchemy/_defaults.scss +84 -120
  19. data/app/assets/stylesheets/alchemy/alchemy.css +2 -2
  20. data/app/assets/stylesheets/alchemy/archive.css.scss +288 -0
  21. data/app/assets/stylesheets/alchemy/base.css.scss +95 -390
  22. data/app/assets/stylesheets/alchemy/dashboard.css.scss +4 -4
  23. data/app/assets/stylesheets/alchemy/elements.css.scss +83 -118
  24. data/app/assets/stylesheets/alchemy/flash.css.scss +1 -1
  25. data/app/assets/stylesheets/alchemy/form_elements.css.scss +528 -0
  26. data/app/assets/stylesheets/alchemy/frame.css.scss +13 -39
  27. data/app/assets/stylesheets/alchemy/icons.css.scss +217 -228
  28. data/app/assets/stylesheets/alchemy/jquery-ui.alchemy.css.scss +48 -50
  29. data/app/assets/stylesheets/alchemy/jquery.Jcrop.css.scss +1 -1
  30. data/app/assets/stylesheets/alchemy/login.css.scss +1 -5
  31. data/app/assets/stylesheets/alchemy/menubar.css.scss +19 -29
  32. data/app/assets/stylesheets/alchemy/pagination.css.scss +3 -4
  33. data/app/assets/stylesheets/alchemy/sitemap.css.scss +81 -81
  34. data/app/assets/stylesheets/alchemy/tables.css.scss +63 -57
  35. data/app/assets/stylesheets/alchemy/tinymce_dialog.css.scss +57 -57
  36. data/app/assets/stylesheets/alchemy/upload.css.scss +6 -6
  37. data/app/assets/stylesheets/tiny_mce/plugins/inlinepopups/skins/alchemy/window.css.scss +6 -10
  38. data/app/controllers/alchemy/admin/attachments_controller.rb +5 -4
  39. data/app/controllers/alchemy/admin/base_controller.rb +1 -9
  40. data/app/controllers/alchemy/admin/contents_controller.rb +4 -6
  41. data/app/controllers/alchemy/admin/elements_controller.rb +2 -2
  42. data/app/controllers/alchemy/admin/pages_controller.rb +2 -2
  43. data/app/controllers/alchemy/admin/pictures_controller.rb +74 -15
  44. data/app/controllers/alchemy/attachments_controller.rb +8 -2
  45. data/app/controllers/alchemy/base_controller.rb +47 -5
  46. data/app/controllers/alchemy/elements_controller.rb +1 -1
  47. data/app/controllers/alchemy/messages_controller.rb +12 -12
  48. data/app/controllers/alchemy/pages_controller.rb +5 -1
  49. data/app/controllers/alchemy/pictures_controller.rb +9 -4
  50. data/app/controllers/alchemy/user_sessions_controller.rb +2 -4
  51. data/app/helpers/alchemy/admin/base_helper.rb +98 -19
  52. data/app/helpers/alchemy/admin/contents_helper.rb +2 -2
  53. data/app/helpers/alchemy/admin/elements_helper.rb +2 -3
  54. data/app/helpers/alchemy/base_helper.rb +6 -5
  55. data/app/helpers/alchemy/elements_helper.rb +2 -2
  56. data/app/helpers/alchemy/essences_helper.rb +4 -5
  57. data/app/helpers/alchemy/pages_helper.rb +15 -79
  58. data/app/helpers/alchemy/url_helper.rb +67 -0
  59. data/app/mailers/alchemy/messages.rb +1 -1
  60. data/app/mailers/alchemy/notifications.rb +1 -1
  61. data/app/models/alchemy/attachment.rb +11 -2
  62. data/app/models/alchemy/cell.rb +20 -10
  63. data/app/models/alchemy/content.rb +4 -3
  64. data/app/models/alchemy/element.rb +170 -178
  65. data/app/models/alchemy/language/code.rb +4 -1
  66. data/app/models/alchemy/message.rb +19 -3
  67. data/app/models/alchemy/page.rb +45 -40
  68. data/app/models/alchemy/picture.rb +24 -2
  69. data/app/models/alchemy/user.rb +2 -3
  70. data/app/views/alchemy/admin/attachments/_archive_overlay.html.erb +12 -12
  71. data/app/views/alchemy/admin/attachments/_attachment.html.erb +1 -1
  72. data/app/views/alchemy/admin/attachments/create.js.erb +1 -0
  73. data/app/views/alchemy/admin/attachments/edit.html.erb +9 -3
  74. data/app/views/alchemy/admin/attachments/index.html.erb +3 -2
  75. data/app/views/alchemy/admin/contents/_missing.html.erb +1 -1
  76. data/app/views/alchemy/admin/contents/create.js.erb +54 -0
  77. data/app/views/alchemy/admin/contents/new.html.erb +9 -4
  78. data/app/views/alchemy/admin/elements/{_add_content.html.erb → _add_picture.html.erb} +4 -4
  79. data/app/views/alchemy/admin/elements/_elements_select.html.erb +2 -1
  80. data/app/views/alchemy/admin/elements/_new_element_form.html.erb +1 -1
  81. data/app/views/alchemy/admin/elements/{_picture_editor.html.erb → _picture_gallery_editor.html.erb} +7 -11
  82. data/app/views/alchemy/admin/elements/fold.js.erb +46 -0
  83. data/app/views/alchemy/admin/elements/index.html.erb +24 -24
  84. data/app/views/alchemy/admin/elements/list.js.erb +11 -9
  85. data/app/views/alchemy/admin/essence_files/assign.js.erb +3 -1
  86. data/app/views/alchemy/admin/essence_pictures/destroy.js.erb +28 -0
  87. data/app/views/alchemy/admin/pages/_contactform_links.html.erb +8 -6
  88. data/app/views/alchemy/admin/pages/_external_link.html.erb +11 -9
  89. data/app/views/alchemy/admin/pages/_file_link.html.erb +10 -8
  90. data/app/views/alchemy/admin/pages/_internal_link.html.erb +14 -10
  91. data/app/views/alchemy/admin/pages/_new_page_form.html.erb +1 -1
  92. data/app/views/alchemy/admin/pages/_page.html.erb +1 -1
  93. data/app/views/alchemy/admin/pages/_page_for_links.html.erb +32 -21
  94. data/app/views/alchemy/admin/pages/configure.html.erb +2 -2
  95. data/app/views/alchemy/admin/pages/configure_external.html.erb +13 -13
  96. data/app/views/alchemy/admin/pages/edit.html.erb +2 -2
  97. data/app/views/alchemy/admin/pages/index.html.erb +26 -24
  98. data/app/views/alchemy/admin/pages/link.html.erb +2 -5
  99. data/app/views/alchemy/admin/partials/_upload_form.html.erb +28 -12
  100. data/app/views/alchemy/admin/pictures/_archive.html.erb +54 -0
  101. data/app/views/alchemy/admin/pictures/_archive_overlay.html.erb +10 -7
  102. data/app/views/alchemy/admin/pictures/_filter_and_size_bar.html.erb +21 -22
  103. data/app/views/alchemy/admin/pictures/_filter_bar.html.erb +31 -0
  104. data/app/views/alchemy/admin/pictures/_overlay_picture_list.html.erb +9 -0
  105. data/app/views/alchemy/admin/pictures/_picture.html.erb +36 -6
  106. data/app/views/alchemy/admin/pictures/_tag_list.html.erb +27 -0
  107. data/app/views/alchemy/admin/pictures/archive_overlay.js.erb +3 -1
  108. data/app/views/alchemy/admin/pictures/create.js.erb +4 -5
  109. data/app/views/alchemy/admin/pictures/edit.html.erb +26 -0
  110. data/app/views/alchemy/admin/pictures/edit_multiple.html.erb +39 -0
  111. data/app/views/alchemy/admin/pictures/index.html.erb +81 -70
  112. data/app/views/alchemy/admin/pictures/index.js.erb +3 -0
  113. data/app/views/alchemy/admin/pictures/new.html.erb +1 -0
  114. data/app/views/alchemy/admin/resources/index.html.erb +3 -1
  115. data/app/views/alchemy/admin/users/_table.html.erb +1 -1
  116. data/app/views/alchemy/admin/users/index.html.erb +27 -23
  117. data/app/views/alchemy/elements/_article_editor.html.erb +7 -2
  118. data/app/views/alchemy/elements/_bild_editor.html.erb +1 -1
  119. data/app/views/alchemy/elements/_bild_text_editor.html.erb +6 -1
  120. data/app/views/alchemy/elements/_bild_text_view.html.erb +3 -3
  121. data/app/views/alchemy/elements/_image_mosaic_editor.html.erb +1 -1
  122. data/app/views/alchemy/elements/_image_mosaic_view.html.erb +2 -2
  123. data/app/views/alchemy/elements/_intro_image_text_view.html.erb +4 -4
  124. data/app/views/alchemy/elements/_searchresult_editor.html.erb +4 -1
  125. data/app/views/alchemy/essences/_essence_boolean_editor.html.erb +1 -1
  126. data/app/views/alchemy/essences/_essence_picture_editor.html.erb +2 -3
  127. data/app/views/alchemy/essences/_essence_picture_tools.html.erb +1 -1
  128. data/app/views/alchemy/search/_form.html.erb +8 -0
  129. data/app/views/alchemy/search/_result.html.erb +3 -2
  130. data/app/views/alchemy/search/_results.html.erb +28 -0
  131. data/app/views/alchemy/user_sessions/leave.html.erb +4 -4
  132. data/app/views/alchemy/user_sessions/login.html.erb +1 -2
  133. data/app/views/layouts/alchemy/admin.html.erb +30 -10
  134. data/app/views/layouts/alchemy/login.html.erb +2 -39
  135. data/config/alchemy/elements.yml +1 -2
  136. data/config/alchemy/page_layouts.yml +8 -5
  137. data/config/authorization_rules.rb +27 -18
  138. data/config/initializers/localeapp.rb +9 -0
  139. data/config/locales/alchemy.de.yml +93 -56
  140. data/config/locales/alchemy.en.yml +73 -50
  141. data/config/routes.rb +3 -1
  142. data/db/migrate/20120704181529_add_upload_hash_to_alchemy_picture.rb +5 -0
  143. data/db/migrate/20120705214247_acts_as_taggable_on_migration.rb +28 -0
  144. data/db/migrate/20120728185830_add_cached_tag_list_to_alchemy_pictures.rb +5 -0
  145. data/db/migrate/20120831135441_set_alchemy_languages_country_code_default_to_empty_string.rb +9 -0
  146. data/lib/alchemy/capistrano.rb +2 -2
  147. data/lib/alchemy/essence.rb +14 -0
  148. data/lib/alchemy/page_layout.rb +0 -6
  149. data/lib/alchemy/resource.rb +9 -15
  150. data/lib/alchemy/upgrader.rb +18 -3
  151. data/lib/alchemy/version.rb +5 -1
  152. data/lib/alchemy_cms.rb +4 -1
  153. data/lib/rails/generators/alchemy/deploy_script/deploy_script_generator.rb +16 -6
  154. data/lib/rails/generators/alchemy/deploy_script/templates/deploy.rb.tt +17 -3
  155. data/lib/rails/generators/alchemy/elements/elements_generator.rb +6 -1
  156. data/lib/rails/generators/alchemy/elements/templates/editor.html.erb +10 -1
  157. data/lib/rails/generators/alchemy/elements/templates/view.html.erb +17 -18
  158. data/lib/rails/generators/alchemy/scaffold/files/pages.html.erb +4 -2
  159. data/lib/tasks/fleximage.rake +2 -2
  160. data/spec/controllers/admin/contents_controller_spec.rb +2 -2
  161. data/spec/controllers/admin/elements_controller_spec.rb +30 -1
  162. data/spec/controllers/admin/pages_controller_spec.rb +35 -18
  163. data/spec/controllers/admin/trash_controller_spec.rb +40 -16
  164. data/spec/controllers/attachments_controller_spec.rb +62 -0
  165. data/spec/controllers/base_controller_spec.rb +43 -42
  166. data/spec/controllers/elements_controller_spec.rb +30 -0
  167. data/spec/controllers/pages_controller_spec.rb +22 -5
  168. data/spec/controllers/pictures_controller_spec.rb +82 -0
  169. data/spec/dummy/app/models/event.rb +2 -1
  170. data/spec/dummy/config/database.yml +3 -2
  171. data/spec/dummy/db/schema.rb +51 -27
  172. data/spec/factories.rb +29 -8
  173. data/spec/helpers/admin/base_helper_spec.rb +134 -21
  174. data/spec/helpers/admin/contents_helper_spec.rb +2 -2
  175. data/spec/helpers/admin/elements_helper_spec.rb +17 -9
  176. data/spec/helpers/admin/essences_helper_spec.rb +7 -6
  177. data/spec/helpers/essences_helper_spec.rb +8 -7
  178. data/spec/helpers/pages_helper_spec.rb +208 -325
  179. data/spec/helpers/url_helper_spec.rb +171 -0
  180. data/spec/integration/admin/link_overlay_spec.rb +53 -0
  181. data/spec/integration/admin/modules_integration_spec.rb +22 -26
  182. data/spec/integration/admin/pages_controller_spec.rb +10 -19
  183. data/spec/integration/admin/picture_library_integration_spec.rb +52 -0
  184. data/spec/integration/admin/resources_integration_spec.rb +68 -75
  185. data/spec/integration/pages_controller_spec.rb +70 -61
  186. data/spec/integration/security_spec.rb +3 -5
  187. data/spec/integration/translation_integration_spec.rb +56 -0
  188. data/spec/libraries/essence_spec.rb +18 -0
  189. data/spec/libraries/resource_spec.rb +101 -79
  190. data/spec/libraries/resources_helper_spec.rb +3 -0
  191. data/spec/models/content_spec.rb +63 -60
  192. data/spec/models/element_spec.rb +203 -93
  193. data/spec/models/language_spec.rb +90 -65
  194. data/spec/models/page_layout_spec.rb +37 -0
  195. data/spec/models/page_spec.rb +181 -113
  196. data/spec/models/picture_spec.rb +73 -26
  197. data/spec/models/resource_spec.rb +52 -23
  198. data/spec/support/alchemy/specs_helpers.rb +2 -0
  199. data/spec/support/image.png +0 -0
  200. data/spec/{helpers/url_helpers_spec.rb → url_helpers_spec.rb} +0 -0
  201. data/vendor/assets/javascripts/jquery_plugins/jquery.selectBoxIt.js +1909 -0
  202. data/vendor/assets/javascripts/jquery_plugins/preloadCssImages.jQuery_v5.js +152 -0
  203. metadata +106 -33
  204. data/app/assets/stylesheets/alchemy/buttons.css.scss +0 -361
  205. data/app/assets/stylesheets/alchemy/jquery.sb.css.scss +0 -260
  206. data/app/views/alchemy/admin/contents/create.js.coffee +0 -49
  207. data/app/views/alchemy/admin/elements/fold.js.coffee +0 -37
  208. data/app/views/alchemy/admin/essence_pictures/destroy.js.coffee +0 -19
  209. data/app/views/alchemy/admin/pictures/_pictures_list.html.erb +0 -16
  210. data/app/views/alchemy/admin/pictures/update.js.erb +0 -3
  211. data/spec/dummy/config/locales/en.yml +0 -5
  212. data/spec/dummy/config/locales/fo.yml +0 -5
  213. data/spec/page_layout_spec.rb +0 -35
  214. data/vendor/assets/javascripts/jquery_plugins/jquery.in-place-edit.js +0 -172
  215. data/vendor/assets/javascripts/jquery_plugins/jquery.sb.min.js +0 -14
@@ -1,13 +1,13 @@
1
- <div class="add_content" id="add_content_<%= element.id %>">
1
+ <div class="add_picture" id="add_picture_<%= element.id %>">
2
2
  <%= link_to_overlay_window(
3
- render_icon('assign'),
3
+ render_icon('add'),
4
4
  alchemy.admin_pictures_path(
5
5
  :element_id => element,
6
6
  :options => options
7
7
  ),
8
8
  {
9
- :title => t('assign_image'),
10
- :size => '720x580',
9
+ :title => t('add_image_to_element'),
10
+ :size => '780x580',
11
11
  :resizable => true
12
12
  }
13
13
  ) %>
@@ -4,5 +4,6 @@
4
4
  :prompt => t("choose_element_to_link"),
5
5
  :class => "elements_from_page_selector alchemy_selectbox",
6
6
  :onchange => "jQuery('#page_anchor').val(value)",
7
- :title => t("choose_element_as_target")
7
+ :title => t("choose_element_as_target"),
8
+ :autofocus => true
8
9
  ) %>
@@ -17,7 +17,7 @@
17
17
  'name',
18
18
  @page.can_have_cells? ? grouped_elements_for_select(@elements) : elements_for_select(@elements),
19
19
  { :prompt => t('select_element') },
20
- { :class => "alchemy_selectbox" }
20
+ { :class => "alchemy_selectbox", :autofocus => true }
21
21
  ) -%>
22
22
  </td>
23
23
  </tr>
@@ -1,27 +1,23 @@
1
1
  <%- max_image_count = options[:maximum_amount_of_images] || options[:max_images] -%>
2
- <div class="content_editor">
2
+ <div class="content_editor picture_gallery_editor">
3
3
  <label><%= t("picture_gallery_editor.#{element.name}", :default => t('picture_gallery_editor')) %></label>
4
4
  <div class="picture_gallery_images" id="element_<%= element.id %>_contents">
5
- <%- picture_contents.each do |picture_content| -%>
6
- <%= render_essence_editor(picture_content, {
7
- :dragable => (picture_contents.size > 1)
8
- }.merge(options)) %>
5
+ <%- pictures.each do |picture| -%>
6
+ <%= render_essence_editor(picture, {:dragable => (pictures.size > 1)}.merge(options)) %>
9
7
  <%- end -%>
10
- <%- if max_image_count.blank? || picture_contents.length < max_image_count.to_i -%>
8
+ <%- if max_image_count.blank? || pictures.length < max_image_count.to_i -%>
11
9
  <%= render(
12
- :partial => 'alchemy/admin/elements/add_content',
10
+ :partial => 'alchemy/admin/elements/add_picture',
13
11
  :locals => {
14
12
  :element => element,
15
- :essence_type => "Alchemy::EssencePicture",
16
- :link_text => t("add_image_to_element"),
17
13
  :options => options,
18
- :dragable => (picture_contents.size > 1)
14
+ :dragable => (pictures.size > 1)
19
15
  }
20
16
  ) %>
21
17
  <%- end -%>
22
18
  </div>
23
19
  </div>
24
- <%- if picture_contents.size > 1 -%>
20
+ <%- if pictures.size > 1 -%>
25
21
  <script type="text/javascript" charset="utf-8">
26
22
  Alchemy.SortableContents('#element_<%= element.id %>_contents', '<%= form_authenticity_token %>');
27
23
  </script>
@@ -0,0 +1,46 @@
1
+ (function($) {
2
+
3
+ var $el = $('.element_editor[data-element-id="<%= @element.id %>"]');
4
+
5
+ function removeTinyMCEs(ids) {
6
+ for (var i = ids.length - 1; i >= 0; i--) {
7
+ tinymce.get(ids[i]).remove();
8
+ };
9
+ }
10
+
11
+ <% if @error %>
12
+
13
+ $("#element_<%= @element.id -%>_folder_spinner").replaceWith("<span class='error_icon' title='<%= @error -%>'>!</span>");
14
+
15
+ <% else %>
16
+
17
+ $el.replaceWith('<%= escape_javascript render(:partial => "element", :object => @element) -%>');
18
+ $el = $('#element_<%= @element.id %>');
19
+ $('#element_area .sortable_cell').sortable('refresh');
20
+ Alchemy.ElementEditorSelector.reinit($el);
21
+
22
+ <% if @element.folded %>
23
+
24
+ <% if @element.rtf_contents.any? %>
25
+ removeTinyMCEs(<%=raw @element.rtf_contents.collect(&:form_field_id).to_json %>);
26
+ <% end %>
27
+
28
+ <% else %>
29
+
30
+ $el.trigger('Alchemy.SelectElementEditor');
31
+ Alchemy.SelectBox($el);
32
+
33
+ <% @element.rtf_contents.each do |content| %>
34
+ Alchemy.Tinymce.addEditor('<%= content.form_field_id -%>');
35
+ <% end %>
36
+
37
+ Alchemy.ElementDirtyObserver($el);
38
+ Alchemy.Datepicker('input[type="date"]', $el);
39
+ Alchemy.ButtonObserver('button.button', $el);
40
+ Alchemy.overlayObserver("#element_<%= @element.id -%>");
41
+
42
+ <% end %>
43
+
44
+ <% end %>
45
+
46
+ })(jQuery);
@@ -1,28 +1,28 @@
1
1
  <div id="element_area">
2
- <% if @cells.any? -%>
3
- <div id="cells">
4
- <ul>
2
+ <% if @cells.any? %>
3
+ <div id="cells">
4
+ <ul>
5
+ <li><a href="#cell_for_other_elements"><%= t(:main_content) %></a></li>
6
+ <% @elements.each do |cell, elements| %>
7
+ <li>
8
+ <a href="#cell_<%= cell.name %>">
9
+ <%= t(cell.name, :scope => :cell_names) %>
10
+ </a>
11
+ </li>
12
+ <% end %>
13
+ </ul>
14
+ <div id="cell_for_other_elements" class="sortable_cell for_other_elements_cell">
15
+ <%= render :partial => 'alchemy/admin/elements/element', :collection => @page.elements.not_trashed.not_in_cell, :locals => {:draggable => true} %>
16
+ </div>
5
17
  <% @elements.each do |cell, elements| -%>
6
- <% if elements.any? -%>
7
- <li>
8
- <a href="#cell_<%= cell.name -%>">
9
- <%= cell.name == 'for_other_elements' ? t(:main_content) : t(cell.name, :scope => :cell_names) -%>
10
- </a>
11
- </li>
12
- <% end -%>
13
- <% end -%>
14
- </ul>
15
- <% @elements.each do |cell, elements| -%>
16
- <% if elements.any? -%>
17
- <div id="cell_<%= cell.name %>" class="sortable_cell <%= cell.name %>_cell" data-cell-id="<%= cell.id %>">
18
- <%= render :partial => 'alchemy/admin/elements/element', :collection => elements, :locals => {:draggable => true} %>
18
+ <div id="cell_<%= cell.name %>" class="sortable_cell <%= cell.name %>_cell" data-cell-id="<%= cell.id %>">
19
+ <%= render :partial => 'alchemy/admin/elements/element', :collection => elements, :locals => {:draggable => true} %>
20
+ </div>
21
+ <% end %>
19
22
  </div>
20
- <% end -%>
21
- <% end -%>
22
- </div>
23
- <% else -%>
24
- <div class="sortable_cell for_other_elements_cell" id="cell_for_other_elements">
25
- <%= render :partial => 'alchemy/admin/elements/element', :collection => @elements, :locals => {:draggable => true} %>
26
- </div>
27
- <% end -%>
23
+ <% else %>
24
+ <div class="sortable_cell for_other_elements_cell" id="cell_for_other_elements">
25
+ <%= render :partial => 'alchemy/admin/elements/element', :collection => @elements, :locals => {:draggable => true} %>
26
+ </div>
27
+ <% end %>
28
28
  </div>
@@ -1,20 +1,22 @@
1
1
  (function($) {
2
2
 
3
- $('#elements_for_page_<%= @page_id -%>').html('<%= escape_javascript(
4
- render("elements_select")
5
- ) %>');
6
- $('#elements_for_page_<%= @page_id -%>')
7
- .append('<a class=\"close_elements_from_page_selector\" title=\"<%= t("remove") -%>\">–</a>')
8
- .click(function(){
9
- Alchemy.LinkOverlay.hideElementsSelect(<%= @page_id -%>);
10
- });
3
+ var close = $('<a class="close_elements_from_page_selector" title="<%= t(:remove) -%>">–</a>');
4
+ $('#elements_for_page_<%= @page_id -%>').html('<%= escape_javascript(render("elements_select")) %>');
5
+ $('#elements_for_page_<%= @page_id -%>').append(close);
6
+
7
+ close.on('click', function() {
8
+ Alchemy.LinkOverlay.hideElementsSelect(<%= @page_id -%>);
9
+ });
10
+
11
11
  <%- unless @elements.first.blank? -%>
12
12
  $('#page_anchor').val('#<%= @elements.first.dom_id -%>');
13
13
  <%- end -%>
14
+
14
15
  <%- if params[:internal_anchor] -%>
15
16
  $('select.elements_from_page_selector').val('#<%= params[:internal_anchor] -%>');
16
17
  $('#page_anchor').val('#<%= params[:internal_anchor] -%>');
17
18
  <%- end -%>
18
- Alchemy.SelectBox('#alchemyLinkOverlay select.elements_from_page_selector');
19
+
20
+ Alchemy.SelectBox('#alchemyLinkOverlay');
19
21
 
20
22
  })(jQuery);
@@ -1,8 +1,10 @@
1
1
  (function($) {
2
2
 
3
+ var $el = $('#element_<%= @content.element.id %>');
3
4
  $('#<%= content_dom_id(@content) %>').replaceWith('<%= escape_javascript(render(:partial => "alchemy/essences/essence_file_editor", :formats => [:html], :locals => {:content => @content, :options => @options})) %>');
4
5
  Alchemy.closeCurrentWindow();
5
6
  Alchemy.reloadPreview();
6
- Alchemy.setElementDirty('#element_<%= @content.element.id %>');
7
+ Alchemy.setElementDirty($el);
8
+ Alchemy.overlayObserver($el);
7
9
 
8
10
  })(jQuery);
@@ -0,0 +1,28 @@
1
+ (function() {
2
+ var $picture_editor;
3
+
4
+ $('#essence_picture_<%= @content_id -%>').remove();
5
+
6
+ <% if max_image_count.present? && @essence_pictures.length < max_image_count.to_i %>
7
+
8
+ $picture_editor = $('#element_<%= @element.id -%>_contents');
9
+
10
+ if ($('div.add_picture', $picture_editor).length === 0) {
11
+ $('#element_<%= @element.id -%>_contents').append('<%= escape_javascript(
12
+ render(
13
+ :partial => "alchemy/admin/elements/add_picture",
14
+ :locals => {
15
+ :element => @element,
16
+ :options => @options
17
+ }
18
+ )
19
+ ) %>');
20
+ }
21
+
22
+ <% end %>
23
+
24
+ Alchemy.SortableContents('#element_<%= @element.id -%>_contents', '<%= form_authenticity_token -%>');
25
+ Alchemy.reloadPreview();
26
+ Alchemy.pleaseWaitOverlay(false);
27
+
28
+ })()
@@ -50,11 +50,13 @@
50
50
  <%= text_field_tag "contactform_link_title", {}, :class => 'thin_border auto_resize link_title' %>
51
51
  </td>
52
52
  </tr>
53
+ <tr>
54
+ <td class="submit" colspan="2">
55
+ <%= link_to(t(:apply), '#', {
56
+ :onclick => "Alchemy.LinkOverlay.createLink('contact', jQuery('#contactform_url').val() + '?subject=' + encodeURIComponent(jQuery('#contactform_subject').val()) + '&mail_to=' + encodeURIComponent(jQuery('#contactform_mailto').val()) + '&body=' + encodeURIComponent(jQuery('#contactform_body').val()), jQuery('#contactform_link_title').val(), null); Alchemy.LinkOverlay.close()",
57
+ :class => 'button'
58
+ }) %>
59
+ </td>
60
+ </tr>
53
61
  </table>
54
- <p>
55
- <%= link_to(t(:apply), '#', {
56
- :onclick => "Alchemy.LinkOverlay.createLink('contact', jQuery('#contactform_url').val() + '?subject=' + encodeURIComponent(jQuery('#contactform_subject').val()) + '&mail_to=' + encodeURIComponent(jQuery('#contactform_mailto').val()) + '&body=' + encodeURIComponent(jQuery('#contactform_body').val()), jQuery('#contactform_link_title').val(), null); Alchemy.LinkOverlay.close()",
57
- :class => 'button'
58
- }) %>
59
- </p>
60
62
  </div>
@@ -19,17 +19,19 @@
19
19
  </tr>
20
20
  <tr>
21
21
  <td class="label long">
22
- <label for="link_target"><%= t("Open Link in") %>:</label>
22
+ <label for="external_link_target"><%= t("Open Link in") %>:</label>
23
23
  </td>
24
- <td>
25
- <%= select_tag 'link_target', options_for_select(@link_target_options), :class => 'alchemy_selectbox link_target medium' %>
24
+ <td class="select left">
25
+ <%= select_tag 'external_link_target', options_for_select(Alchemy::Page.link_target_options), :class => 'alchemy_selectbox link_target medium' %>
26
+ </td>
27
+ </tr>
28
+ <tr>
29
+ <td class="submit" colspan="2">
30
+ <%= link_to(t(:apply), '#', {
31
+ :onclick => "Alchemy.LinkOverlay.createLink('external', jQuery('#external_url').val(), jQuery('#extern_link_title').val(), jQuery('#external_link_target').val()); Alchemy.LinkOverlay.close()",
32
+ :class => 'button'
33
+ }) %>
26
34
  </td>
27
35
  </tr>
28
36
  </table>
29
- <p>
30
- <%= link_to(t(:apply), '#', {
31
- :onclick => "Alchemy.LinkOverlay.createLink('external', jQuery('#external_url').val(), jQuery('#extern_link_title').val(), jQuery('#link_target').val()); Alchemy.LinkOverlay.close()",
32
- :class => 'button'
33
- }) %>
34
- </p>
35
37
  </div>
@@ -29,15 +29,17 @@
29
29
  <td class="label long">
30
30
  <label for="file_link_target"><%= t("Open Link in") %>:</label>
31
31
  </td>
32
- <td>
33
- <%= select_tag 'file_link_target', options_for_select(@link_target_options), :class => 'alchemy_selectbox link_target medium' %>
32
+ <td class="select left">
33
+ <%= select_tag 'file_link_target', options_for_select(Alchemy::Page.link_target_options), :class => 'alchemy_selectbox link_target medium' %>
34
+ </td>
35
+ </tr>
36
+ <tr>
37
+ <td class="submit" colspan="2">
38
+ <%= link_to(t(:apply), '#', {
39
+ :onclick => "Alchemy.LinkOverlay.createLink('file', jQuery('#public_filename').val(), jQuery('#file_link_title').val(), jQuery('#file_link_target').val()); Alchemy.LinkOverlay.close()",
40
+ :class => 'button'
41
+ }) %>
34
42
  </td>
35
43
  </tr>
36
44
  </table>
37
- <p>
38
- <%= link_to(t(:apply), '#', {
39
- :onclick => "Alchemy.LinkOverlay.createLink('file', jQuery('#public_filename').val(), jQuery('#file_link_title').val(), jQuery('#file_link_target').val()); Alchemy.LinkOverlay.close()",
40
- :class => 'button'
41
- }) %>
42
- </p>
43
45
  </div>
@@ -4,9 +4,11 @@
4
4
  <tr>
5
5
  <td colspan="2">
6
6
  <div id="page_selector_container">
7
+ <% if @page_root %>
7
8
  <ul id="sitemap">
8
9
  <%= render :partial => 'page_for_links', :object => @page_root, :locals => {:area_name => @area_name} %>
9
10
  </ul>
11
+ <% end %>
10
12
  </div>
11
13
  </td>
12
14
  </tr>
@@ -22,17 +24,19 @@
22
24
  <td class="label long">
23
25
  <label for="internal_link_target"><%= t("Open Link in") %>:</label>
24
26
  </td>
25
- <td>
26
- <%= select_tag 'internal_link_target', options_for_select(@link_target_options), :class => 'alchemy_selectbox link_target medium' %>
27
+ <td class="select left">
28
+ <%= select_tag 'internal_link_target', options_for_select(Alchemy::Page.link_target_options), :class => 'alchemy_selectbox link_target medium' %>
29
+ </td>
30
+ </tr>
31
+ <tr>
32
+ <td class="submit" colspan="2">
33
+ <%= hidden_field_tag(:internal_urlname) %>
34
+ <%= hidden_field_tag(:page_anchor) %>
35
+ <%= link_to(t(:apply), '#', {
36
+ :onclick => "Alchemy.LinkOverlay.createLink('internal', jQuery('#internal_urlname').val() + jQuery('#page_anchor').val(), jQuery('#internal_link_title').val(), jQuery('#internal_link_target').val()); Alchemy.LinkOverlay.close()",
37
+ :class => 'button'
38
+ }) %>
27
39
  </td>
28
40
  </tr>
29
41
  </table>
30
- <p>
31
- <%= hidden_field_tag(:internal_urlname) %>
32
- <%= hidden_field_tag(:page_anchor) %>
33
- <%= link_to(t(:apply), '#', {
34
- :onclick => "Alchemy.LinkOverlay.createLink('internal', jQuery('#internal_urlname').val() + jQuery('#page_anchor').val(), jQuery('#internal_link_title').val(), jQuery('#internal_link_target').val()); Alchemy.LinkOverlay.close()",
35
- :class => 'button'
36
- }) %>
37
- </p>
38
42
  </div>
@@ -8,7 +8,7 @@
8
8
  <%= f.label :page_layout %>
9
9
  </td>
10
10
  <td class="select">
11
- <%= f.select('page_layout', @page_layouts, {}, { :class => 'alchemy_selectbox' }) %>
11
+ <%= f.select('page_layout', @page_layouts, {}, { :class => 'alchemy_selectbox', :autofocus => true }) %>
12
12
  </td>
13
13
  </tr>
14
14
  <tr>
@@ -31,7 +31,7 @@
31
31
  alchemy.configure_admin_page_path(page),
32
32
  {
33
33
  :title => t('edit_page_properties'),
34
- :size => page.redirects_to_external? ? '410x270' : '410x620'
34
+ :size => page.redirects_to_external? ? '410x270' : '410x660'
35
35
  },
36
36
  :class => '',
37
37
  :title => t('edit_page_properties')
@@ -4,17 +4,21 @@
4
4
  <span class="site_status <%= page_for_links.locked ? ' locked' : '' %>" ></span>
5
5
  </div>
6
6
  <div class="sitemap_right_tools">
7
- <%= link_to(
8
- "&nbsp;",
9
- alchemy.list_admin_elements_path(:page_id => page_for_links.id),
10
- :remote => true,
11
- :onclick => "Alchemy.LinkOverlay.selectPage('#{page_for_links.id}', '#{@url_prefix + page_for_links.urlname}'); Alchemy.LinkOverlay.showElementsSelect(#{page_for_links.id});",
12
- :class => "show_elements_to_link",
13
- :title => t('show_elements_from_page')
14
- ) %>
15
- <div id="elements_for_page_<%= page_for_links.id %>" style="display: none" class="elements_for_page">
16
- <%= image_tag("alchemy/ajax_loader.gif", :alt => '') %>
17
- </div>
7
+ <% unless page_for_links.redirects_to_external? %>
8
+ <%= link_to("",
9
+ alchemy.list_admin_elements_path(:page_id => page_for_links.id),
10
+ :remote => true,
11
+ :data => {
12
+ 'page-id' => page_for_links.id,
13
+ :url => @url_prefix + page_for_links.urlname
14
+ },
15
+ :class => "show_elements_to_link",
16
+ :title => t('show_elements_from_page')
17
+ ) %>
18
+ <div id="elements_for_page_<%= page_for_links.id %>" style="display: none" class="elements_for_page">
19
+ <%= image_tag("alchemy/ajax_loader.gif", :alt => '') %>
20
+ </div>
21
+ <% end %>
18
22
  </div>
19
23
  <div class="page_infos">
20
24
  <span class="page_status <%= page_for_links.public ? 'public' : 'not_public' %>" title="<%= page_for_links.public ? t('Page public') : t('Page not public') %>"></span>
@@ -22,16 +26,23 @@
22
26
  <span class="page_status <%= page_for_links.restricted ? 'restricted' : 'not_restricted' %>" title="<%= page_for_links.restricted ? t('Page restricted') : t('Page not restricted') %>"></span>
23
27
  </div>
24
28
  <div class="sitemap_sitename" id="sitemap_sitename_<%= page_for_links.id %>" name="<%= parse_sitemap_name(page_for_links) %>">
25
- <%= link_to(page_for_links.name, '#', {
26
- :onclick => "Alchemy.LinkOverlay.selectPage('#{page_for_links.id}', '#{@url_prefix + page_for_links.urlname}')",
27
- :title => t('page_for_links.choose_page', :name => page_for_links.name),
28
- :class => "sitemap_pagename_link #{cycle('even', 'odd')}"
29
- }) %>
29
+ <% if page_for_links.redirects_to_external? %>
30
+ <span class="sitemap_pagename_link inactive"><%= page_for_links.name %></span>
31
+ <% else %>
32
+ <%= link_to(page_for_links.name, '', {
33
+ :data => {
34
+ 'page-id' => page_for_links.id,
35
+ :url => @url_prefix + page_for_links.urlname
36
+ },
37
+ :title => t('page_for_links.choose_page', :name => page_for_links.name),
38
+ :class => "sitemap_pagename_link #{cycle('even', 'odd')}"
39
+ }) %>
40
+ <% end %>
30
41
  </div>
31
42
  </div>
32
- <%- if !page_for_links.children.empty? -%>
33
- <ul id="page_<%= page_for_links.id %>_children">
34
- <%= render :partial => 'page_for_links', :collection => page_for_links.children, :locals => {:area_name => @area_name} %>
35
- </ul>
36
- <%- end -%>
43
+ <% if !page_for_links.children.empty? %>
44
+ <ul id="page_<%= page_for_links.id %>_children">
45
+ <%= render :partial => 'page_for_links', :collection => page_for_links.children, :locals => {:area_name => @area_name} %>
46
+ </ul>
47
+ <% end %>
37
48
  </li>