alchemy_cms 2.5.3.1 → 2.6.0.rc5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (331) hide show
  1. data/.gitignore +1 -1
  2. data/.travis.yml +5 -13
  3. data/Gemfile +6 -3
  4. data/README.md +3 -2
  5. data/alchemy_cms.gemspec +22 -22
  6. data/app/assets/fonts/alchemy-icons.eot +0 -0
  7. data/app/assets/fonts/alchemy-icons.svg +54 -0
  8. data/app/assets/fonts/alchemy-icons.ttf +0 -0
  9. data/app/assets/fonts/alchemy-icons.woff +0 -0
  10. data/app/assets/images/alchemy/icons.png +0 -0
  11. data/app/assets/javascripts/alchemy/alchemy.base.js.coffee +151 -0
  12. data/app/assets/javascripts/alchemy/alchemy.buttons.js.coffee +3 -2
  13. data/app/assets/javascripts/alchemy/alchemy.datepicker.js.coffee +31 -0
  14. data/app/assets/javascripts/alchemy/alchemy.dragndrop.js +1 -1
  15. data/app/assets/javascripts/alchemy/alchemy.element_editors.js.coffee +98 -0
  16. data/app/assets/javascripts/alchemy/alchemy.elements_window.js.coffee +23 -24
  17. data/app/assets/javascripts/alchemy/alchemy.growler.js.coffee +27 -0
  18. data/app/assets/javascripts/alchemy/alchemy.gui.js.coffee +11 -8
  19. data/app/assets/javascripts/alchemy/alchemy.hotkeys.js.coffee +32 -0
  20. data/app/assets/javascripts/alchemy/alchemy.image_cropper.js.coffee +46 -0
  21. data/app/assets/javascripts/alchemy/alchemy.js +8 -2
  22. data/app/assets/javascripts/alchemy/alchemy.link_overlay.js.coffee +5 -4
  23. data/app/assets/javascripts/alchemy/alchemy.list_filter.js.coffee +49 -0
  24. data/app/assets/javascripts/alchemy/alchemy.onload.js.coffee +3 -0
  25. data/app/assets/javascripts/alchemy/alchemy.preview_window.js.coffee +71 -0
  26. data/app/assets/javascripts/alchemy/alchemy.sitemap.js.coffee +61 -0
  27. data/app/assets/javascripts/alchemy/alchemy.spinner.js.coffee +35 -0
  28. data/app/assets/javascripts/alchemy/alchemy.string_extension.js.coffee +11 -0
  29. data/app/assets/javascripts/alchemy/alchemy.windows.js.coffee +278 -0
  30. data/app/assets/stylesheets/alchemy/admin.css.scss +2 -0
  31. data/app/assets/stylesheets/alchemy/archive.scss +109 -65
  32. data/app/assets/stylesheets/alchemy/base.scss +16 -188
  33. data/app/assets/stylesheets/alchemy/dashboard.scss +2 -2
  34. data/app/assets/stylesheets/alchemy/defaults.scss +2 -1
  35. data/app/assets/stylesheets/alchemy/elements.scss +58 -94
  36. data/app/assets/stylesheets/alchemy/errors.scss +2 -2
  37. data/app/assets/stylesheets/alchemy/{mixins.scss → extends.scss} +104 -80
  38. data/app/assets/stylesheets/alchemy/flash.scss +4 -6
  39. data/app/assets/stylesheets/alchemy/fonts.scss +46 -0
  40. data/app/assets/stylesheets/alchemy/form_elements.scss +46 -45
  41. data/app/assets/stylesheets/alchemy/frame.scss +20 -15
  42. data/app/assets/stylesheets/alchemy/icons.scss +22 -9
  43. data/app/assets/stylesheets/alchemy/jquery-ui.scss +476 -399
  44. data/app/assets/stylesheets/alchemy/login.scss +1 -1
  45. data/app/assets/stylesheets/alchemy/menubar.css.scss +1 -1
  46. data/app/assets/stylesheets/alchemy/notices.scss +5 -5
  47. data/app/assets/stylesheets/alchemy/pagination.scss +25 -13
  48. data/app/assets/stylesheets/alchemy/search.scss +29 -17
  49. data/app/assets/stylesheets/alchemy/sitemap.scss +41 -36
  50. data/app/assets/stylesheets/alchemy/tables.scss +102 -50
  51. data/app/assets/stylesheets/alchemy/tinymce_dialog.css.scss +18 -16
  52. data/app/assets/stylesheets/alchemy/toolbar.scss +84 -24
  53. data/app/assets/stylesheets/alchemy/upload.scss +14 -9
  54. data/app/assets/stylesheets/alchemy/variables.scss +1 -0
  55. data/app/assets/stylesheets/tiny_mce/plugins/inlinepopups/skins/alchemy/window.css.scss +18 -21
  56. data/app/controllers/alchemy/admin/attachments_controller.rb +29 -39
  57. data/app/controllers/alchemy/admin/base_controller.rb +3 -9
  58. data/app/controllers/alchemy/admin/clipboard_controller.rb +1 -1
  59. data/app/controllers/alchemy/admin/contents_controller.rb +1 -1
  60. data/app/controllers/alchemy/admin/dashboard_controller.rb +1 -1
  61. data/app/controllers/alchemy/admin/elements_controller.rb +3 -3
  62. data/app/controllers/alchemy/admin/essence_files_controller.rb +1 -1
  63. data/app/controllers/alchemy/admin/essence_pictures_controller.rb +5 -5
  64. data/app/controllers/alchemy/admin/languages_controller.rb +1 -1
  65. data/app/controllers/alchemy/admin/pages_controller.rb +18 -16
  66. data/app/controllers/alchemy/admin/pictures_controller.rb +11 -10
  67. data/app/controllers/alchemy/admin/resources_controller.rb +87 -14
  68. data/app/controllers/alchemy/admin/tags_controller.rb +3 -3
  69. data/app/controllers/alchemy/admin/trash_controller.rb +3 -3
  70. data/app/controllers/alchemy/admin/users_controller.rb +6 -11
  71. data/app/controllers/alchemy/attachments_controller.rb +8 -9
  72. data/app/controllers/alchemy/base_controller.rb +17 -10
  73. data/app/controllers/alchemy/pages_controller.rb +7 -19
  74. data/app/controllers/alchemy/passwords_controller.rb +15 -3
  75. data/app/controllers/alchemy/user_sessions_controller.rb +5 -4
  76. data/app/controllers/alchemy/users_controller.rb +1 -1
  77. data/app/helpers/alchemy/admin/attachments_helper.rb +2 -2
  78. data/app/helpers/alchemy/admin/base_helper.rb +62 -90
  79. data/app/helpers/alchemy/admin/elements_helper.rb +13 -5
  80. data/app/helpers/alchemy/admin/essences_helper.rb +3 -5
  81. data/app/helpers/alchemy/admin/pages_helper.rb +6 -3
  82. data/app/helpers/alchemy/admin/tags_helper.rb +60 -0
  83. data/app/helpers/alchemy/base_helper.rb +16 -20
  84. data/app/helpers/alchemy/elements_helper.rb +7 -11
  85. data/app/helpers/alchemy/essences_helper.rb +2 -2
  86. data/app/helpers/alchemy/pages_helper.rb +31 -69
  87. data/app/helpers/alchemy/url_helper.rb +11 -3
  88. data/app/models/alchemy/attachment.rb +73 -45
  89. data/app/models/alchemy/cell.rb +1 -1
  90. data/app/models/alchemy/content.rb +20 -9
  91. data/app/models/alchemy/element.rb +9 -7
  92. data/app/models/alchemy/page.rb +15 -248
  93. data/app/models/alchemy/page/cells.rb +71 -0
  94. data/app/models/alchemy/page/elements.rb +147 -0
  95. data/app/models/alchemy/page/naming.rb +90 -0
  96. data/app/models/alchemy/picture.rb +18 -13
  97. data/app/models/alchemy/tag.rb +1 -1
  98. data/app/models/alchemy/user.rb +38 -6
  99. data/app/views/alchemy/admin/attachments/_archive_overlay.html.erb +14 -7
  100. data/app/views/alchemy/admin/attachments/_attachment.html.erb +17 -12
  101. data/app/views/alchemy/admin/attachments/_file_to_assign.html.erb +3 -8
  102. data/app/views/alchemy/admin/attachments/_files_list.html.erb +20 -12
  103. data/app/views/alchemy/admin/attachments/_overlay_file_list.html.erb +11 -0
  104. data/app/views/alchemy/admin/attachments/_tag_list.html.erb +31 -0
  105. data/app/views/alchemy/admin/attachments/archive_overlay.js.erb +4 -0
  106. data/app/views/alchemy/admin/attachments/edit.html.erb +8 -7
  107. data/app/views/alchemy/admin/attachments/index.html.erb +19 -12
  108. data/app/views/alchemy/admin/attachments/new.html.erb +2 -2
  109. data/app/views/alchemy/admin/attachments/show.html.erb +3 -0
  110. data/app/views/alchemy/admin/contents/_missing.html.erb +4 -4
  111. data/app/views/alchemy/admin/contents/create.js.erb +1 -1
  112. data/app/views/alchemy/admin/contents/new.html.erb +6 -3
  113. data/app/views/alchemy/admin/dashboard/_locked_pages.html.erb +1 -1
  114. data/app/views/alchemy/admin/dashboard/_users.html.erb +1 -1
  115. data/app/views/alchemy/admin/dashboard/index.html.erb +3 -3
  116. data/app/views/alchemy/admin/dashboard/info.html.erb +16 -13
  117. data/app/views/alchemy/admin/elements/_add_picture.html.erb +1 -1
  118. data/app/views/alchemy/admin/elements/_element_foot.html.erb +4 -4
  119. data/app/views/alchemy/admin/elements/_element_head.html.erb +1 -7
  120. data/app/views/alchemy/admin/elements/_elements_select.html.erb +2 -2
  121. data/app/views/alchemy/admin/elements/_new_element_form.html.erb +4 -4
  122. data/app/views/alchemy/admin/elements/_picture_gallery_editor.html.erb +1 -1
  123. data/app/views/alchemy/admin/elements/create.js.erb +2 -2
  124. data/app/views/alchemy/admin/elements/fold.js.erb +3 -6
  125. data/app/views/alchemy/admin/elements/new.html.erb +1 -1
  126. data/app/views/alchemy/admin/elements/order.js.erb +1 -1
  127. data/app/views/alchemy/admin/elements/trash.js.erb +1 -1
  128. data/app/views/alchemy/admin/elements/update.js.erb +2 -2
  129. data/app/views/alchemy/admin/essence_files/edit.html.erb +4 -4
  130. data/app/views/alchemy/admin/essence_pictures/crop.html.erb +17 -18
  131. data/app/views/alchemy/admin/essence_pictures/edit.html.erb +2 -2
  132. data/app/views/alchemy/admin/essence_pictures/update.js.erb +1 -0
  133. data/app/views/alchemy/admin/languages/_form.html.erb +12 -10
  134. data/app/views/alchemy/admin/languages/_language.html.erb +2 -1
  135. data/app/views/alchemy/admin/languages/_table.html.erb +3 -3
  136. data/app/views/alchemy/admin/languages/index.html.erb +15 -15
  137. data/app/views/alchemy/admin/layoutpages/_layoutpage.html.erb +6 -6
  138. data/app/views/alchemy/admin/layoutpages/index.html.erb +41 -40
  139. data/app/views/alchemy/admin/pages/_contactform_links.html.erb +4 -4
  140. data/app/views/alchemy/admin/pages/_create_language_form.html.erb +6 -6
  141. data/app/views/alchemy/admin/pages/_external_link.html.erb +2 -2
  142. data/app/views/alchemy/admin/pages/_file_link.html.erb +3 -3
  143. data/app/views/alchemy/admin/pages/_internal_link.html.erb +1 -1
  144. data/app/views/alchemy/admin/pages/_new_page_form.html.erb +1 -1
  145. data/app/views/alchemy/admin/pages/_page.html.erb +13 -13
  146. data/app/views/alchemy/admin/pages/_page_for_links.html.erb +2 -4
  147. data/app/views/alchemy/admin/pages/_sitemap.html.erb +5 -0
  148. data/app/views/alchemy/admin/pages/configure.html.erb +7 -7
  149. data/app/views/alchemy/admin/pages/configure_external.html.erb +4 -4
  150. data/app/views/alchemy/admin/pages/edit.html.erb +23 -30
  151. data/app/views/alchemy/admin/pages/index.html.erb +34 -23
  152. data/app/views/alchemy/admin/pages/new.html.erb +1 -1
  153. data/app/views/alchemy/admin/pages/sort.js.erb +1 -1
  154. data/app/views/alchemy/admin/partials/_flash_upload.html.erb +2 -3
  155. data/app/views/alchemy/admin/partials/_remote_search_form.html.erb +2 -2
  156. data/app/views/alchemy/admin/partials/_search_form.html.erb +3 -3
  157. data/app/views/alchemy/admin/partials/_upload_form.html.erb +2 -2
  158. data/app/views/alchemy/admin/pictures/_archive.html.erb +7 -7
  159. data/app/views/alchemy/admin/pictures/_archive_overlay.html.erb +1 -1
  160. data/app/views/alchemy/admin/pictures/_filter_and_size_bar.html.erb +6 -6
  161. data/app/views/alchemy/admin/pictures/_filter_bar.html.erb +4 -4
  162. data/app/views/alchemy/admin/pictures/_overlay_picture_list.html.erb +1 -1
  163. data/app/views/alchemy/admin/pictures/_picture.html.erb +3 -8
  164. data/app/views/alchemy/admin/pictures/_picture_to_assign.html.erb +9 -14
  165. data/app/views/alchemy/admin/pictures/_tag_list.html.erb +27 -25
  166. data/app/views/alchemy/admin/pictures/archive_overlay.js.erb +3 -1
  167. data/app/views/alchemy/admin/pictures/index.html.erb +49 -42
  168. data/app/views/alchemy/admin/pictures/new.html.erb +2 -2
  169. data/app/views/alchemy/admin/pictures/show.html.erb +11 -0
  170. data/app/views/alchemy/admin/resources/_boolean.html.erb +2 -2
  171. data/app/views/alchemy/admin/resources/_datetime.html.erb +2 -2
  172. data/app/views/alchemy/admin/resources/_form.html.erb +9 -8
  173. data/app/views/alchemy/admin/resources/_resource.html.erb +15 -21
  174. data/app/views/alchemy/admin/resources/_string.html.erb +2 -2
  175. data/app/views/alchemy/admin/resources/_table.html.erb +11 -13
  176. data/app/views/alchemy/admin/resources/_text.html.erb +2 -2
  177. data/app/views/alchemy/admin/resources/index.csv.erb +13 -0
  178. data/app/views/alchemy/admin/resources/index.html.erb +24 -15
  179. data/app/views/alchemy/admin/sites/index.html.erb +23 -0
  180. data/app/views/alchemy/admin/tags/_radio_tag.html.erb +1 -1
  181. data/app/views/alchemy/admin/tags/_tag.html.erb +2 -1
  182. data/app/views/alchemy/admin/tags/edit.html.erb +1 -1
  183. data/app/views/alchemy/admin/tags/index.html.erb +16 -11
  184. data/app/views/alchemy/admin/tags/new.html.erb +3 -3
  185. data/app/views/alchemy/admin/trash/clear.js.coffee +1 -1
  186. data/app/views/alchemy/admin/users/_table.html.erb +12 -5
  187. data/app/views/alchemy/admin/users/_user.html.erb +16 -16
  188. data/app/views/alchemy/admin/users/index.html.erb +28 -16
  189. data/app/views/alchemy/breadcrumb/_page.html.erb +15 -0
  190. data/app/views/alchemy/breadcrumb/_spacer.html.erb +1 -0
  191. data/app/views/alchemy/elements/_editor_not_found.html.erb +1 -1
  192. data/app/views/alchemy/essences/_essence_file_editor.html.erb +16 -16
  193. data/app/views/alchemy/essences/_essence_file_view.html.erb +8 -9
  194. data/app/views/alchemy/essences/_essence_picture_editor.html.erb +3 -6
  195. data/app/views/alchemy/essences/_essence_picture_tools.html.erb +9 -8
  196. data/app/views/alchemy/essences/_essence_richtext_editor.html.erb +0 -5
  197. data/app/views/alchemy/essences/_linkable_essence_tools.html.erb +2 -2
  198. data/app/views/alchemy/navigation/_link.html.erb +7 -7
  199. data/app/views/alchemy/navigation/_renderer.html.erb +29 -36
  200. data/app/views/alchemy/notifications/admin_user_created.de.text.erb +5 -1
  201. data/app/views/alchemy/notifications/admin_user_created.en.text.erb +5 -1
  202. data/app/views/alchemy/notifications/registered_user_created.de.text.erb +13 -0
  203. data/app/views/alchemy/notifications/registered_user_created.en.text.erb +13 -0
  204. data/app/views/alchemy/search/_result.html.erb +4 -6
  205. data/app/views/alchemy/search/_results.html.erb +4 -5
  206. data/app/views/alchemy/user_sessions/leave.html.erb +1 -1
  207. data/app/views/alchemy/user_sessions/new.html.erb +2 -2
  208. data/app/views/kaminari/_first_page.html.erb +11 -0
  209. data/app/views/kaminari/_gap.html.erb +1 -1
  210. data/app/views/kaminari/_last_page.html.erb +11 -0
  211. data/app/views/kaminari/_next_page.html.erb +2 -2
  212. data/app/views/kaminari/_page.html.erb +1 -1
  213. data/app/views/kaminari/_paginator.html.erb +2 -0
  214. data/app/views/kaminari/_prev_page.html.erb +2 -2
  215. data/app/views/layouts/alchemy/admin.html.erb +4 -5
  216. data/config/alchemy/config.yml +8 -12
  217. data/config/authorization_rules.rb +4 -3
  218. data/config/initializers/dragonfly.rb +20 -12
  219. data/config/locales/alchemy.de.yml +20 -15
  220. data/config/locales/alchemy.en.yml +15 -10
  221. data/config/locales/devise.de.yml +1 -0
  222. data/config/routes.rb +3 -3
  223. data/{spec/dummy/db/migrate/20121118000000_alchemy_two_point_four.rb → db/migrate/20130214233001_alchemy_two_point_five.rb} +50 -36
  224. data/db/migrate/20130221200514_migrate_attachments_to_dragonfly.rb +21 -0
  225. data/db/migrate/20130312205327_change_alchemy_users_role_to_roles.rb +11 -0
  226. data/lib/alchemy/capistrano.rb +10 -8
  227. data/lib/alchemy/errors.rb +7 -0
  228. data/lib/alchemy/filetypes.rb +33 -0
  229. data/lib/alchemy/i18n.rb +9 -1
  230. data/lib/alchemy/name_conversions.rb +28 -0
  231. data/lib/alchemy/page_layout.rb +5 -3
  232. data/lib/alchemy/resource.rb +132 -29
  233. data/lib/alchemy/resources_helper.rb +81 -12
  234. data/lib/alchemy/upgrader.rb +14 -276
  235. data/lib/alchemy/version.rb +1 -1
  236. data/lib/alchemy_cms.rb +17 -2
  237. data/lib/rails/generators/alchemy/deploy_script/templates/deploy.rb.tt +1 -1
  238. data/lib/rails/generators/alchemy/scaffold/scaffold_generator.rb +1 -1
  239. data/lib/tasks/alchemy/convert.rake +39 -0
  240. data/lib/tasks/alchemy/install.rake +4 -6
  241. data/lib/tasks/alchemy/upgrade.rake +18 -1
  242. data/spec/controllers/admin/clipboard_controller_spec.rb +4 -4
  243. data/spec/controllers/admin/elements_controller_spec.rb +23 -23
  244. data/spec/controllers/admin/pages_controller_spec.rb +15 -0
  245. data/spec/controllers/admin/resources_controller_spec.rb +1 -11
  246. data/spec/controllers/admin/trash_controller_spec.rb +9 -9
  247. data/spec/controllers/attachments_controller_spec.rb +3 -3
  248. data/spec/controllers/elements_controller_spec.rb +2 -2
  249. data/spec/controllers/pages_controller_spec.rb +160 -129
  250. data/spec/controllers/pictures_controller_spec.rb +2 -2
  251. data/spec/controllers/user_sessions_controller_spec.rb +3 -3
  252. data/spec/controllers/users_controller_spec.rb +2 -2
  253. data/spec/dummy/app/models/event.rb +2 -2
  254. data/spec/dummy/app/models/location.rb +4 -0
  255. data/spec/dummy/app/views/layouts/application.html.erb +6 -42
  256. data/spec/dummy/config/routes.rb +1 -1
  257. data/spec/dummy/db/migrate/20121026104128_create_events.rb +0 -1
  258. data/{db/migrate/20121118000000_alchemy_two_point_four.rb → spec/dummy/db/migrate/20130214233001_alchemy_two_point_five.rb} +50 -36
  259. data/spec/dummy/db/migrate/20130221200514_migrate_attachments_to_dragonfly.rb +21 -0
  260. data/spec/dummy/db/migrate/20130312205327_change_alchemy_users_role_to_roles.rb +11 -0
  261. data/spec/dummy/db/migrate/20130328101418_create_locations.rb +9 -0
  262. data/spec/dummy/db/schema.rb +15 -6
  263. data/spec/factories.rb +4 -4
  264. data/spec/{integration → features}/admin/link_overlay_spec.rb +0 -0
  265. data/spec/{integration → features}/admin/modules_integration_spec.rb +1 -1
  266. data/spec/{integration → features}/admin/pages_controller_spec.rb +9 -4
  267. data/spec/{integration → features}/admin/picture_library_integration_spec.rb +5 -5
  268. data/spec/{integration → features}/admin/resources_integration_spec.rb +1 -1
  269. data/spec/{integration → features}/navigation_spec.rb +0 -0
  270. data/spec/{integration → features}/pages_controller_spec.rb +42 -112
  271. data/spec/{integration → features}/picture_security_spec.rb +2 -2
  272. data/spec/{integration → features}/security_spec.rb +7 -7
  273. data/spec/{integration → features}/translation_integration_spec.rb +0 -0
  274. data/spec/helpers/admin/base_helper_spec.rb +0 -50
  275. data/spec/helpers/admin/tags_helper_spec.rb +53 -0
  276. data/spec/helpers/base_helper_spec.rb +19 -3
  277. data/spec/helpers/pages_helper_spec.rb +92 -44
  278. data/spec/{url_helpers_spec.rb → helpers/picture_url_helpers_spec.rb} +7 -7
  279. data/spec/helpers/url_helper_spec.rb +92 -72
  280. data/spec/{config_spec.rb → libraries/config_spec.rb} +0 -0
  281. data/spec/libraries/resource_spec.rb +215 -76
  282. data/spec/libraries/resources_helper_spec.rb +70 -28
  283. data/spec/models/attachment_spec.rb +75 -9
  284. data/spec/models/clipboard_spec.rb +1 -1
  285. data/spec/models/element_spec.rb +7 -0
  286. data/spec/models/page_spec.rb +144 -25
  287. data/spec/models/picture_spec.rb +5 -5
  288. data/spec/models/resource_spec.rb +47 -10
  289. data/spec/models/user_spec.rb +115 -3
  290. data/spec/{routing_spec.rb → routing/routing_spec.rb} +8 -20
  291. data/spec/spec_helper.rb +5 -6
  292. data/spec/support/alchemy/specs_helpers.rb +1 -1
  293. data/spec/support/ci/install_phantomjs +1 -1
  294. data/spec/support/image with spaces.png +0 -0
  295. data/vendor/assets/javascripts/jquery_plugins/jquery.Jcrop.min.js +18 -18
  296. data/vendor/assets/javascripts/jquery_plugins/{jquery.dialogextend.1_0_1.js → jquery.dialogextend.js} +25 -17
  297. data/vendor/assets/javascripts/jquery_plugins/jquery.scrollTo.min.js +7 -0
  298. data/vendor/assets/javascripts/jquery_plugins/jquery.ui.tabspaging.js +7 -7
  299. data/vendor/assets/javascripts/keymage.min.js +6 -0
  300. data/vendor/assets/javascripts/spin.min.js +1 -0
  301. metadata +122 -124
  302. data/app/assets/images/alchemy/ajax_loader.gif +0 -0
  303. data/app/assets/images/alchemy/gui/toggle.png +0 -0
  304. data/app/assets/images/alchemy/image_loader.gif +0 -0
  305. data/app/assets/images/alchemy/shading.png +0 -0
  306. data/app/assets/images/alchemy/tabs.gif +0 -0
  307. data/app/assets/javascripts/alchemy/alchemy.base.js +0 -172
  308. data/app/assets/javascripts/alchemy/alchemy.datepicker.js +0 -47
  309. data/app/assets/javascripts/alchemy/alchemy.element_editor_selector.js +0 -91
  310. data/app/assets/javascripts/alchemy/alchemy.growler.js +0 -46
  311. data/app/assets/javascripts/alchemy/alchemy.image_cropper.js +0 -60
  312. data/app/assets/javascripts/alchemy/alchemy.js_extensions.js +0 -15
  313. data/app/assets/javascripts/alchemy/alchemy.preview_window.js +0 -97
  314. data/app/assets/javascripts/alchemy/alchemy.windows.js +0 -321
  315. data/app/models/alchemy/clipboard_spec.rb +0 -0
  316. data/app/views/alchemy/admin/pictures/show_in_window.html.erb +0 -8
  317. data/app/views/alchemy/notifications/registered_user_created.text.erb +0 -11
  318. data/db/migrate/20121121162313_switch_from_fleximage_to_dragonfly.rb +0 -21
  319. data/db/migrate/20121205155004_create_alchemy_sites.rb +0 -14
  320. data/db/migrate/20121211163003_add_public_to_alchemy_sites.rb +0 -6
  321. data/db/migrate/20121220102223_add_aliases_to_site.rb +0 -6
  322. data/db/migrate/20130110212411_create_alchemy_legacy_page_urls.rb +0 -11
  323. data/db/migrate/20130121092645_migrate_to_devise.rb +0 -24
  324. data/spec/alchemy_spec.rb +0 -7
  325. data/spec/dummy/db/migrate/20121121162313_switch_from_fleximage_to_dragonfly.rb +0 -21
  326. data/spec/dummy/db/migrate/20121205155004_create_alchemy_sites.rb +0 -14
  327. data/spec/dummy/db/migrate/20121211163003_add_public_to_alchemy_sites.rb +0 -6
  328. data/spec/dummy/db/migrate/20121220102223_add_aliases_to_site.rb +0 -6
  329. data/spec/dummy/db/migrate/20130110212411_create_alchemy_legacy_page_urls.rb +0 -11
  330. data/spec/dummy/db/migrate/20130121092645_migrate_to_devise.rb +0 -24
  331. data/vendor/assets/javascripts/jquery_plugins/jquery.scrollTo-1.4.2-min.js +0 -11
