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
@@ -0,0 +1,27 @@
1
+ <h2><%= t("Filter by tag") %></h2>
2
+ <ul>
3
+ <% Alchemy::Picture.tag_counts.each do |t| %>
4
+ <% picture_tags = pictures_filtered_by_tag?(t) ? picture_tag_filter(:remove => t) : picture_tag_filter(:add => t) %>
5
+ <%= content_tag 'li', :class => params[:tagged_with].try(:split, ',').try(:include?, t.name) ? 'active' : nil do %>
6
+ <%= link_to(
7
+ "#{t.name} (#{t.count})",
8
+ url_for(
9
+ params.delete_if { |k, v| k == "page" }.merge(
10
+ :action => :index,
11
+ :tagged_with => picture_tags
12
+ )
13
+ ),
14
+ :remote => request.xhr?,
15
+ :class => 'please_wait'
16
+ ) %>
17
+ <% end %>
18
+ <% end %>
19
+ </ul>
20
+ <% if params[:tagged_with].present? %>
21
+ <%= link_to(
22
+ render_icon('delete-small') + t('Remove tag filter'),
23
+ url_for(params.delete_if { |k, v| k == "tagged_with" }.merge(:action => :index)),
24
+ :remote => request.xhr?,
25
+ :class => 'button small with_icon please_wait'
26
+ ) %>
27
+ <% end %>
@@ -1 +1,3 @@
1
- jQuery('#alchemy_window_body').replaceWith('<%= escape_javascript(render(:partial => "archive_overlay")) %>');
1
+ jQuery('#alchemy_window_body').replaceWith('<%= escape_javascript(render(:partial => "archive_overlay")) %>');
2
+ Alchemy.SelectBox('#filter_bar');
3
+ Alchemy.overlayObserver('#alchemy_window_body');
@@ -2,11 +2,10 @@
2
2
  <%- if @while_assigning -%>
3
3
  $('#alchemy_window_body').replaceWith('<%= escape_javascript(render(:partial => "archive_overlay")) -%>');
4
4
  <%- else -%>
5
- $('#picture_archive').html('<%= escape_javascript(render(:partial => "pictures_list")) -%>');
6
- Alchemy.inPlaceEditor({
7
- save_label: "<%= t('save') -%>",
8
- cancel_label: "<%= t('cancel') -%>"
9
- });
5
+ $('#picture_archive').html("<%= escape_javascript(render :partial => 'archive') %>");
6
+ Alchemy.pictureSelector();
7
+ Alchemy.overlayObserver('#picture_archive');
8
+ Alchemy.SelectBox('#filter_bar');
10
9
  <%- end -%>
11
10
  Alchemy.growl('<%= @message -%>');
12
11
  })(jQuery);
