alchemy_cms 3.4.2 → 3.5.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (247) hide show
  1. checksums.yaml +4 -4
  2. data/.codeclimate.yml +9 -3
  3. data/.teatro.yml +1 -0
  4. data/.travis.yml +14 -17
  5. data/CHANGELOG.md +44 -6
  6. data/Gemfile +7 -4
  7. data/README.md +60 -10
  8. data/Rakefile +1 -1
  9. data/alchemy_cms.gemspec +5 -8
  10. data/app/assets/javascripts/alchemy/admin.js +2 -0
  11. data/app/assets/javascripts/alchemy/alchemy.dialog.js.coffee +1 -0
  12. data/app/assets/javascripts/alchemy/alchemy.gui.js.coffee +1 -0
  13. data/app/assets/javascripts/alchemy/alchemy.hotkeys.js.coffee +1 -1
  14. data/app/assets/javascripts/alchemy/alchemy.initializer.js.coffee +9 -7
  15. data/app/assets/javascripts/alchemy/alchemy.link_dialog.js.coffee +1 -0
  16. data/app/assets/javascripts/alchemy/alchemy.preview_window.js.coffee +11 -7
  17. data/app/assets/javascripts/alchemy/alchemy.sitemap.js.coffee +1 -1
  18. data/app/assets/javascripts/alchemy/alchemy.tinymce.js.coffee +8 -3
  19. data/app/assets/javascripts/alchemy/alchemy.tooltips.coffee +10 -0
  20. data/app/assets/javascripts/alchemy/alchemy.uploader.js.coffee +104 -73
  21. data/app/assets/stylesheets/alchemy/_defaults.scss +1 -4
  22. data/app/assets/stylesheets/alchemy/_extends.scss +13 -35
  23. data/app/assets/stylesheets/alchemy/_mixins.scss +82 -18
  24. data/app/assets/stylesheets/alchemy/_variables.scss +21 -8
  25. data/app/assets/stylesheets/alchemy/admin.scss +4 -0
  26. data/app/assets/stylesheets/alchemy/archive.scss +8 -12
  27. data/app/assets/stylesheets/alchemy/attachments.scss +39 -0
  28. data/app/assets/stylesheets/alchemy/base.scss +26 -15
  29. data/app/assets/stylesheets/alchemy/buttons.scss +59 -31
  30. data/app/assets/stylesheets/alchemy/dashboard.scss +3 -3
  31. data/app/assets/stylesheets/alchemy/dialogs.scss +10 -8
  32. data/app/assets/stylesheets/alchemy/elements.scss +65 -41
  33. data/app/assets/stylesheets/alchemy/errors.scss +7 -0
  34. data/app/assets/stylesheets/alchemy/flash.scss +1 -1
  35. data/app/assets/stylesheets/alchemy/form_fields.scss +0 -37
  36. data/app/assets/stylesheets/alchemy/forms.scss +18 -27
  37. data/app/assets/stylesheets/alchemy/frame.scss +104 -204
  38. data/app/assets/stylesheets/alchemy/hints.scss +62 -0
  39. data/app/assets/stylesheets/alchemy/icon-font.scss +2 -1
  40. data/app/assets/stylesheets/alchemy/icons.scss +9 -4
  41. data/app/assets/stylesheets/alchemy/image_library.scss +6 -6
  42. data/app/assets/stylesheets/alchemy/jquery-ui.scss +6 -4
  43. data/app/assets/stylesheets/alchemy/lists.scss +0 -1
  44. data/app/assets/stylesheets/alchemy/menubar.scss +3 -4
  45. data/app/assets/stylesheets/alchemy/modules.scss +0 -6
  46. data/app/assets/stylesheets/alchemy/navigation.scss +242 -0
  47. data/app/assets/stylesheets/alchemy/pagination.scss +3 -3
  48. data/app/assets/stylesheets/alchemy/print.scss +1 -0
  49. data/app/assets/stylesheets/alchemy/resource_info.scss +45 -0
  50. data/app/assets/stylesheets/alchemy/search.scss +72 -1
  51. data/app/assets/stylesheets/alchemy/selects.scss +38 -44
  52. data/app/assets/stylesheets/alchemy/sitemap.scss +89 -79
  53. data/app/assets/stylesheets/alchemy/tables.scss +6 -10
  54. data/app/assets/stylesheets/alchemy/toolbar.scss +7 -36
  55. data/app/assets/stylesheets/alchemy/upload.scss +12 -3
  56. data/app/assets/stylesheets/tinymce/skins/alchemy/content.min.css.scss +6 -3
  57. data/app/assets/stylesheets/tinymce/skins/alchemy/fonts/tinymce-small.svg +58 -170
  58. data/app/assets/stylesheets/tinymce/skins/alchemy/fonts/tinymce-small.ttf +0 -0
  59. data/app/assets/stylesheets/tinymce/skins/alchemy/fonts/tinymce-small.woff +0 -0
  60. data/app/assets/stylesheets/tinymce/skins/alchemy/fonts/tinymce.svg +124 -148
  61. data/app/assets/stylesheets/tinymce/skins/alchemy/fonts/tinymce.ttf +0 -0
  62. data/app/assets/stylesheets/tinymce/skins/alchemy/fonts/tinymce.woff +0 -0
  63. data/app/assets/stylesheets/tinymce/skins/alchemy/skin.min.css.scss +426 -144
  64. data/app/controllers/alchemy/admin/attachments_controller.rb +24 -16
  65. data/app/controllers/alchemy/admin/clipboard_controller.rb +1 -1
  66. data/app/controllers/alchemy/admin/essence_files_controller.rb +1 -1
  67. data/app/controllers/alchemy/admin/essence_pictures_controller.rb +9 -8
  68. data/app/controllers/alchemy/admin/layoutpages_controller.rb +1 -0
  69. data/app/controllers/alchemy/admin/pages_controller.rb +2 -2
  70. data/app/controllers/alchemy/admin/resources_controller.rb +2 -2
  71. data/app/controllers/alchemy/admin/tags_controller.rb +1 -1
  72. data/app/controllers/alchemy/api/pages_controller.rb +16 -0
  73. data/app/controllers/alchemy/messages_controller.rb +1 -1
  74. data/app/controllers/concerns/alchemy/admin/uploader_responses.rb +2 -2
  75. data/app/helpers/alchemy/admin/attachments_helper.rb +11 -0
  76. data/app/helpers/alchemy/admin/base_helper.rb +37 -4
  77. data/app/helpers/alchemy/admin/contents_helper.rb +11 -4
  78. data/app/helpers/alchemy/admin/elements_helper.rb +0 -19
  79. data/app/helpers/alchemy/admin/essences_helper.rb +7 -30
  80. data/app/helpers/alchemy/admin/navigation_helper.rb +13 -51
  81. data/app/helpers/alchemy/admin/pages_helper.rb +21 -16
  82. data/app/helpers/alchemy/admin/pictures_helper.rb +9 -0
  83. data/app/helpers/alchemy/deprecated_pages_helper.rb +54 -0
  84. data/app/helpers/alchemy/essences_helper.rb +1 -1
  85. data/app/helpers/alchemy/pages_helper.rb +8 -109
  86. data/app/helpers/alchemy/url_helper.rb +8 -13
  87. data/app/models/alchemy/attachment.rb +7 -4
  88. data/app/models/alchemy/cell.rb +2 -2
  89. data/app/models/alchemy/content.rb +2 -2
  90. data/app/models/alchemy/content/factory.rb +12 -9
  91. data/app/models/alchemy/element.rb +6 -3
  92. data/app/models/alchemy/essence_file.rb +1 -1
  93. data/app/models/alchemy/essence_picture.rb +37 -47
  94. data/app/models/alchemy/essence_picture_view.rb +8 -1
  95. data/app/models/alchemy/folded_page.rb +3 -2
  96. data/app/models/alchemy/legacy_page_url.rb +3 -3
  97. data/app/models/alchemy/page.rb +50 -5
  98. data/app/models/alchemy/page/fixed_attributes.rb +63 -0
  99. data/app/models/alchemy/page/page_elements.rb +10 -7
  100. data/app/models/alchemy/page/page_natures.rb +19 -0
  101. data/app/models/alchemy/picture.rb +1 -0
  102. data/app/models/alchemy/picture/transformations.rb +1 -1
  103. data/app/models/alchemy/picture/url.rb +82 -0
  104. data/app/serializers/alchemy/page_tree_serializer.rb +29 -8
  105. data/app/views/alchemy/_edit_mode.html.erb +2 -0
  106. data/app/views/alchemy/_menubar.html.erb +1 -1
  107. data/app/views/alchemy/_preview_mode_code.html.erb +6 -0
  108. data/app/views/alchemy/admin/attachments/_archive_overlay.html.erb +1 -1
  109. data/app/views/alchemy/admin/attachments/_attachment.html.erb +25 -5
  110. data/app/views/alchemy/admin/attachments/_replace_button.html.erb +26 -0
  111. data/app/views/alchemy/admin/attachments/index.html.erb +1 -1
  112. data/app/views/alchemy/admin/attachments/show.html.erb +52 -0
  113. data/app/views/alchemy/admin/elements/_element_header.html.erb +6 -3
  114. data/app/views/alchemy/admin/elements/create.js.erb +0 -2
  115. data/app/views/alchemy/admin/elements/trash.js.erb +0 -1
  116. data/app/views/alchemy/admin/elements/update.js.erb +0 -2
  117. data/app/views/alchemy/admin/essence_pictures/crop.html.erb +1 -4
  118. data/app/views/alchemy/admin/essence_pictures/edit.html.erb +1 -1
  119. data/app/views/alchemy/admin/languages/index.html.erb +1 -0
  120. data/app/views/alchemy/admin/layoutpages/_layoutpage.html.erb +26 -27
  121. data/app/views/alchemy/admin/layoutpages/edit.html.erb +1 -1
  122. data/app/views/alchemy/admin/pages/_form.html.erb +13 -40
  123. data/app/views/alchemy/admin/pages/_locked_page.html.erb +1 -1
  124. data/app/views/alchemy/admin/pages/_page.html.erb +119 -61
  125. data/app/views/alchemy/admin/pages/_page_for_links.html.erb +4 -2
  126. data/app/views/alchemy/admin/pages/_page_infos.html.erb +12 -12
  127. data/app/views/alchemy/admin/pages/_page_status.html.erb +1 -1
  128. data/app/views/alchemy/admin/pages/_publication_fields.html.erb +35 -0
  129. data/app/views/alchemy/admin/pages/edit.html.erb +13 -2
  130. data/app/views/alchemy/admin/pages/index.html.erb +3 -8
  131. data/app/views/alchemy/admin/pages/info.html.erb +15 -2
  132. data/app/views/alchemy/admin/pages/sort.js.erb +1 -1
  133. data/app/views/alchemy/admin/pages/update.js.erb +1 -14
  134. data/app/views/alchemy/admin/partials/_main_navigation_entry.html.erb +12 -8
  135. data/app/views/alchemy/admin/partials/_remote_search_form.html.erb +4 -4
  136. data/app/views/alchemy/admin/partials/_search_form.html.erb +1 -1
  137. data/app/views/alchemy/admin/partials/_sub_navigation.html.erb +9 -6
  138. data/app/views/alchemy/admin/pictures/_filter_and_size_bar.html.erb +1 -1
  139. data/app/views/alchemy/admin/pictures/_picture.html.erb +1 -6
  140. data/app/views/alchemy/admin/pictures/_picture_to_assign.html.erb +1 -6
  141. data/app/views/alchemy/admin/pictures/index.html.erb +1 -1
  142. data/app/views/alchemy/admin/pictures/show.html.erb +1 -6
  143. data/app/views/alchemy/admin/uploader/_button.html.erb +4 -4
  144. data/app/views/alchemy/base/500.html.erb +15 -1
  145. data/app/views/alchemy/essences/_essence_boolean_editor.html.erb +13 -15
  146. data/app/views/alchemy/essences/_essence_boolean_view.html.erb +1 -3
  147. data/app/views/alchemy/essences/_essence_date_editor.html.erb +0 -2
  148. data/app/views/alchemy/essences/_essence_date_view.html.erb +0 -2
  149. data/app/views/alchemy/essences/_essence_file_editor.html.erb +2 -7
  150. data/app/views/alchemy/essences/_essence_file_view.html.erb +1 -3
  151. data/app/views/alchemy/essences/_essence_html_editor.html.erb +0 -2
  152. data/app/views/alchemy/essences/_essence_html_view.html.erb +1 -3
  153. data/app/views/alchemy/essences/_essence_link_editor.html.erb +0 -2
  154. data/app/views/alchemy/essences/_essence_link_view.html.erb +0 -2
  155. data/app/views/alchemy/essences/_essence_picture_editor.html.erb +47 -49
  156. data/app/views/alchemy/essences/_essence_picture_view.html.erb +1 -3
  157. data/app/views/alchemy/essences/_essence_richtext_editor.html.erb +0 -2
  158. data/app/views/alchemy/essences/_essence_richtext_view.html.erb +1 -3
  159. data/app/views/alchemy/essences/_essence_select_editor.html.erb +27 -29
  160. data/app/views/alchemy/essences/_essence_select_view.html.erb +1 -3
  161. data/app/views/alchemy/essences/_essence_text_editor.html.erb +17 -19
  162. data/app/views/alchemy/essences/_essence_text_view.html.erb +0 -2
  163. data/app/views/alchemy/pages/_meta_data.html.erb +9 -0
  164. data/app/views/layouts/alchemy/admin.html.erb +9 -11
  165. data/bin/alchemy +1 -2
  166. data/config/alchemy/config.yml +1 -1
  167. data/config/alchemy/modules.yml +0 -16
  168. data/config/initializers/dragonfly.rb +0 -18
  169. data/config/initializers/mini_profiler.rb +6 -0
  170. data/config/locales/alchemy.de.yml +9 -1
  171. data/config/locales/alchemy.en.yml +7 -1
  172. data/config/locales/alchemy.es.yml +6 -0
  173. data/config/locales/alchemy.fr.yml +2 -0
  174. data/config/locales/alchemy.it.yml +3 -1
  175. data/config/locales/alchemy.nl.yml +2 -0
  176. data/config/locales/alchemy.ru.yml +2 -0
  177. data/config/routes.rb +3 -8
  178. data/db/migrate/20160912223112_add_index_to_alchemy_pages_rgt.rb +9 -0
  179. data/db/migrate/20160927205604_add_foreign_key_indices_and_null_constraints.rb +20 -0
  180. data/db/migrate/20160928080104_add_foreign_keys.rb +27 -0
  181. data/lib/alchemy/admin/locale.rb +4 -3
  182. data/lib/alchemy/engine.rb +2 -4
  183. data/lib/alchemy/errors.rb +9 -2
  184. data/lib/alchemy/forms/builder.rb +8 -0
  185. data/lib/alchemy/modules.rb +20 -19
  186. data/lib/alchemy/permissions.rb +15 -4
  187. data/lib/alchemy/resources_helper.rb +4 -2
  188. data/lib/alchemy/sass_support.rb +9 -0
  189. data/lib/alchemy/seeder.rb +89 -1
  190. data/lib/alchemy/test_support/essence_shared_examples.rb +2 -0
  191. data/lib/alchemy/test_support/factories/attachment_factory.rb +1 -1
  192. data/lib/alchemy/test_support/factories/content_factory.rb +1 -0
  193. data/lib/alchemy/test_support/factories/element_factory.rb +1 -0
  194. data/lib/alchemy/test_support/factories/picture_factory.rb +1 -1
  195. data/lib/alchemy/test_support/fixtures/image.png +0 -0
  196. data/lib/alchemy/tinymce.rb +2 -6
  197. data/lib/alchemy/upgrader.rb +4 -55
  198. data/lib/alchemy/upgrader/tasks/install_dragonfly_config.rb +14 -0
  199. data/lib/alchemy/upgrader/three_point_five.rb +32 -0
  200. data/lib/alchemy/upgrader/three_point_four.rb +2 -8
  201. data/lib/alchemy/upgrader/three_point_one.rb +30 -30
  202. data/lib/alchemy/upgrader/three_point_three.rb +31 -31
  203. data/lib/alchemy/upgrader/three_point_two.rb +25 -25
  204. data/lib/alchemy/upgrader/three_point_zero.rb +59 -59
  205. data/lib/alchemy/version.rb +1 -1
  206. data/lib/rails/generators/alchemy/elements/templates/view.html.erb +1 -1
  207. data/lib/rails/generators/alchemy/elements/templates/view.html.haml +1 -1
  208. data/lib/rails/generators/alchemy/elements/templates/view.html.slim +1 -1
  209. data/lib/rails/generators/alchemy/essence/templates/editor.html.erb +1 -3
  210. data/lib/rails/generators/alchemy/install/files/_article_view.html.erb +1 -1
  211. data/lib/rails/generators/alchemy/install/files/application.html.erb +3 -4
  212. data/lib/rails/generators/alchemy/install/install_generator.rb +4 -0
  213. data/lib/rails/generators/alchemy/install/templates/dragonfly.rb.tt +35 -0
  214. data/lib/rails/generators/alchemy/module/module_generator.rb +1 -1
  215. data/lib/tasks/alchemy/db.rake +6 -0
  216. data/lib/tasks/alchemy/tidy.rake +85 -0
  217. data/lib/tasks/alchemy/upgrade.rake +165 -16
  218. data/vendor/assets/javascripts/clipboard.min.js +7 -0
  219. data/vendor/assets/javascripts/fileupload/jquery.fileupload-process.js +4 -4
  220. data/vendor/assets/javascripts/fileupload/jquery.fileupload-validate.js +2 -2
  221. data/vendor/assets/javascripts/fileupload/jquery.fileupload.js +29 -14
  222. data/vendor/assets/javascripts/fileupload/jquery.iframe-transport.js +2 -2
  223. data/vendor/assets/javascripts/tinymce/langs/es.js +2 -2
  224. data/vendor/assets/javascripts/tinymce/langs/fr.js +1 -1
  225. data/vendor/assets/javascripts/tinymce/langs/it.js +1 -1
  226. data/vendor/assets/javascripts/tinymce/langs/nl.js +3 -3
  227. data/vendor/assets/javascripts/tinymce/tinymce.min.js +15 -12
  228. metadata +44 -88
  229. data/app/assets/stylesheets/tinymce/skins/alchemy/fonts/readme.md +0 -1
  230. data/app/assets/stylesheets/tinymce/skins/alchemy/fonts/tinymce-small.eot +0 -0
  231. data/app/assets/stylesheets/tinymce/skins/alchemy/fonts/tinymce.eot +0 -0
  232. data/app/assets/stylesheets/tinymce/skins/alchemy/img/wline.gif +0 -0
  233. data/app/assets/stylesheets/tinymce/skins/alchemy/skin.ie7.min.css +0 -1
  234. data/app/controllers/alchemy/pictures_controller.rb +0 -97
  235. data/app/views/alchemy/admin/elements/_refresh_editor.js.erb +0 -8
  236. data/vendor/assets/javascripts/tinymce/plugins/anchor/plugin.min.js +0 -1
  237. data/vendor/assets/javascripts/tinymce/plugins/autoresize/plugin.min.js +0 -1
  238. data/vendor/assets/javascripts/tinymce/plugins/charmap/plugin.min.js +0 -1
  239. data/vendor/assets/javascripts/tinymce/plugins/code/plugin.min.js +0 -1
  240. data/vendor/assets/javascripts/tinymce/plugins/directionality/plugin.min.js +0 -1
  241. data/vendor/assets/javascripts/tinymce/plugins/fullscreen/plugin.min.js +0 -1
  242. data/vendor/assets/javascripts/tinymce/plugins/hr/plugin.min.js +0 -1
  243. data/vendor/assets/javascripts/tinymce/plugins/link/plugin.min.js +0 -1
  244. data/vendor/assets/javascripts/tinymce/plugins/paste/plugin.min.js +0 -1
  245. data/vendor/assets/javascripts/tinymce/plugins/tabfocus/plugin.min.js +0 -1
  246. data/vendor/assets/javascripts/tinymce/plugins/table/plugin.min.js +0 -1
  247. data/vendor/assets/javascripts/tinymce/themes/modern/theme.min.js +0 -1
