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
@@ -29,7 +29,7 @@
29
29
  <%- end -%>
30
30
  <tr>
31
31
  <td class="label"><%= f.label "name" %>: </td>
32
- <td class="input"><%= f.text_field "name", :size => 31, :class => "thin_border long" %></td>
32
+ <td class="input"><%= f.text_field "name", :size => 31, :class => "thin_border long", :autofocus => true %></td>
33
33
  </tr>
34
34
  <%- unless @page.layoutpage -%>
35
35
  <tr>
@@ -64,7 +64,7 @@
64
64
  </tr>
65
65
  <%- end -%>
66
66
  <tr>
67
- <td colspan="2" align="right"><%= f.button t("save"), :class => 'button' %></td>
67
+ <td colspan="2" class="right"><%= f.button t("save"), :class => 'button' %></td>
68
68
  </tr>
69
69
  </table>
70
70
  <p class="foot_note">
@@ -2,14 +2,14 @@
2
2
  <div id="errors" style="display:none"></div>
3
3
  <table id="page_names">
4
4
  <tr>
5
- <td><%= t("page_type") %>: </td>
6
- <td>
7
- <%= @page.layout_display_name %>
5
+ <td class="label"><%= t("page_type") %>: </td>
6
+ <td class="value long">
7
+ <p><%= @page.layout_display_name %></p>
8
8
  </td>
9
9
  </tr>
10
10
  <tr>
11
- <td><%= t("page_status") %>: </td>
12
- <td>
11
+ <td class="label"><%= t("page_status") %>: </td>
12
+ <td class="checkbox long">
13
13
  <%= f.check_box :visible -%>
14
14
  <%= f.label :visible %><br/>
15
15
  <%- if configuration(:sitemap)[:show_flag] -%><br/>
@@ -19,22 +19,22 @@
19
19
  </td>
20
20
  </tr>
21
21
  <tr>
22
- <td colspan="2"><strong><%= t("names") %></strong></td>
22
+ <td colspan="2" class="heading"><%= t("names") %></td>
23
23
  </tr>
24
24
  <tr>
25
- <td><%= f.label "name" %>:&nbsp;</td>
26
- <td><%= f.text_field( "name", :size => 31, :class => "thin_border long") %></td>
25
+ <td class="label"><%= f.label "name" %>:&nbsp;</td>
26
+ <td class="input"><%= f.text_field( "name", :size => 31, :class => "thin_border long") %></td>
27
27
  </tr>
28
28
  <tr>
29
- <td><%= f.label "urlname" %>: </td>
30
- <td><%= f.text_field "urlname", :size => 31, :class => "thin_border long" %></td>
29
+ <td class="label"><%= f.label "urlname" %>: </td>
30
+ <td class="input"><%= f.text_field "urlname", :size => 31, :class => "thin_border long" %></td>
31
31
  </tr>
32
32
  <tr>
33
- <td><%= f.label "title" %>: </td>
34
- <td><%= f.text_field "title", :size => 31, :class => "thin_border long" %></td>
33
+ <td class="label"><%= f.label "title" %>: </td>
34
+ <td class="input"><%= f.text_field "title", :size => 31, :class => "thin_border long" %></td>
35
35
  </tr>
36
36
  <tr>
37
- <td colspan="2" align="right"><%= f.button t("save"), :class => 'button' %></td>
37
+ <td colspan="2" class="submit"><%= f.button t("save"), :class => 'button' %></td>
38
38
  </tr>
39
39
  </table>
40
40
  <% end %>
@@ -48,7 +48,7 @@
48
48
  alchemy.configure_admin_page_path(@page),
49
49
  {
50
50
  :title => t('edit_page_properties'),
51
- :size => @page.layoutpage? ? '340x150' : '410x620'
51
+ :size => @page.layoutpage? ? '340x150' : '410x660'
52
52
  },
53
53
  :class => :icon_button,
54
54
  :title => t('edit_page_properties')