@@ -0,0 +1,26 @@
1
+ <%= form_for [:admin, @picture] do |f| %>
2
+ <%= hidden_field_tag :query, params[:query] %>
3
+ <%= hidden_field_tag :size, params[:size] %>
4
+ <%= hidden_field_tag :tagged_with, params[:tagged_with] %>
5
+ <%= hidden_field_tag :filter, params[:filter] %>
6
+ <table>
7
+ <tr>
8
+ <td class="label"><%= f.label :name %></td>
9
+ <td class="input">
10
+ <%= f.text_field :name, :class => "thin_border long" %>
11
+ </td>
12
+ </tr>
13
+ <tr>
14
+ <td class="label"><%= f.label :tag_list %>*</td>
15
+ <td class="input">
16
+ <%= f.text_field :tag_list, :class => "thin_border long" %>
17
+ </td>
18
+ </tr>
19
+ <tr>
20
+ <td class="submit" colspan="2">
21
+ <%= f.button t(:save), :name => nil, :class => 'button' %>
22
+ </td>
23
+ </tr>
24
+ </table>
25
+ <p class="foot_note"><%= t('Please seperate the tags with commata') %></p>
26
+ <% end %>
@@ -0,0 +1,39 @@
1
+ <%= form_tag update_multiple_admin_pictures_path do %>
2
+
3
+ <%= hidden_field_tag :query, params[:query] %>
4
+ <%= hidden_field_tag :size, params[:size] %>
5
+ <%= hidden_field_tag :tagged_with, params[:tagged_with] %>
6
+ <%= hidden_field_tag :filter, params[:filter] %>
7
+
8
+ <% @pictures.each do |pic| %>
9
+ <%= hidden_field_tag "picture_ids[]", pic.id %>
10
+ <% end %>
11
+
12
+ <div class="info">
13
+ <%= render_icon :info %>
14
+ <p><%= t("You are about to edit %{length} pictures at once") % {:length => @pictures.length} %></p>
15
+ </div>
16
+
17
+ <table>
18
+ <tr>
19
+ <td class="label"><%= label_tag :pictures_name, t('Name') %></td>
20
+ <td class="input">
21
+ <%= text_field_tag :pictures_name, nil, :class => "thin_border long" %>
22
+ </td>
23
+ </tr>
24
+ <tr>
25
+ <td class="label"><%= label_tag :pictures_tag_list, t('Tags') %></td>
26
+ <td class="input">
27
+ <%= text_field_tag :pictures_tag_list, @pictures.collect(&:tag_list).flatten.uniq.join(', '), :class => "thin_border long" %>
28
+ </td>
29
+ </tr>
30
+ <tr>
31
+ <td class="submit" colspan="2">
32
+ <%= button_tag t(:save), :name => nil, :class => 'button' %>
33
+ </td>
34
+ </tr>
35
+ </table>
36
+
37
+ <p class="foot_note"><%= t('Please seperate the tags with commata') %></p>
38
+
39
+ <% end %>
@@ -1,83 +1,94 @@
1
- <%- content_for(:toolbar) do -%>
2
- <div id="toolbar_buttons">
3
- <%= toolbar_button(
4
- :icon => 'upload',
5
- :label => t('upload_image'),
6
- :url => alchemy.new_admin_picture_path(:size => @size),
7
- :overlay_options => {
1
+ <% content_for(:toolbar) do %>
2
+ <div id="toolbar_buttons">
3
+ <%= toolbar_button(
4
+ :icon => 'upload',
5
+ :label => t('upload_image'),
6
+ :url => alchemy.new_admin_picture_path(:size => @size),
7
+ :overlay_options => {
8
+ :title => t('upload_image'),
9
+ :size => '540x590'
10
+ },
11
+ :class => 'icon_button',
8
12
  :title => t('upload_image'),
9
- :size => '540x590'
10
- },
11
- :class => 'icon_button',
12
- :title => t('upload_image'),
13
- :if_permitted_to => [:new, :alchemy_admin_pictures]
14
- ) %>
15
- <div class="toolbar_spacer"></div>
16
- <div class="button_with_label">
17
- <%= link_to(
18
- render_icon('zoom-out'),
19
- alchemy.admin_pictures_path({
20
- :size => "small",
21
- :query => params[:query]
22
- }),
23
- :title => t("small_thumbnails"),
24
- :class => "icon_button please_wait"
13
+ :if_permitted_to => [:new, :alchemy_admin_pictures]
25
14
  ) %>
26
- <%= link_to(
27
- render_icon('zoom-equal'),
28
- alchemy.admin_pictures_path({
29
- :size => "medium",
30
- :query => params[:query]
31
- }),
32
- :title => t("medium_thumbnails"),
33
- :class => "icon_button please_wait"
34
- ) %>
35
- <%= link_to(
36
- render_icon('zoom-in'),
37
- alchemy.admin_pictures_path({
38
- :size => "large",
39
- :query => params[:query]
40
- }),
41
- :title => t("big_thumbnails"),
42
- :class => "icon_button please_wait"
43
- ) %>
44
- <label><%= t('Image size') %></label>
45
- <%= hidden_field_tag('size', @size, :id => 'overlay_thumbnails_size') %>
15
+ <div class="toolbar_spacer"></div>
16
+ <div class="button_with_label">
17
+ <%= link_to(
18
+ render_icon('zoom-out'),
19
+ alchemy.admin_pictures_path({
20
+ :size => "small",
21
+ :query => params[:query]
22
+ }),
23
+ :title => t("small_thumbnails"),
24
+ :class => "icon_button please_wait"
25
+ ) %>
26
+ <%= link_to(
27
+ render_icon('zoom-equal'),
28
+ alchemy.admin_pictures_path({
29
+ :size => "medium",
30
+ :query => params[:query]
31
+ }),
32
+ :title => t("medium_thumbnails"),
33
+ :class => "icon_button please_wait"
34
+ ) %>
35
+ <%= link_to(
36
+ render_icon('zoom-in'),
37
+ alchemy.admin_pictures_path({
38
+ :size => "large",
39
+ :query => params[:query]
40
+ }),
41
+ :title => t("big_thumbnails"),
42
+ :class => "icon_button please_wait"
43
+ ) %>
44
+ <label><%= t('Image size') %></label>
45
+ <%= hidden_field_tag('size', @size, :id => 'overlay_thumbnails_size') %>
46
+ </div>
47
+
48
+ <% permitted_to?(:flush, :alchemy_admin_pictures) do %>
49
+ <div class="toolbar_spacer"></div>
50
+ <%= toolbar_button(
51
+ :icon => 'flush',
52
+ :url => alchemy.flush_admin_pictures_path,
53
+ :overlay => false,
54
+ :link_options => {
55
+ :remote => true,
56
+ :method => :post
57
+ },
58
+ :label => t('Flush picture cache'),
59
+ :class => 'icon_button please_wait',
60
+ :title => t('Flush picture cache'),
61
+ :skip_permission_check => true
62
+ ) %>
63
+ <% end %>
64
+ <div class="toolbar_spacer"></div>
65
+ <div class="button_with_label">
66
+ <%= link_to render_icon('select_all'), '', :id => 'select_all_pictures', :class => 'icon_button' %>
67
+ <label><%= t("Select all") %></label>
68
+ </div>
46
69
  </div>
47
70
 
48
- <%- permitted_to?(:flush, :alchemy_admin_pictures) do -%>
49
- <div class="toolbar_spacer"></div>
50
- <%= toolbar_button(
51
- :icon => 'flush',
52
- :url => alchemy.flush_admin_pictures_path,
53
- :overlay => false,
54
- :link_options => {
55
- :remote => true,
56
- :method => :post
57
- },
58
- :label => t('Flush picture cache'),
59
- :class => 'icon_button please_wait',
60
- :title => t('Flush picture cache'),
61
- :skip_permission_check => true
62
- ) %>
63
- <%- end -%>
64
- </div>
65
- <%= render :partial => 'alchemy/admin/partials/search_form' %>
66
- <%- end -%>
71
+ <%= render :partial => 'alchemy/admin/partials/search_form' %>
72
+ <% end %>
67
73
 
68
74
  <div id="picture_archive">
69
- <%= render :partial => 'pictures_list' %>
75
+ <%= render 'archive' %>
70
76
  </div>
71
77
 
72
78
  <%- content_for :javascripts do -%>
73
- <script type="text/javascript" charset="utf-8">
79
+ <script type="text/javascript" charset="utf-8">
80
+
81
+ jQuery(document).ready(function($) {
82
+
83
+ Alchemy.pictureSelector();
84
+
85
+ $('#select_all_pictures').on('click', function(e) {
86
+ $('.picture_tool.select :checkbox').prop('checked', true).change();
87
+ e.preventDefault;
88
+ return false;
89
+ });
74
90
 
75
- jQuery(document).ready(function($) {
76
- Alchemy.inPlaceEditor({
77
- save_label: "<%= t('save') %>",
78
- cancel_label: "<%= t('cancel') %>"
79
91
  });
80
- });
81
92
 
82
- </script>
93
+ </script>
83
94
  <%- end -%>
@@ -0,0 +1,3 @@
1
+ Alchemy.pleaseWaitOverlay(false);
2
+ jQuery('#archive_all').html('<%= escape_javascript(render(:partial => "archive")) %>');
3
+ jQuery('#filter_bar').replaceWith('<%= escape_javascript(render(:partial => "filter_bar")) %>');
@@ -8,4 +8,5 @@
8
8
  :item_type => t('images')
9
9
  }
10
10
  ) %>
11
+ <%= f.submit :upload, :style => 'display: none' %>
11
12
  <% end %>
@@ -17,4 +17,6 @@
17
17
  :search_url => resources_path
18
18
  ) -%>