@@ -1,12 +1,16 @@
1
1
  <% if can? *navigate_module(navigation) %>
2
- <%= link_to url_for_module(alchemy_module), class: main_navigation_css_classes(navigation) do %>
3
- <% if navigation["image"] %>
4
- <%= image_tag(navigation["image"]) %>
5
- <% elsif navigation["icon"] %>
6
- <span class="module icon <%= navigation["icon"] %>"></span>
7
- <% else %>
8
- <span class="module icon"></span>
2
+ <%= content_tag :div, class: main_navigation_css_classes(navigation) do %>
3
+ <%= link_to url_for_module(alchemy_module) do %>
4
+ <% if navigation["image"] %>
5
+ <%= image_tag(navigation["image"]) %>
6
+ <% elsif navigation["icon"] %>
7
+ <span class="module icon <%= navigation["icon"] %>"></span>
8
+ <% else %>
9
+ <span class="module icon"></span>
10
+ <% end %>
11
+ <label><%= Alchemy.t(navigation['name']) %></label>
9
12
  <% end %>
10
- <label><%= truncate Alchemy.t(navigation["name"]), length: 10 %></label>
13
+ <%= render 'alchemy/admin/partials/sub_navigation',
14
+ entries: navigation['sub_navigation'] %>
11
15
  <% end %>