@@ -6,15 +6,15 @@ module Alchemy
6
6
 
7
7
  def index
8
8
  @elements = Element.trashed
9
- @page = Page.find_by_id(params[:page_id])
9
+ @page = Page.find(params[:page_id])
10
10
  @allowed_elements = Element.all_for_page(@page)
11
11
  @draggable_trash_items = {}
12
12
  @elements.each { |e| @draggable_trash_items["element_#{e.id}"] = e.belonging_cellnames(@page) }
13
- render :layout => false
13
+ render layout: !request.xhr?
14
14
  end
15
15
 
16
16
  def clear
17
- @page = Page.find_by_id(params[:page_id])
17
+ @page = Page.find(params[:page_id])
18
18
  @elements = Element.trashed
19
19
  @elements.map(&:destroy)
20
20
  end
@@ -1,12 +1,16 @@
1
1
  module Alchemy
2
2
  module Admin
3
- class UsersController < Alchemy::Admin::BaseController
3
+ class UsersController < ResourcesController
4
4
 
5
5
  filter_access_to [:edit, :update, :destroy], :attribute_check => true, :load_method => :load_user, :model => Alchemy::User
6
6
  filter_access_to [:index, :new, :create], :attribute_check => false
7
7
 
8
8
  before_filter :set_roles_and_genders, :except => [:index, :destroy]