19
19
 
20
- <%= render 'table' %>
20
+ <div id="archive_all">
21
+ <%= render 'table' %>
22
+ </div>
@@ -1,7 +1,7 @@
1
1
  <table>
2
2
  <tr>
3
3
  <td class="label"><%= f.label 'gender' %></td>
4
- <td class="select"><%= f.select 'gender', options_for_select(@user_genders, @user.gender), {:prompt => t('Please choose')}, :class => 'alchemy_selectbox' -%></td>
4
+ <td class="select"><%= f.select 'gender', options_for_select(@user_genders, @user.gender), {:prompt => t('Please choose')}, :class => 'alchemy_selectbox', :autofocus => true -%></td>
5
5
  </tr>
6
6
  <tr>
7
7
  <td class="label"><%= f.label 'firstname' %></td>
@@ -13,29 +13,33 @@
13
13
  ]
14
14
  ) %>
15
15
 
16
- <%- if @users.any? -%>
17
- <table class="list" id="user_list">
18
- <tr>
19
- <th class="icon"></th>
20
- <th class="login_status"></th>
21
- <th class="login"><%= Alchemy::User.human_attribute_name('login') %></th>
22
- <th class="name"><%= Alchemy::User.human_attribute_name('firstname') %></th>
23
- <th><%= Alchemy::User.human_attribute_name('lastname') %></th>
24
- <th class="email"><%= Alchemy::User.human_attribute_name('email') %></th>
25
- <th><%= Alchemy::User.human_attribute_name('language') %></th>
26
- <th><%= Alchemy::User.human_attribute_name('last_login_at') %></th>
27
- <th class="role"><%= Alchemy::User.human_attribute_name('role') %></th>
28
- <th class="tools"></th>
29
- </tr>
30
- <%= render :partial => 'alchemy/admin/users/user', :collection => @users %>
31
- </table>
32
- <%= paginate @users %>
16
+ <div id="archive_all">
17
+ <% if @users.any? %>
33
18
 