12
16
  <% end %>
@@ -2,14 +2,15 @@
2
2
  action: 'index',
3
3
  options: @options.to_json,
4
4
  size: @size
5
- ), remote: true, html: {class: 'remote-search-form', id: nil} do |f| %>
5
+ ), remote: true, html: {class: 'search_form', id: nil} do |f| %>
6
6
  <%= hidden_field_tag("element_id", @element.blank? ? "" : @element.id) %>
7
7
  <%= hidden_field_tag("content_id", @content.blank? ? "" : @content.id) %>
8
8
  <div class="search_field">
9
9
  <%= render_icon('search') %>
10
10
  <%= f.search_field resource_handler.search_field_name,
11
- id: 'search_input_field',
12
- placeholder: Alchemy.t(:search) %>
11
+ placeholder: Alchemy.t(:search),
12
+ class: 'search_input_field',
13
+ id: nil %>
13
14
  <%= link_to '', url_for(
14
15
  action: 'index',
15
16
  element_id: @element.blank? ? '' : @element.id,
@@ -20,7 +21,6 @@
20
21
  ),
21
22
  remote: true,
22
23
  class: 'search_field_clear',
23
- id: 'search_field_clear',
24
24
  title: Alchemy.t(:click_to_show_all),
25
25
  style: params[:q].blank? ? 'display: none' : 'display: block' %>