@@ -150,7 +150,7 @@
150
150
  }, function() {
151
151
  Alchemy.SortableElements(<%= @page.id %>, '<%= form_authenticity_token %>');
152
152
  Alchemy.ElementEditorSelector.init();
153
- Alchemy.SelectBox('.element_editor select');
153
+ Alchemy.SelectBox('.element_editor');
154
154
  Alchemy.Tinymce.init(function() {
155
155
  Alchemy.ElementDirtyObserver('#element_area');
156
156
  });
@@ -64,37 +64,39 @@
64
64
  </div>
65
65
  <%- end -%>
66
66
 
67
+ <div id="archive_all">
67
68
  <%- if @page_root -%>
68
69
 
69
- <div id="sort_panel" style="display: none">
70
- <div class="info">
71
- <%= render_icon('info') %>
72
- <%= t('explain_sitemap_dragndrop_sorting') %>
70
+ <div id="sort_panel" style="display: none">
71
+ <div class="info">
72
+ <%= render_icon('info') %>
73
+ <%= t('explain_sitemap_dragndrop_sorting') %>
74
+ </div>
75
+ <div class="buttons">
76
+ <%= link_to( t('cancel'), alchemy.admin_pages_path, :class => 'button' ) %>&nbsp;
77
+ <%= submit_tag( t('save order'), :id => 'save_page_order', :class => 'button' ) %>
78
+ </div>
73
79
  </div>
74
- <div class="buttons">
75
- <%= link_to( t('cancel'), alchemy.admin_pages_path, :class => 'button' ) %>&nbsp;
76
- <%= submit_tag( t('save order'), :id => 'save_page_order', :class => 'button' ) %>
77
- </div>
78
- </div>
79
80
 
80
- <h2 id="sitemap_heading">
81
- <span class="page_name"><%= t('Name') %></span>
82
- <span class="page_infos"><%= t('Status') %></span>
83
- </h2>
81
+ <h2 id="sitemap_heading">
82
+ <span class="page_name"><%= t('Name') %></span>
83
+ <span class="page_infos"><%= t('Status') %></span>
84
+ </h2>
84
85
 
85
- <%= render :partial => 'sitemap' %>
86
+ <%= render :partial => 'sitemap' %>
86
87
 
87
88
  <%- else -%>
88
89
 
89
- <%= render :partial => 'create_language_form' %>
90
- <% content_for(:javascripts) do %>
91
- <script type="text/javascript">
92
- jQuery(document).ready(function($) {
93
- $('#create_language_tree_form').dialog({modal: true, width: 360, close: function() {
94
- $(this).appendTo('#archive_all').show().removeClass().removeAttr('style');
95
- }});
96
- });
97
- </script>
98
- <%- end -%>
90
+ <%= render :partial => 'create_language_form' %>
91
+ <% content_for(:javascripts) do %>
92
+ <script type="text/javascript">
93
+ jQuery(document).ready(function($) {
94
+ $('#create_language_tree_form').dialog({modal: true, width: 360, close: function() {
95
+ $(this).appendTo('#archive_all').show().removeClass().removeAttr('style');
96
+ }});
97
+ });
98
+ </script>
99
+ <%- end -%>
99
100
 
100
101
  <% end -%>
102
+ </div>
@@ -18,13 +18,10 @@
18
18
  </div>
19
19
 
20
20
  <script type="text/javascript" charset="utf-8">
21
-
22
- jQuery(function() {
23
- jQuery( "#overlay_tabs" ).tabs();
21
+ jQuery(function($) {
22
+ $( "#overlay_tabs" ).tabs();
24
23
  });
25
-
26
24
  if (Alchemy.LinkOverlay.current.linked_element) {
27
25
  Alchemy.LinkOverlay.selectTab();
28
26
  }
29
-
30
27
  </script>
@@ -8,7 +8,7 @@
8
8
  <li id="explain_drag_n_drop"><%= t('explain_upload.dragndrop', :name => item_type) %></li>
9
9
  </ol>
10
10
  <%- unless file_types.first == '*' -%>
11
- <p><%= t('You may upload files with following extensions', :file_types_description => file_types_description, :file_types => file_types.to_sentence) %>.</p>
11
+ <p><%= t('You may upload files with following extensions', :file_types_description => file_types_description, :file_types => file_types.to_sentence) %>.</p>
12
12
  <%- end -%>
13
13
  <small>*<%= t('explain_upload.footnote', :name => item_type) %></small>
14
14
  </div>
@@ -16,7 +16,8 @@
16
16
  <%= render 'alchemy/admin/partials/flash_upload' %>
17
17
 
18
18
  <div class="browse">
19
- <input id="multiple" type="file" multiple value="<%= t('browse') %>">
19
+ <%= label_tag :multiple, t('browse'), :style => 'display:none;' %>
20
+ <input name="Filedata" id="multiple" type="file" multiple value="<%= t('browse') %>">
20
21
  <a href="#" class="button no-spinner" id="cancelHTML5Queue" style="display: none">
21
22
  <%= t("swfupload.cancel_uploads") %>
22
23
  </a>
@@ -36,20 +37,35 @@
36
37
  :content_id => @content.blank? ? nil : @content.id,
37
38
  :element_id => @element.blank? ? nil : @element.id,
38
39
  :size => @size,
40
+ :upload_hash => Time.now.hash,
39
41
  :options => @options.to_param
40
- }.delete_if { |k,v| v.nil? }.to_json -%>
42
+ }.delete_if { |k, v| v.nil? }.to_json -%>
41
43
 
42
44
  <script type='text/javascript'>
43
45
 
44
- Alchemy.Uploader.init({
45
- upload_url: '<%= new_asset_path_with_session_information(model_name) %>',
46
- post_params: <%= post_params.html_safe %>,
47
- file_size_limit: <%= configuration(:uploader)['file_size_limit'] || 100 -%>,
48
- file_types: '<%= file_types.map{ |f| "*.#{f}" }.join(";") %>',
49
- file_types_description: "<%= file_types_description %>",
50
- file_upload_limit: <%= configuration(:uploader)['upload_limit'] || 50 -%>,
51
- locale: "<%= ::I18n.locale || 'en' %>"
52
- });
46
+ (function() {
47
+ var options = {
48
+ upload_url: '<%= new_asset_path_with_session_information(model_name) %>',
49
+ post_params: <%= post_params.html_safe %>,
50
+ file_size_limit: <%= configuration(:uploader)['file_size_limit'] || 100 -%>,
51
+ file_types: '<%= file_types.map{ |f| "*.#{f}" }.join(";") %>',
52
+ file_types_description: "<%= file_types_description %>",
53
+ file_upload_limit: <%= configuration(:uploader)['upload_limit'] || 50 -%>,
54
+ locale: "<%= ::I18n.locale || 'en' %>",
55
+ onQueueComplete: function() {
56
+ <% if @while_assigning && model_name == 'picture' %>
57
+ var url = '<%= alchemy.admin_pictures_path(:size => params[:size], :filter => :last_upload, :element_id => @element.id, :content_id => @content ? @content.id : nil, :options => @options).html_safe %>';
58
+ $.get(url, null, null, 'script');
59
+ <% elsif controller.class.name == 'Alchemy::Admin::PicturesController' %>
60
+ var url = '<%= alchemy.admin_pictures_path(:size => params[:size], :filter => :last_upload).html_safe %>';
61
+ Alchemy.pleaseWaitOverlay();
62
+ window.location = url;
63
+ <% end %>
64
+ }
65
+ };
66
+
67
+ Alchemy.Uploader.init(options);
68
+ })();
53
69
 
54
70
  (function($) {
55
71
  $('#uploadswitcher').click(function() {
@@ -0,0 +1,54 @@
1
+ <div id="library_sidebar">
2
+ <%= render :partial => 'filter_bar' %>
3
+ <div id="tag_list">
4
+ <%= render :partial => 'tag_list' %>
5
+ </div>
6
+ </div>
7
+ <%= form_tag delete_multiple_admin_pictures_path, :method => :delete do %>
8
+ <div class="selected_item_tools">
9
+ <h2><%= t("edit_selected_pictures") %></h2>
10
+ <%= link_to(
11
+ render_icon('edit') + t("Edit"),
12
+ edit_multiple_admin_pictures_path,
13
+ :class => 'button with_icon',
14
+ :title => t('Edit multiple pictures'),
15
+ :id => 'edit_multiple_pictures',
16
+ :style => 'float: none'
17
+ ) %>
18
+ <%= button_tag render_icon('destroy') + t("Delete"), 'data-alchemy-confirm' => {
19
+ :title => t("please_confirm"),
20
+ :message => t("confirm_to_delete_images_from_server"),
21
+ :okLabel => t("Yes"),
22
+ :cancelLabel => t("No")
23
+ }.to_json, :class => 'button with_icon' %>
24
+ &nbsp;<%= t('or') %>&nbsp;
25
+ <%= link_to(
26
+ render_icon('delete-small') + t("Clear selection"),
27
+ admin_pictures_path(
28
+ :query => params[:query],
29
+ :tagged_with => params[:tagged_with],
30
+ :size => params[:size],
31
+ :filter => params[:filter]
32
+ ),
33
+ :class => 'button with_icon',
34
+ :style => 'float: none'
35
+ ) %>
36
+ </div>
37
+ <%= content_tag :h3, t("picture_library.filter.#{params[:filter]}") if params[:filter].present? %>
38
+ <div id="pictures">
39
+ <% if @pictures.blank? and @recent_pictures.blank? and params[:query].nil? %>
40
+ <div class="info">
41
+ <%= render_icon('info') %>
42
+ <%= t("no_images_in_archive") %>
43
+ </div>
44
+ <% elsif @pictures.blank? and @recent_pictures.blank? %>
45
+ <div class="info">
46
+ <%= render_icon('info') %>
47
+ <%= t("no_search_results") %>
48
+ </div>
49
+ <% else %>
50
+ <%= render :partial => 'picture', :collection => @pictures %>
51
+ <%= paginate @pictures %>
52
+ <% end %>
53
+ </div>
54
+ <% end %>
@@ -1,13 +1,16 @@
1
1
  <div id="alchemy_window_body">
2
2
  <div id="overlay_toolbar">
3
- <%= render :partial => 'filter_and_size_bar' %>
3
+ <%= render 'filter_and_size_bar' %>
4
4
  </div>
5
5
  <div id="assign_image_list" class="with_padding">
6
- <% if @pictures.empty? -%>
7
- <p><%= t("no_images_in_archive") %></p>
8
- <% else -%>
9
- <%= render :partial => "picture_to_assign", :collection => @pictures, :locals => {:options => @options, :size => @size} %>
10
- <%= paginate @pictures, :remote => true %>
11
- <% end -%>
6
+ <div id="library_sidebar">
7
+ <%= render 'filter_bar' %>
8
+ <div id="tag_list">
9
+ <%= render 'tag_list' %>
10
+ </div>
11
+ </div>
12
+ <div id="overlay_picture_list">
13
+ <%= render 'overlay_picture_list' %>
14
+ </div>
12
15
  </div>
13
16
  </div>
@@ -47,27 +47,26 @@
47
47
  </div>
48
48
  <div class="toolbar_spacer"></div>
49
49
  <div class="button_with_label">
50
- <%= link_to_overlay_window(
51
- render_icon('upload'),
52
- alchemy.new_admin_picture_path(
53
- :element_id => @element.blank? ? nil : @element.id,
54
- :content_id => @content.blank? ? nil : @content.id,
55
- :swap => @swap,
56
- :page => params[:page],
57
- :per_page => params[:per_page],
58
- :size => @size,
59
- :options => @options
60
- ),
61
- {
62
- :size => "540x550",
63
- :title => t('upload_image')
64
- },
65
- {
66
- :class => 'icon_button',
67
- :title => t('upload_image')
68
- }
69
- ) %>
70
- <label><%= t('upload_image') %></label>
50
+ <%= link_to_overlay_window(
51
+ render_icon('upload'),
52
+ alchemy.new_admin_picture_path(
53
+ :element_id => @element.blank? ? nil : @element.id,
54
+ :content_id => @content.blank? ? nil : @content.id,
55
+ :swap => @swap,
56
+ :page => params[:page],
57
+ :size => @size,
58
+ :options => @options
59
+ ),
60
+ {
61
+ :size => "540x550",
62
+ :title => t('upload_image')
63
+ },
64
+ {
65
+ :class => 'icon_button',
66
+ :title => t('upload_image')
67
+ }
68
+ ) %>
69
+ <label><%= t('upload_image') %></label>
71
70
  </div>
72
- <%= render(:partial => 'alchemy/admin/partials/remote_search_form') %>
71
+ <%= render :partial => 'alchemy/admin/partials/remote_search_form' %>
73
72
  </div>
@@ -0,0 +1,31 @@
1
+ <% params_to_keep = [:size, :tagged_with, :query, :element_id, :content_id, :_] %>
2
+
3
+ <div id="filter_bar">
4
+ <h2><%= t('Filter') %></h2>
5
+ <%= select_tag(
6
+ 'picture_filter',
7
+ options_for_select([
8
+ [t("all_pictures"), ''],
9
+ [t("last_upload_only"), 'last_upload'],
10
+ [t("recently_uploaded_only"), 'recent']
11
+ ], params[:filter]),
12
+ :data => { :remote => !!request.xhr? }
13
+ ) %>
14
+ </div>
15
+
16
+ <script type="text/javascript">
17
+ $(function() {
18
+ $('#picture_filter').on('change', function(e) {
19
+ var $this = $(this);
20
+ var url = '<%= alchemy.admin_pictures_path(merge_params_only(params_to_keep)).html_safe %>';
21
+ if ($this.data('remote') === true) {
22
+ $.get(url, {filter: $this.val()}, null, 'script');
23
+ } else {
24
+ Alchemy.pleaseWaitOverlay();
25
+ delimiter = url.match(/\?/) ? '&' : '?';
26
+ window.location = url + delimiter + 'filter=' + $this.val();
27
+ }
28
+ return false;
29
+ });
30
+ });
31
+ </script>
@@ -0,0 +1,9 @@
1
+ <% if @pictures.empty? %>
2
+ <div class="info">
3
+ <%= render_icon('info') %>
4
+ <%= t("no_images_in_archive") %>
5
+ </div>
6
+ <% else %>
7
+ <%= render :partial => "picture_to_assign", :collection => @pictures, :locals => {:options => @options, :size => @size} %>
8
+ <%= paginate @pictures, :remote => true %>
9
+ <% end %>
@@ -1,6 +1,9 @@
1
1
  <div class="picture_thumbnail <%= @size %>" id="picture_<%= picture.id %>" name="<%= picture.name %>">
2
- <%- permitted_to?(:destroy, :alchemy_admin_pictures) do -%>
3
- <span class="picture_tool_delete">
2
+ <span class="picture_tool select">
3
+ <%= check_box_tag "picture_ids[]", picture.id %>
4
+ </span>
5
+ <% permitted_to?(:destroy, :alchemy_admin_pictures) do %>
6
+ <span class="picture_tool delete">
4
7
  <%= link_to_confirmation_window(
5
8
  "",
6
9
  t("confirm_to_delete_image_from_server"),
@@ -8,14 +11,38 @@
8
11
  :id => picture,
9
12
  :query => params[:query],
10
13
  :page => params[:page],
11
- :per_page => params[:per_page]
14
+ :tagged_with => params[:tagged_with],
15
+ :size => params[:size],
16
+ :filter => params[:filter]
12
17
  ),
13
18
  {
14
19
  :title => t('Delete image')
15
20
  }
16
21
  ) -%>
17
22
  </span>
18
- <%- end -%>
23
+ <% end %>
24
+ <% permitted_to?(:edit, :alchemy_admin_pictures) do %>
25
+ <span class="picture_tool edit">
26
+ <%= link_to_overlay_window(
27
+ "",
28
+ alchemy.edit_admin_picture_path(
29
+ :id => picture,
30
+ :query => params[:query],
31
+ :page => params[:page],
32
+ :tagged_with => params[:tagged_with],
33
+ :size => params[:size],
34
+ :filter => params[:filter]
35
+ ),
36
+ {
37
+ :title => t('Edit image'),
38
+ :size => "400x180"
39
+ },
40
+ {
41
+ :title => t('Edit image')
42
+ }
43
+ ) -%>
44
+ </span>
45
+ <% end %>
19
46
  <div class="image_spinner spinner">
20
47
  <%= image_tag("alchemy/image_loader.gif", :alt => '') %>
21
48
  </div>
@@ -29,7 +56,10 @@
29
56
  ),
30
57
  '#',
31
58
  :onclick => "Alchemy.zoomImage('#{show_in_window_admin_picture_path(picture.id)}', '#{picture.name}', #{picture.image_width || 320}, #{picture.image_height || 240})",
32
- :class => 'thumbnail_background'
59
+ :class => 'thumbnail_background',
60
+ :id => 'show_in_window'
33
61
  ) %>
34
- <span class="picture_name<%= ' rename' if permitted_to?(:edit, :alchemy_admin_pictures) -%>" title="<%= permitted_to?(:edit, :alchemy_admin_pictures) ? picture.name + ' (' + t('Click to rename') + ')' : picture.name %>" id="image_picture_<%= picture.id %>_name"><%= picture.name %></span>
62
+ <span class="picture_name" title="<%= picture.name %>" id="image_picture_<%= picture.id %>_name">
63
+ <%= picture.name %>
64
+ </span>
35
65
  </div>