34
- <%- elsif params[:query] -%>
19
+ <table class="list" id="user_list">
20
+ <tr>
21
+ <th class="icon"></th>
22
+ <th class="login_status"></th>
23
+ <th class="login"><%= Alchemy::User.human_attribute_name('login') %></th>
24
+ <th class="name"><%= Alchemy::User.human_attribute_name('firstname') %></th>
25
+ <th><%= Alchemy::User.human_attribute_name('lastname') %></th>
26
+ <th class="email"><%= Alchemy::User.human_attribute_name('email') %></th>
27
+ <th><%= Alchemy::User.human_attribute_name('language') %></th>
28
+ <th><%= Alchemy::User.human_attribute_name('last_login_at') %></th>
29
+ <th class="role"><%= Alchemy::User.human_attribute_name('role') %></th>
30
+ <th class="tools"></th>
31
+ </tr>
32
+ <%= render :partial => 'alchemy/admin/users/user', :collection => @users %>
33
+ </table>
35
34
 
36
- <div class="info">
37
- <%= render_icon('info') %>
38
- <%= t('No users found') %>
39
- </div>
35
+ <%= paginate @users %>
36
+
37
+ <% elsif params[:query] %>
40
38
 
41
- <%- end -%>
39
+ <div class="info">
40
+ <%= render_icon('info') %>
41
+ <%= t('No users found') %>
42
+ </div>
43
+
44
+ <% end %>
45
+ </div>
@@ -1,6 +1,11 @@
1
1
  <%= render_essence_editor_by_name(element, 'intro') %>