26
26
  </div>
@@ -4,7 +4,7 @@
4
4
  <div class="search_field">
5
5
  <%= render_icon('search') %>
6
6
  <%= f.search_field resource_handler.search_field_name,
7
- id: 'search_input_field',
7
+ class: 'search_input_field',
8
8
  placeholder: Alchemy.t(:search) %>
9
9
  <% local_assigns.fetch(:additional_query_fields, []).each do |field| %>
10
10
  <%= f.hidden_field field %>
@@ -1,8 +1,11 @@
1
- <% entries.each do |entry| %>
2
- <% entry.stringify_keys! %>
3
- <% if can? *navigate_module(entry) %>
4
- <div class="subnavi_tab<%= entry_active?(entry) ? ' active' : nil %>">
5
- <%= link_to Alchemy.t(entry['name']), url_for_module_sub_navigation(entry) %>
1
+ <% if entries.present? %>
2
+ <div class="sub_navigation">
3
+ <% entries.each do |entry| %>
4
+ <% if can? *navigate_module(entry) %>
5
+ <div class="subnavi_tab<%= entry_active?(entry) ? ' active' : nil %>">
6
+ <%= link_to Alchemy.t(entry['name']), url_for_module_sub_navigation(entry) %>
7
+ </div>
8
+ <% end %>
9
+ <% end %>
6
10
  </div>