9
9
 
10
+ handles_sortable_columns do |c|
11
+ c.default_sort_value = :login
12
+ end
13
+
10
14
  def index
11
15
  if !params[:query].blank?
12
16
  users = User.where([
@@ -19,12 +23,7 @@ module Alchemy
19
23
  else
20
24
  users = User.scoped
21
25
  end
22
- @users = users.page(params[:page] || 1).per(per_page_value_for_screen_size).order('login')
23
- end
24
-
25
- def new
26
- @user = User.new
27
- render :layout => false
26
+ @users = users.page(params[:page] || 1).per(per_page_value_for_screen_size).order(sort_order)
28
27
  end
29
28
 
30
29
  def create
@@ -43,10 +42,6 @@ module Alchemy
43
42
  )
44
43
  end
45
44
 
46
- def edit
47
- render :layout => false
48
- end
49
-
50
45
  def update
51
46
  # User is fetched via before filter
52
47
  params[:user].delete(:role) unless permitted_to?(:update_role)
@@ -5,11 +5,11 @@ module Alchemy
5
5
 
6
6
  # sends file inline. i.e. for viewing pdfs/movies in browser
7
7
  def show
8
- send_file(
9
- @attachment.public_filename,
8
+ send_data(
9
+ @attachment.file.data,
10
10
  {
11
- :name => @attachment.filename,
12
- :type => @attachment.content_type,
11
+ :filename => @attachment.file_name,
12
+ :type => @attachment.file_mime_type,
13
13
  :disposition => 'inline'
14
14
  }
15
15
  )
@@ -17,11 +17,10 @@ module Alchemy
17
17
 
18
18
  # sends file as attachment. aka download
19
19
  def download
20
- send_file(
21
- @attachment.full_filename, {
22
- :name => @attachment.filename,
23
- :type => @attachment.content_type,
24
- :disposition => 'attachment'
20
+ send_data(
21
+ @attachment.file.data, {
22
+ :filename => @attachment.file_name,
23
+ :type => @attachment.file_mime_type
25
24
  }
26
25
  )
27
26
  end
@@ -10,18 +10,13 @@ module Alchemy
10
10
  before_filter :set_language
11
11
  before_filter :mailer_set_url_options
12
12
  before_filter :store_user_request_time
13
+ before_filter :set_authorization_user
13
14
 
14
15
  helper_method :current_server, :current_site, :multi_site?
15
16
 
16
17
  # Returns a host string with the domain the app is running on.
17
18
  def current_server
18
- # For local development server
19
- if request.port != 80
20
- "#{request.protocol}#{request.host}:#{request.port}"
21
- # For remote production server
22
- else
23
- "#{request.protocol}#{request.host}"
24
- end
19
+ "#{request.protocol}#{request.host_with_port}"
25
20
  end
26
21
 
27
22
  # Returns the configuratin value of given key.
@@ -64,6 +59,12 @@ module Alchemy
64
59
  Site.current = current_site
65
60
  end
66
61
 
62
+ # Stores the current_user for declarative_authorization
63
+ #
64
+ def set_authorization_user
65
+ Authorization.current_user = current_user
66
+ end
67
+
67
68
  # Sets Alchemy's GUI translation to users preffered language and stores it in the session.
68
69
  #
69
70
  # Guesses the language from browser locale. If not successful it takes the default.
@@ -203,9 +204,7 @@ module Alchemy
203
204
 
204
205
  def permission_denied
205
206
  if current_user
206
- if current_user.role == 'registered'
207
- redirect_to alchemy.root_path
208
- else
207
+ if permitted_to? :index_alchemy_admin_dashboard
209
208
  if request.referer == alchemy.login_url
210
209
  render :file => Rails.root.join('public/422'), :status => 422
211
210
  elsif request.xhr?
@@ -221,6 +220,8 @@ module Alchemy
221
220
  flash[:error] = _t('You are not authorized')
222
221
  redirect_to alchemy.admin_dashboard_path
223
222
  end
223
+ else
224
+ redirect_to alchemy.root_path
224
225
  end
225
226
  else
226
227
  flash[:info] = _t('Please log in')
@@ -233,5 +234,11 @@ module Alchemy
233
234
  end
234
235
  end
235
236
 
237
+ # Logs the current exception to the error log.
238
+ def exception_logger(e)
239
+ Rails.logger.error("\n#{e.class} #{e.message} in #{e.backtrace.first}")
240
+ Rails.logger.error(e.backtrace[1..50].each { |l| l.gsub(/#{Rails.root.to_s}/, '') }.join("\n"))
241
+ end
242
+
236
243
  end
237
244
  end
@@ -98,8 +98,8 @@ module Alchemy
98
98
  @page ||= load_page
99
99
  if User.admins.count == 0 && @page.nil?
100
100
  redirect_to signup_path
101
- elsif @page.nil? && legacy_url = LegacyPageUrl.where(urlname: params[:urlname]).last
102
- @page = legacy_url.page
101
+ elsif @page.nil? && last_legacy_url
102
+ @page = last_legacy_url.page
103
103
  redirect_page
104
104
  elsif @page.blank?
105
105
  raise_not_found_error
@@ -113,12 +113,6 @@ module Alchemy
113
113
  redirect_page
114
114
  elsif !multi_language? && !params[:lang].blank?
115
115
  redirect_page
116
- elsif configuration(:url_nesting) && url_levels.any? && !levels_are_in_page_branch?
117
- raise_not_found_error
118
- elsif configuration(:url_nesting) && should_be_nested? && !url_levels.any?
119
- redirect_page(params_for_nested_url)
120
- elsif !configuration(:url_nesting) && url_levels.any?
121
- redirect_page
122
116
  elsif @page.has_controller?
123
117
  redirect_to main_app.url_for(@page.controller_and_action)
124
118
  else
@@ -152,22 +146,16 @@ module Alchemy
152
146
 
153
147
  def additional_params
154
148
  params.each do |key, value|
155
- params[key] = nil if ["action", "controller", "urlname", "lang", "level1", "level2", "level3"].include?(key)
149
+ params[key] = nil if ["action", "controller", "urlname", "lang"].include?(key)
156
150
  end
157
151
  end
158
152
 
159
- def url_levels
160
- params.keys.grep(/^level[1-3]$/)
161
- end
162
-
163
- def levels_are_in_page_branch?
164
- nested_urlnames = breadcrumb(@page).collect(&:urlname)
165
- level_names = params.select { |k, v| url_levels.include?(k) }.map(&:second)
166
- level_names & nested_urlnames == level_names
153
+ def legacy_urls
154
+ LegacyPageUrl.joins(:page).where(urlname: params[:urlname], alchemy_pages: {language_id: session[:language_id]})
167
155
  end
168
156
 
169
- def should_be_nested?
170
- !params_for_nested_url.blank?
157
+ def last_legacy_url
158
+ legacy_urls.last
171
159
  end
172
160
 
173
161
  end
@@ -1,12 +1,16 @@
1
1
  module Alchemy
2
2
  class PasswordsController < Devise::PasswordsController
3
+ include Alchemy::FerretSearch
4
+ helper 'Alchemy::Admin::Base', 'Alchemy::Pages'
3
5
 
4
6
  before_filter { enforce_ssl if ssl_required? && !request.ssl? }
5
7
  before_filter :set_translation
6
8
 
7
- layout 'alchemy/admin'
9
+ layout 'alchemy/login'
8
10
 
9
- helper 'Alchemy::Admin::Base'
11
+ def new
12
+ build_resource(email: params[:email])
13
+ end
10
14
 
11
15
  private
12
16
 
@@ -19,5 +23,13 @@ module Alchemy
19
23
  alchemy.edit_password_url(options)
20
24
  end
21
25
 
26
+ def after_sign_in_path_for(resource_or_scope)
27
+ if permitted_to?(:index, :alchemy_admin_dashboard)
28
+ alchemy.admin_dashboard_path
29
+ else
30
+ alchemy.root_path
31
+ end
32
+ end
33
+
22
34
  end
23
- end
35
+ end
@@ -1,13 +1,14 @@
1
1
  module Alchemy
2
2
  class UserSessionsController < Devise::SessionsController
3
+ # Necessary because this controller is also used for general login.
4
+ include Alchemy::FerretSearch
5
+ helper 'Alchemy::Admin::Base', 'Alchemy::Pages'
3
6
 
4
7
  before_filter { enforce_ssl if ssl_required? && !request.ssl? }
5
8
  before_filter :set_translation
6
9
  before_filter :check_user_count, :only => :new
7
10
 
8
- layout 'alchemy/admin'
9
-
10
- helper 'Alchemy::Admin::Base'
11
+ layout 'alchemy/login'
11
12
 
12
13
  def new
13
14
  super
@@ -30,7 +31,7 @@ module Alchemy
30
31
  end
31
32
 
32
33
  def leave
33
- render :layout => false
34
+ render layout: !request.xhr?
34
35
  end
35
36
 
36
37
  def destroy
@@ -12,7 +12,7 @@ module Alchemy
12
12
 
13
13
  def new
14
14
  @signup = true
15
- @user = User.new(:role => 'admin')
15
+ @user = User.new(:roles => 'admin')
16
16
  end
17
17
 
18
18
  def create
@@ -2,8 +2,8 @@ module Alchemy
2
2
  module Admin
3
3
  module AttachmentsHelper
4
4
 
5
- def mime_to_human mime
6
- Alchemy::I18n.t(mime, :scope => :mime_types, :default => _t('document'))
5
+ def mime_to_human(mime)
6
+ I18n.t(mime, scope: 'mime_types', default: _t(:document))
7
7
  end
8
8
 
9
9
  end
@@ -11,6 +11,7 @@ module Alchemy
11
11
  # * link_to_confirmation_window
12
12
  #
13
13
  module BaseHelper
14
+ include Alchemy::BaseHelper
14
15
 
15
16
  # This helper renders the link for an overlay window.
16
17
  #
@@ -32,17 +33,13 @@ module Alchemy
32
33
  :resizable => false
33
34
  }
34
35
  options = default_options.merge(options)
35
- size = options[:size].to_s.split('x')
36
+ size = options.delete(:size).to_s.split('x')
36
37
  link_to(content, url,
37
38
  html_options.merge(
38
- 'data-alchemy-overlay' => {
39
- :size_x => size && size[0] ? size[0] : 'auto',
40
- :size_y => size && size[1] ? size[1] : 'auto',
41
- :resizable => options[:resizable],
42
- :modal => options[:modal],
43
- :overflow => options[:overflow],
44
- :title => options[:title]
45
- }.to_json
39
+ 'data-alchemy-overlay' => options.update(
40
+ :width => size && size[0] ? size[0] : 'auto',
41
+ :height => size && size[1] ? size[1] : 'auto',
42
+ ).to_json
46
43
  )
47
44
  )
48
45
  end
@@ -82,30 +79,25 @@ module Alchemy
82
79
  end
83
80
  end
84
81
 
85
- # Used by Alchemy to display a javascript driven filter for lists in the Alchemy cockpit.
86
- def js_filter_field options = {}
87
- default_options = {
88
- :class => "thin_border js_filter_field",
89
- :onkeyup => "Alchemy.ListFilter('#contact_list li')",
90
- :id => "search_field"
91
- }
92
- options = default_options.merge(options)
93
- options[:onkeyup] << "; jQuery('##{options[:id]}').val().length >= 1 ? jQuery('.js_filter_field_clear').show() : jQuery('.js_filter_field_clear').hide();"
94
- filter_field = '<div class="js_filter_field_box">'
95
- filter_field << text_field_tag("filter", '', options)
96
- filter_field << content_tag('span', '', :class => 'icon search')
97
- filter_field << link_to('', '#', {
98
- :onclick => "jQuery('##{options[:id]}').val(''); #{options[:onkeyup]}",
99
- :class => "js_filter_field_clear",
100
- :style => "display: none",
101
- :title => _t("click_to_show_all")
102
- })
103
- filter_field << %(<label for="#{options[:id]}">#{_t(:search)}</label>)
104
- filter_field << '</div>'
105
- filter_field.html_safe
106
- end
107
-
108
- # Returns a link that opens a modal confirmation window.
82
+ # Used by Alchemy to display a javascript driven filter for lists.
83
+ #
84
+ # @param [String] a jquery compatible selector string that represents the items to filter
85
+ # @param [Hash] html options passed to the input field
86
+ #
87
+ def js_filter_field(items, options = {})
88
+ options = {
89
+ class: 'js_filter_field',
90
+ data: {'alchemy-list-filter' => items}
91
+ }.merge(options)
92
+ content_tag(:div, class: 'js_filter_field_box') do
93
+ concat text_field_tag(nil, nil, options)
94
+ concat content_tag('span', '', class: 'icon search')
95
+ concat link_to('', '', class: 'js_filter_field_clear', title: _t(:click_to_show_all))
96
+ concat content_tag(:label, _t(:search), for: options[:id])
97
+ end
98
+ end
99
+
100
+ # Returns a link that opens a modal confirmation to delete window.
109
101
  #
110
102
  # === Parameters:
111
103
  #
@@ -122,7 +114,7 @@ module Alchemy
122
114
  link_to(link_string, url,
123
115
  html_options.merge(
124
116
  'data-alchemy-confirm-delete' => {
125
- :title => _t("please_confirm"),
117
+ :title => _t(:please_confirm),
126
118
  :message => message,
127
119
  :ok_label => _t("Yes"),
128
120
  :cancel_label => _t("No")
@@ -131,6 +123,35 @@ module Alchemy
131
123
  )
132
124
  end
133
125
 
126
+ # Returns a form and a button that opens a modal confirm window.
127
+ #
128
+ # After confirmation it proceeds to send the form's action.
129
+ #
130
+ # === Parameters:
131
+ #
132
+ # 1. The content inside the <a> tag
133
+ # 2. The url that gets opened after confirmation
134
+ # 3. Options for the Alchemy confirm overlay (See: app/assets/javascripts/alchemy/alchemy.window.js#openConfirmWindow)
135
+ # 4. HTML options that get passed to the button_tag helper.
136
+ #
137
+ # NOTE: The method option in the html_options hash gets passed to the form_tag helper!
138
+ #
139
+ # === Example:
140
+ #
141
+ # <%= button_with_confirm('pay', '/admin/orders/1/pay', message: 'Do you really want to mark this order as payed?') %>
142
+ #
143
+ def button_with_confirm(value = "", url = "", options = {}, html_options = {})
144
+ options = {
145
+ message: _t(:confirm_to_proceed),
146
+ ok_label: _t("Yes"),
147
+ title: _t(:please_confirm),
148
+ cancel_label: _t("No")
149
+ }.merge(options)
150
+ form_tag url, {method: html_options.delete(:method)} do
151
+ button_tag value, html_options.merge('data-alchemy-confirm' => options.to_json)
152
+ end
153
+ end
154
+
134
155
  # Returns an Array build for passing it to the options_for_select helper inside an essence editor partial.
135
156
  # Usefull for the select_values options from the render_essence_editor helpers.
136
157
  #
@@ -192,7 +213,7 @@ module Alchemy
192
213
  content = element.contents[content - 1]
193
214
  end
194
215
  if content.essence.nil?
195
- return warning('Element', _t('content_essence_not_found'))
216
+ return warning('Element', _t(:content_essence_not_found))
196
217
  end
197
218
  select_options = options_for_select(select_options, content.essence.content)
198
219
  select_tag(
@@ -336,6 +357,7 @@ module Alchemy
336
357
  # :label [String] # Text for button label.
337
358
  # :url [String] # Url for link.
338
359
  # :title [String] # Text for title tag.
360
+ # :hotkey [String] # Keyboard shortcut for this button. I.E 'alt-n'
339
361
  # :overlay [Boolean] # Pass true to open the link in a modal overlay window.
340
362
  # :overlay_options [Hash] # Overlay options. See link_to_overlay_window helper.
341
363
  # :if_permitted_to [Array] # Check permission for button. [:action, :controller]. Exactly how you defined the permission in your +authorization_rules.rb+. Defaults to controller and action from button url.
@@ -361,11 +383,12 @@ module Alchemy
361
383
  options[:overlay_options],
362
384
  {
363
385
  :class => 'icon_button',
364
- :title => options[:title]
365
- }
386
+ :title => options[:title],
387
+ 'data-alchemy-hotkey' => options[:hotkey]
388
+ }.merge(options[:link_options])
366
389
  )
367
390
  else
368
- link_to options[:url], {:class => "icon_button#{options[:loading_indicator] ? ' please_wait' : nil}", :title => options[:title]}.merge(options[:link_options]) do
391
+ link_to options[:url], {:class => ("icon_button#{options[:loading_indicator] ? ' please_wait' : nil}"), :title => options[:title], 'data-alchemy-hotkey' => options[:hotkey]}.merge(options[:link_options]) do
369
392
  render_icon(options[:icon])
370
393
  end
371
394
  end
@@ -427,7 +450,7 @@ module Alchemy
427
450
  # NOTE: Alchemy gives you a local variable named like your resource
428
451
  #
429
452
  def render_resources
430
- render :partial => resource_model_name, :collection => resources_instance_variable
453
+ render :partial => resource_name, :collection => resources_instance_variable
431
454
  rescue ActionView::MissingTemplate
432
455
  render :partial => 'resource', :collection => resources_instance_variable
433
456
  end
@@ -488,57 +511,6 @@ module Alchemy
488
511
  current_params.merge(p).delete_if { |k, v| v.blank? }
489
512
  end
490
513
 
491
- # Checks if the pictures tag-filter contains the given tag
492
- def pictures_filtered_by_tag?(tag)
493
- if params[:tagged_with].present?
494
- tags = params[:tagged_with].split(',')
495
- tags.include?(tag.name)
496
- else
497
- false
498
- end
499
- end
500
-
501
- # Adds the given tag to the pictures tag-filter
502
- def add_to_picture_tag_filter(tag)
503
- if params[:tagged_with].present?
504
- tags = params[:tagged_with].split(',')
505
- tags << tag.name
506
- else
507
- [tag.name]
508
- end
509
- end
510
-
511
- # Removes the given tag from the pictures tag-filter
512
- def remove_from_picture_tag_filter(tag)
513
- if params[:tagged_with].present?
514
- tags = params[:tagged_with].split(',')
515
- tags.delete_if { |t| t == tag.name }
516
- else
517
- []
518
- end
519
- end
520
-
521
- # Returns the picture tag-filter from params.
522
- # A tag can be added to the filter.
523
- # A tag can also be removed.
524
- #
525
- # Options are:
526
- # * options (Hash):
527
- # ** :add (ActsAsTaggableOn::Tag) - The tag that should be added to the tag-filter
528
- # ** :remove (ActsAsTaggableOn::Tag) - The tag that should be removed from the tag-filter
529
- def picture_tag_filter(options={})
530
- case
531
- when options[:add]
532
- taglist = add_to_picture_tag_filter(options[:add]) if options[:add]
533
- when options[:remove]
534
- taglist = remove_from_picture_tag_filter(options[:remove]) if options[:remove]
535
- else
536
- return params[:tagged_with]
537
- end
538
- return nil if taglist.blank?
539
- taglist.uniq.join(',')
540
- end
541
-
542
514
  def render_hint_for(element)
543
515
  return unless element.has_hint?
544
516
  link_to '#', :class => 'hint' do