2
- <%= render_picture_editor(element, :maximum_amount_of_images => 1, :image_size => "450x300", :crop => true, :image_float_selector => true, :fixed_ratio => false) %>
2
+ <%= render_essence_editor_by_name(element, 'image', {
3
+ :image_size => "450x300",
4
+ :crop => true,
5
+ :image_float_selector => true,
6
+ :fixed_ratio => false
7
+ }) %>
3
8
  <% element.contents.where(:name => ['headline', 'text']).each do |content| %>
4
9
  <%= render_essence_editor content %>
5
10
  <% end %>
6
- <%= render_new_content_link(element) %>
11
+ <%= render_new_content_link(element) %>
@@ -1 +1 @@
1
- <%= render_picture_editor(element, :image_size => "900x300", :crop => true) %>
1
+ <%= render_essence_editor_by_name(element, 'image', :image_size => "900x300", :crop => true) %>
@@ -1,2 +1,7 @@
1
- <%= render_picture_editor(element, :image_float_selector => true, :image_size => "450x300", :crop => true, :fixed_ratio => false) %>
1
+ <%= render_essence_editor_by_name(element, 'image', {
2
+ :image_float_selector => true,
3
+ :image_size => "450x300",
4
+ :crop => true,
5
+ :fixed_ratio => false
6
+ }) %>
2
7
  <%= render_essence_editor_by_name(element, 'text') %>
@@ -1,7 +1,7 @@
1
1
  <div class="bild_text" id="<%= element_dom_id(element) %>" <%= element_preview_code(element) -%>>
2
- <%- a = element.contents.find_by_essence_type("Alchemy::EssencePicture") -%>
3
- <div class="image <%= a.essence.css_class %>">
4
- <%= render_essence_view(a, :image_size => "450x1000", :crop => true) %>
2
+ <%- image = element.contents.find_by_name("image") -%>
3
+ <div class="image <%= image.essence.css_class %>">
4
+ <%= render_essence_view(image, :image_size => "450x1000", :crop => true) %>
5
5
  </div>
6
6
  <div class="text">
7
7
  <%= render_essence_view_by_name(element, 'text') %>
@@ -1,3 +1,3 @@
1
- <%= render_picture_editor(element, :image_size => '300x200', :crop => true) %>
1
+ <%= render_picture_gallery_editor(element, :image_size => '300x200', :crop => true) %>
2
2
  <%= render_essence_editor_by_name(element, 'caption') %>
3
3
  <%= render_essence_editor_by_name(element, 'show_caption', :default_value => true) %>
@@ -1,8 +1,8 @@
1
1
  <div class="image_mosaic" id="<%= element_dom_id(element) %>" <%= element_preview_code(element) -%>>
2
2
  <div class="image_mosaic_images">
3
- <%- element.contents.find_all_by_essence_type("Alchemy::EssencePicture").each do |essence| -%>
3
+ <%- element.contents.gallery_pictures.each do |image| -%>
4
4
  <div class="image_mosaic_image">
5
- <%= render_essence_view(essence, :image_size => '300x200', :crop => true) %>
5
+ <%= render_essence_view(image, :image_size => '300x200', :crop => true) %>
6
6
  </div>
7
7
  <%- end -%>
8
8
  </div>
@@ -3,10 +3,10 @@
3
3
  <%= render_essence_view_by_name(element, 'headline') %>
4
4
  </h1>
5
5
  <div class="text_bild_container">
6
- <%- content = element.contents.find_by_essence_type("Alchemy::EssencePicture") -%>
7
- <%- if content -%>
8
- <div class="image <%= content.essence.css_class %>">
9
- <%= render_essence_view(content, :image_size => "450x300", :crop => true) %>
6
+ <%- image = element.contents.essence_pictures.first -%>
7
+ <%- if image -%>
8
+ <div class="image <%= image.essence.css_class %>">
9
+ <%= render_essence_view(image, :image_size => "450x300", :crop => true) %>
10
10
  </div>
11
11
  <%- end -%>
12
12
  <div class="text">
@@ -1 +1,4 @@
1
- <p><%= t(:searchresults_editor_info) %></p>
1
+ <div class="info">
2
+ <%= render_icon('info') %>
3
+ <%= t(:searchresults_editor_info) %>
4
+ </div>