7
- <% end %>
8
11
  <% end %>
@@ -1,7 +1,7 @@
1
1
  <div id="image_assign_filter_and_image_sizing">
2
2
  <% if can? :create, Alchemy::Picture %>
3
3
  <%= render 'alchemy/admin/uploader/button',
4
- model_class: Alchemy::Picture,
4
+ object: Alchemy::Picture.new,
5
5
  dropzone: '#assign_image_list',
6
6
  file_attribute: 'image_file',
7
7
  in_dialog: true,
@@ -22,12 +22,7 @@
22
22
  </span>
23
23
  <% end %>
24
24
  <% image = image_tag(
25
- alchemy.thumbnail_path(
26
- id: picture,
27
- size: @size,
28
- sh: picture.security_token(size: @size),
29
- format: picture.image_file_format
30
- ),
25
+ picture.url(size: preview_size(@size), flatten: true),
31
26
  alt: picture.name,
32
27
  title: Alchemy.t(:zoom_image)
33
28
  ) %>
@@ -2,12 +2,7 @@
2
2
  <% action_url = create_or_assign_url(picture_to_assign, @options.to_json) %>
3
3
  <%= link_to(
4
4
  image_tag(
5
- alchemy.thumbnail_path(
6
- id: picture_to_assign,
7
- size: size,
8
- sh: picture_to_assign.security_token(size: size),
9
- format: picture_to_assign.image_file_format
10
- ),
5
+ picture_to_assign.url(size: preview_size(size), flatten: true),
11
6
  alt: picture_to_assign.name
12
7
  ),
13
8
  action_url,
@@ -2,7 +2,7 @@
2
2
  <div class="toolbar_buttons">
3
3
  <% if can? :create, Alchemy::Picture %>
4
4
  <%= render 'alchemy/admin/uploader/button',
5
- model_class: Alchemy::Picture,
5
+ object: Alchemy::Picture.new,
6
6
  file_attribute: 'image_file',
7
7
  redirect_url: alchemy.admin_pictures_path(
8
8
  size: params[:size],
@@ -1,10 +1,5 @@
1
1
  <div class="zoomed-picture-background">
2
- <%= image_tag alchemy.zoom_picture_path(
3
- id: @picture.id,
4
- name: @picture.urlname,
5
- format: @picture.image_file_format,
6
- sh: @picture.security_token
7
- ) %>
2
+ <%= image_tag @picture.url(format: @picture.image_file_format) %>
8
3
  </div>
9
4
 
10
5
  <div class="picture-overlay-navigation">
@@ -1,6 +1,6 @@
1
- <%= form_for [:admin, model_class.new], html: {multipart: true, class: 'upload-button'} do |f| %>
1
+ <%= form_for [:admin, object], html: {multipart: true, class: 'upload-button'} do |f| %>
2
2
  <%= f.file_field file_attribute,
3
- class: 'fileupload', multiple: true,
3
+ class: 'fileupload fileupload--field', multiple: true,
4
4
  name: "#{f.object_name}[#{file_attribute}]" %>
5
5
  <%= hidden_field_tag "#{f.object_name}[upload_hash]", Time.current.hash %>
6
6
  <%= f.label file_attribute, data: {alchemy_hotkey: 'alt+n'} do %>
@@ -8,14 +8,14 @@
8
8
  <span class="icon_button"><%= render_icon :upload %></span>
9
9
  <label>
10
10
  <%= local_assigns[:label] ||
11
- Alchemy.t(:button_label, scope: [:uploader, model_class.model_name.i18n_key]) %>
11
+ Alchemy.t(:button_label, scope: [:uploader, object.class.model_name.i18n_key]) %>
12
12
  </label>
13
13
  </div>
14
14
  <% end %>
15
15
  <% end %>
16
16
 
17
17
  <% file_types = local_assigns[:file_types].presence ||
18
- configuration(:uploader)['allowed_filetypes'][model_class.model_name.collection] || ['*'] %>
18
+ configuration(:uploader)['allowed_filetypes'][object.class.model_name.collection] || ['*'] %>
19
19
 
20
20
  <script type='text/javascript'>
21
21
  $(function() {
@@ -12,15 +12,29 @@
12
12
  ], search: false
13
13
  ) %>
14
14
 
15
+ <% content_for(:alchemy_body_class) { 'error' } %>
16
+
15
17
  <%= render_message(:error) do %>
16
18
  <h1><%= Alchemy.t('An error happened') %></h1>
17
19
  <h2>
18
20
  <%= @error.class %>
19
21
  <%= @notice %>
20
22
  </h2>
21
- <p>
23
+ <p class="hidden">
22
24
  <% @trace.each do |line| %>
23
25
  <%= line %><br>
24
26
  <% end %>
25
27
  </p>
28
+ <a href="#" class="error_details--toggle">
29
+ <%= Alchemy.t('Show error details') %>
30
+ </a>
26
31
  <% end %>
32
+
33
+ <script>
34
+ $(function(){
35
+ $('.error_details--toggle').click(function(){
36
+ $('.error.message p').toggleClass('hidden');
37
+ return false;
38
+ });
39
+ });
40
+ </script>
@@ -1,15 +1,13 @@
1
- <% cache(content) do %>
2
- <div class="content_editor essence_boolean" id="<%= content.dom_id %>" data-content-id="<%= content.id %>">
3
- <input type="hidden" value="0" name="<%= content.form_field_name %>">
4
- <%= check_box_tag content.form_field_name, 1,
5
- content.ingredient.presence || content.settings_value(
6
- :default_value, local_assigns.fetch(:options, {})
7
- ),
8
- class: local_assigns.fetch(:html_options, {})[:class],
9
- style: local_assigns.fetch(:html_options, {})[:style] %>
10
- <label for="<%= content.form_field_id %>" style="display: inline">
11
- <%= render_content_name(content) %>
12
- </label>
13
- <%= render_hint_for(content) %>
14
- </div>
15
- <% end %>
1
+ <div class="content_editor essence_boolean" id="<%= content.dom_id %>" data-content-id="<%= content.id %>">
2
+ <input type="hidden" value="0" name="<%= content.form_field_name %>">
3
+ <%= check_box_tag content.form_field_name, 1,
4
+ content.ingredient.presence || content.settings_value(
5
+ :default_value, local_assigns.fetch(:options, {})
6
+ ),
7
+ class: local_assigns.fetch(:html_options, {})[:class],
8
+ style: local_assigns.fetch(:html_options, {})[:style] %>
9
+ <label for="<%= content.form_field_id %>" style="display: inline">
10
+ <%= render_content_name(content) %>
11
+ </label>
12
+ <%= render_hint_for(content) %>
13
+ </div>
@@ -1,3 +1 @@
1
- <%- cache(content) do -%>
2
- <%= Alchemy.t(content.ingredient) -%>
3
- <%- end -%>
1
+ <%= Alchemy.t(content.ingredient) unless content.ingredient.nil? -%>
@@ -1,4 +1,3 @@
1
- <% cache(content) do %>
2
1
  <div class="content_editor essence_date" id="<%= content.dom_id %>" data-content-id="<%= content.id %>">
3
2
  <%= content_label(content) %>
4
3
  <%= alchemy_datepicker(
@@ -12,4 +11,3 @@
12
11
  <span class="ui-icon ui-icon-calendar"></span>
13
12
  </label>
14
13
  </div>
15
- <% end %>
@@ -1,4 +1,3 @@
1
- <%- cache(content) do -%>
2
1
  <%- date_format = content.settings_value(:date_format,
3
2
  local_assigns.fetch(:options, {})) -%>
4
3
  <%- if content.ingredient.present? -%>
@@ -7,5 +6,4 @@
7
6
  <%- else -%>
8
7
  <%= l(content.ingredient, format: date_format) %>
9
8
  <%- end -%>
10
- <%- end -%>
11
9
  <%- end -%>
@@ -1,5 +1,3 @@
1
- <% cache(content) do %>
2
-
3
1
  <% dialog_link = link_to_dialog('',
4
2
  alchemy.admin_attachments_path(
5
3
  content_id: content.id,
@@ -46,10 +44,7 @@
46
44
  class: 'edit_file',
47
45
  title: Alchemy.t(:edit_file_properties) %>
48
46
  </div>
49
- <% if content.ingredient %>
50
- <%= hidden_field_tag content.form_field_name(:attachment_id),
51
- content.ingredient.id %>
52
- <% end %>
47
+ <%= hidden_field_tag content.form_field_name(:attachment_id),
48
+ content.ingredient && content.ingredient.id %>
53
49
  </div>
54
50
  </div>
55
- <% end %>
@@ -1,4 +1,3 @@
1
- <%- cache(content) do -%>
2
1
  <%- if attachment = content.ingredient -%>
3
2
  <%- html_options = local_assigns.fetch(:html_options, {}) -%>
4
3
  <%= link_to(
@@ -15,5 +14,4 @@
15
14
  title: content.essence.title.presence
16
15
  }.merge(html_options)
17
16
  ) -%>
18
- <%- end -%>
19
- <%- end -%>
17
+ <%- end -%>
@@ -1,4 +1,3 @@
1
- <% cache(content) do %>
2
1
  <div class="content_editor essence_html_editor" data-content-id="<%= content.id %>">
3
2
  <%= content_label(content) %>
4
3
  <%= text_area_tag(
@@ -6,4 +5,3 @@
6
5
  content.ingredient
7
6
  ) %>
8
7
  </div>
9
- <% end %>
@@ -1,3 +1 @@
1
- <% cache(content) do %>
2
- <%= raw content.ingredient -%>
3
- <% end %>
1
+ <%= raw content.ingredient -%>
@@ -1,4 +1,3 @@
1
- <% cache(content) do %>
2
1
  <div class="content_editor essence_link" id="<%= content.dom_id %>" data-content-id="<%= content.id %>">
3
2
  <%= content_label(content) %>
4
3
  <%= text_field_tag '', content.ingredient,
@@ -22,4 +21,3 @@
22
21
  $('#<%= content.dom_id %> input.text_with_icon').val($(this).val());
23
22
  });
24
23
  </script>
25
- <% end %>
@@ -1,4 +1,3 @@
1
- <%- cache(content) do -%>
2
1
  <%- if content.ingredient.present? -%>
3
2
  <%- html_options = {
4
3
  target: content.essence.link_target == "blank" ? "_blank" : nil
@@ -7,5 +6,4 @@
7
6
  <%= content.settings_value(:text, local_assigns.fetch(:options, {})) ||
8
7
  content.ingredient -%>
9
8
  <%- end -%>
10
- <%- end -%>
11
9
  <%- end -%>
@@ -1,54 +1,52 @@
1
- <% cache(content) do %>
2
- <%= content_tag :div, id: content.dom_id, data: {"content-id" => content.id}, class: [
3
- "essence_picture_editor",
4
- options[:dragable] ? "dragable_picture" : nil,
5
- options[:grouped] ? nil : "content_editor"
6
- ].compact.join(" ") do %>
7
- <% unless options[:grouped] %><%= content_label(content) %><% end %>
8
- <div class="picture_thumbnail">
9
- <span class="picture_tool delete">
10
- <% if options[:grouped] %>
11
- <%= link_to_confirm_dialog "", Alchemy.t(:confirm_to_delete_image),
12
- alchemy.admin_essence_picture_path(
13
- id: content,
14
- options: options
15
- ), {title: Alchemy.t(:delete_image)} %>
16
- <% else %>
17
- <%= link_to '', '#',
18
- onclick: "return Alchemy.removePicture('##{content.form_field_id(:picture_id)}');" %>
1
+ <%= content_tag :div, id: content.dom_id, data: {"content-id" => content.id}, class: [
2
+ "essence_picture_editor",
3
+ options[:dragable] ? "dragable_picture" : nil,
4
+ options[:grouped] ? nil : "content_editor"
5
+ ].compact.join(" ") do %>
6
+ <% unless options[:grouped] %><%= content_label(content) %><% end %>
7
+ <div class="picture_thumbnail">
8
+ <span class="picture_tool delete">
9
+ <% if options[:grouped] %>
10
+ <%= link_to_confirm_dialog "", Alchemy.t(:confirm_to_delete_image),
11
+ alchemy.admin_essence_picture_path(
12
+ id: content,
13
+ options: options
14
+ ), {title: Alchemy.t(:delete_image)} %>
15
+ <% else %>
16
+ <%= link_to '', '#',
17
+ onclick: "return Alchemy.removePicture('##{content.form_field_id(:picture_id)}');" %>
18
+ <% end %>
19
+ </span>
20
+ <%- if content.ingredient -%>
21
+ <div class="picture_handle" title="<%= Alchemy.t(:drag_to_sort) if options[:dragable] %>"></div>
22
+ <%- end -%>
23
+ <div class="picture_image">
24
+ <div class="thumbnail_background<%= ' missing' if content.ingredient.nil? %>">
25
+ <%- if content.ingredient -%>
26
+ <%= essence_picture_thumbnail(content, options) %>
27
+ <%= hidden_field_tag content.form_field_name(:picture_id), content.ingredient.id %>
19
28
  <% end %>
20
- </span>
21
- <%- if content.ingredient -%>
22
- <div class="picture_handle" title="<%= Alchemy.t(:drag_to_sort) if options[:dragable] %>"></div>
23
- <%- end -%>
24
- <div class="picture_image">
25
- <div class="thumbnail_background<%= ' missing' if content.ingredient.nil? %>">
26
- <%- if content.ingredient -%>
27
- <%= essence_picture_thumbnail(content, options) %>
28
- <%= hidden_field_tag content.form_field_name(:picture_id), content.ingredient.id %>
29
- <% end %>
30
- </div>
31
29
  </div>
32
- <%- if content.essence.css_class.present? -%>
33
- <div class="essence_picture_css_class">
34
- <%= Alchemy.t("alchemy.essence_pictures.css_classes.#{content.essence.css_class}",
35
- default: content.essence.css_class.camelcase) %>
36
- </div>
37
- <%- end -%>
38
- <div class="edit_images_bottom">
39
- <%= render 'alchemy/essences/shared/essence_picture_tools', {
40
- content: content,
41
- options: options
42
- } %>
30
+ </div>
31
+ <%- if content.essence.css_class.present? -%>
32
+ <div class="essence_picture_css_class">
33
+ <%= Alchemy.t("alchemy.essence_pictures.css_classes.#{content.essence.css_class}",
34
+ default: content.essence.css_class.camelcase) %>
43
35
  </div>
36
+ <%- end -%>
37
+ <div class="edit_images_bottom">
38
+ <%= render 'alchemy/essences/shared/essence_picture_tools', {
39
+ content: content,
40
+ options: options
41
+ } %>
44
42
  </div>
45
- <%= hidden_field_tag content.form_field_name(:link),
46
- content.essence.link %>
47
- <%= hidden_field_tag content.form_field_name(:link_title),
48
- content.essence.link_title %>
49
- <%= hidden_field_tag content.form_field_name(:link_class_name),
50
- content.essence.link_class_name %>
51
- <%= hidden_field_tag content.form_field_name(:link_target),
52
- content.essence.link_target %>
53
- <% end %>
43
+ </div>
44
+ <%= hidden_field_tag content.form_field_name(:link),
45
+ content.essence.link %>
46
+ <%= hidden_field_tag content.form_field_name(:link_title),
47
+ content.essence.link_title %>
48
+ <%= hidden_field_tag content.form_field_name(:link_class_name),
49
+ content.essence.link_class_name %>
50
+ <%= hidden_field_tag content.form_field_name(:link_target),
51
+ content.essence.link_target %>
54
52
  <% end %>
@@ -1,7 +1,5 @@
1
- <% cache(content) do %>
2
1
  <%= Alchemy::EssencePictureView.new(
3
2
  content,
4
3
  local_assigns[:options],
5
4
  local_assigns[:html_options]
6
- ).render %>
7
- <% end %>
5
+ ).render %>
@@ -1,4 +1,3 @@
1
- <% cache(content) do -%>
2
1
  <div class="content_editor essence_richtext" id="<%= content.dom_id %>">
3
2
  <%= content_label(content) %>
4
3
  <div class="tinymce_container">
@@ -10,4 +9,3 @@
10
9
  ) %>
11
10
  </div>
12
11
  </div>
13
- <% end -%>