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
@@ -0,0 +1,35 @@
1
+ window.Alchemy = {} if typeof(window.Alchemy) is 'undefined'
2
+
3
+ Alchemy.Spinner =
4
+
5
+ DEFAULTS:
6
+ lines: 5
7
+ corners: 0.75
8
+ rotate: 54
9
+ trail: 75
10
+ speed: 1.25
11
+ hwaccel: true
12
+
13
+ small: (opts) ->
14
+ defaults = $.extend({}, Alchemy.Spinner.DEFAULTS,
15
+ length: 2
16
+ width: 3
17
+ radius: 2
18
+ )
19
+ new Spinner($.extend(defaults, opts))
20
+
21
+ medium: (opts) ->
22
+ defaults = $.extend({}, Alchemy.Spinner.DEFAULTS,
23
+ length: 4
24
+ width: 6
25
+ radius: 4
26
+ )
27
+ new Spinner($.extend(defaults, opts))
28
+
29
+ large: (opts) ->
30
+ defaults = $.extend({}, Alchemy.Spinner.DEFAULTS,
31
+ length: 8
32
+ width: 12
33
+ radius: 8
34
+ )
35
+ new Spinner($.extend(defaults, opts))
@@ -0,0 +1,11 @@
1
+ String::beginsWith = (t, i) ->
2
+ if i is false
3
+ t is @substring(0, t.length)
4
+ else
5
+ t.toLowerCase() is @substring(0, t.length).toLowerCase()
6
+
7
+ String::endsWith = (t, i) ->
8
+ if i is false
9
+ t is @substring(@length - t.length)
10
+ else
11
+ t.toLowerCase() is @substring(@length - t.length).toLowerCase()
@@ -0,0 +1,278 @@
1
+ # This module holds methods for all kind of overlay windows in Alchemy
2
+
3
+ window.Alchemy = {} if typeof(window.Alchemy) is 'undefined'
4
+
5
+ $.extend Alchemy,
6
+
7
+ # Returns a HTML div container with a spinner inside made with spin.js
8
+ #
9
+ # Options:
10
+ #
11
+ # width: 400 - The width of the spinner container (Number)
12
+ # height: 300 - The height of the spinner container (Number)
13
+ #
14
+ getOverlaySpinner: (opts) ->
15
+ options = {width: 400, height: 300}
16
+ $.extend(options, opts)
17
+ $spinner_container = $('<div class="spinner_container"/>').css(
18
+ width: options.width
19
+ height: options.height
20
+ )
21
+ spinner = Alchemy.Spinner.medium(
22
+ top: options.height / 2 - 8 + "px"
23
+ left: options.width / 2 - 8 + "px"
24
+ )
25
+ spinner.spin $spinner_container[0]
26
+ $spinner_container
27
+
28
+ # Display a error message for dialogs
29
+ # Used by Alchemy.openWindow if errors happen
30
+ AjaxErrorHandler: ($dialog, status, textStatus, errorThrown) ->
31
+ $div = $('<div class="with_padding" />')
32
+ $errorDiv = $("<div id=\"errorExplanation\" class=\"ajax_status_code_#{status}\" />")
33
+ $dialog.html $div
34
+ $div.append $errorDiv
35
+ if status is 0
36
+ $errorDiv.append "<h2>The server does not respond.</h2>"
37
+ $errorDiv.append "<p>Please check server and try again.</p>"
38
+ else
39
+ $errorDiv.append "<h2>" + errorThrown + " (" + status + ")</h2>"
40
+ $errorDiv.append "<p>Please check log and try again.</p>"
41
+
42
+ # Opens a confirm window
43
+ #
44
+ # Options:
45
+ #
46
+ # title: '' - The title of the overlay window (String)
47
+ # message: '' - The message that will be displayed to the user (String)
48
+ # cancelLabel: '' - The label of the cancel button (String)
49
+ # okLabel: '' - The label of the ok button (String)
50
+ # okCallback: null - The function to invoke on confirmation (Function)
51
+ #
52
+ openConfirmWindow: (options = {}) ->
53
+ $confirmation = $('<div style="display: none" id="alchemyConfirmation" />')
54
+ $confirmation.appendTo "body"
55
+ $confirmation.html "<p>" + options.message + "</p>"
56
+ Alchemy.ConfirmationWindow = $confirmation.dialog
57
+ resizable: false
58
+ minHeight: 100
59
+ minWidth: 300
60
+ modal: true
61
+ title: options.title
62
+ show: "fade"
63
+ hide: "fade"
64
+ buttons: [
65
+ {
66
+ text: options.cancelLabel,
67
+ click: ->
68
+ $(this).dialog "close"
69
+ Alchemy.Buttons.enable()
70
+ return
71
+ },
72
+ {
73
+ text: options.okLabel,
74
+ click: ->
75
+ $(this).dialog "close"
76
+ options.okCallback()
77
+ return
78
+ }
79
+ ]
80
+ open: ->
81
+ Alchemy.Buttons.observe "#alchemyConfirmation"
82
+ close: ->
83
+ $("#alchemyConfirmation").remove()
84
+
85
+ # Opens a confirm to delete window
86
+ #
87
+ # Arguments:
88
+ #
89
+ # url - The url to the server delete action. Uses DELETE as HTTP method. (String)
90
+ # opts - An options object (Object)
91
+ #
92
+ # Options:
93
+ #
94
+ # title: '' - The title of the confirmation window (String)
95
+ # message: '' - The message that will be displayed to the user (String)
96
+ # okLabel: '' - The label for the ok button (String)
97
+ # cancelLabel: '' - The label for the cancel button (String)
98
+ #
99
+ confirmToDeleteWindow: (url, opts) ->
100
+ options =
101
+ title: ''
102
+ message: ''
103
+ okLabel: ''
104
+ cancelLabel: ''
105
+ $.extend(options, opts)
106
+ Alchemy.openConfirmWindow
107
+ message: options.message
108
+ title: options.title
109
+ okLabel: options.okLabel
110
+ cancelLabel: options.cancelLabel
111
+ okCallback: ->
112
+ Alchemy.pleaseWaitOverlay()
113
+ $.ajax
114
+ url: url
115
+ type: "DELETE"
116
+
117
+ # Opens a new dialog window
118
+ #
119
+ # Arguments are:
120
+ #
121
+ # url: the url to query to get the window body (String)
122
+ # opts: An options object that holds all additional options (Object)
123
+ #
124
+ # Options are:
125
+ #
126
+ # title: '' - The title for the overlay window (String)
127
+ # width: 400 - The width of the window (Number)
128
+ # height: 300 - The height of the window (Number)
129
+ # resizable: false - Make the overlay resizable (Boolean)
130
+ # modal: true - Make the window a modal dialog (Boolean)
131
+ # close_on_escape: true - Should the overlay close on escape key (Boolean)
132
+ # overflow: true - Display overflowing content, or show scrollbars (Boolean)
133
+ # image_loader: true - Init the image loader after opening the dialog (Boolean)
134
+ #
135
+ openWindow: (url, opts) ->
136
+ options =
137
+ title: ''
138
+ width: 400
139
+ height: 300
140
+ resizable: false
141
+ modal: true
142
+ overflow: true
143
+ image_loader: true
144
+ close_on_escape: true
145
+ image_loader_color: '#fff'
146
+ $.extend(options, opts)
147
+ if options.width is "fullscreen"
148
+ options.width = $(window).width() - 50
149
+ options.height = $(window).height() - 50
150
+ $dialog = $('<div style="display: none" class="alchemy_overlay" />')
151
+ $dialog.appendTo "body"
152
+ $dialog.html Alchemy.getOverlaySpinner
153
+ width: (if options.width is "auto" then 400 else options.width)
154
+ height: (if options.height is "auto" then 300 else options.height)
155
+ Alchemy.CurrentWindow = $dialog.dialog
156
+ modal: options.modal
157
+ minWidth: (if options.width is "auto" then 400 else options.width)
158
+ minHeight: (if options.height is "auto" then 300 else options.height)
159
+ maxHeight: options.maxHeight
160
+ title: options.title
161
+ resizable: options.resizable
162
+ show: "fade"
163
+ hide: "fade"
164
+ closeOnEscape: options.close_on_escape
165
+ open: (event, ui) ->
166
+ $.ajax
167
+ url: url
168
+ success: (data, textStatus, XMLHttpRequest) ->
169
+ widget = $dialog.dialog("widget")
170
+ $dialog.html(data)
171
+ $dialog.css(overflow: (if options.overflow then "visible" else "auto"))
172
+ widget.css(overflow: (if options.overflow then "visible" else "hidden"))
173
+ if options.width is "auto"
174
+ widget.css left: (($(window).width() / 2) - ($dialog.width() / 2))
175
+ if options.height is "auto"
176
+ widget.css top: ($(window).height() - $dialog.dialog("widget").height()) / 2
177
+ Alchemy.GUI.init Alchemy.CurrentWindow
178
+ if options.image_loader
179
+ Alchemy.ImageLoader Alchemy.CurrentWindow, {color: options.image_loader_color}
180
+ error: (XMLHttpRequest, textStatus, errorThrown) ->
181
+ Alchemy.AjaxErrorHandler $dialog, XMLHttpRequest.status, textStatus, errorThrown
182
+ complete: (jqXHR, textStatus) ->
183
+ Alchemy.Buttons.enable()
184
+ close: ->
185
+ $dialog.remove()
186
+
187
+ # Closes the current dialog
188
+ closeCurrentWindow: ->
189
+ if Alchemy.CurrentWindow
190
+ Alchemy.CurrentWindow.dialog "close"
191
+ Alchemy.CurrentWindow = null
192
+ else
193
+ $(".alchemy_overlay").dialog "close"
194
+ true
195
+
196
+ # Opens an image in an overlay
197
+ # Used by the picture library
198
+ zoomImage: (url, title, width, height) ->
199
+ $doc_width = $(window).width()
200
+ $doc_height = $(window).height()
201
+ if width > $doc_width
202
+ width = 'fullscreen'
203
+ if height > $doc_height
204
+ height = $doc_height
205
+ Alchemy.openWindow url,
206
+ width: width
207
+ height: height
208
+ maxHeight: height
209
+ title: title
210
+ overflow: false
211
+ modal: false
212
+ image_loader_color: '#000'
213
+
214
+ # Trash window methods
215
+ TrashWindow:
216
+
217
+ # Opens the trash window
218
+ open: (page_id, title) ->
219
+ Alchemy.TrashWindow.current = Alchemy.openWindow(
220
+ Alchemy.routes.admin_trash_path(page_id),
221
+ title: title,
222
+ width: 380,
223
+ height: 450,
224
+ maxHeight: $(window).height() - 50,
225
+ modal: false
226
+ )
227
+
228
+ # Refreshes the trash window
229
+ refresh: (page_id) ->
230
+ if Alchemy.TrashWindow.current
231
+ Alchemy.TrashWindow.current.html Alchemy.getOverlaySpinner(width: 380, height: 270)
232
+ $.get Alchemy.routes.admin_trash_path(page_id), (html) ->
233
+ Alchemy.TrashWindow.current.html html
234
+
235
+ # Adds onClick events for Alchemy overlays
236
+ #
237
+ # Elements are all links that have a data-alchemy-overlay or data-alchemy-confirm-delete
238
+ # and all input/buttons that have a data-alchemy-confirm attribute.
239
+ #
240
+ # Arguments:
241
+ #
242
+ # You can pass a scope so that only elements inside this scope are queried
243
+ #
244
+ # The observer takes the href attribute as url for the overlay window.
245
+ #
246
+ # See Alchemy.openWindow for further options you can add to the data attribute
247
+ #
248
+ overlayObserver: (scope) ->
249
+ $("a[data-alchemy-overlay]", scope).click (event) ->
250
+ $this = $(this)
251
+ options = $this.data("alchemy-overlay")
252
+ event.preventDefault()
253
+ Alchemy.openWindow $this.attr("href"), options
254
+ false
255
+ $("a[data-alchemy-confirm-delete]", scope).click (event) ->
256
+ $this = $(this)
257
+ options = $this.data("alchemy-confirm-delete")
258
+ event.preventDefault()
259
+ Alchemy.confirmToDeleteWindow $this.attr("href"),
260
+ title: options.title,
261
+ message: options.message,
262
+ okLabel: options.ok_label,
263
+ cancelLabel: options.cancel_label
264
+ false
265
+ $("input[data-alchemy-confirm], button[data-alchemy-confirm]", scope).click (event) ->
266
+ $this = $(this)
267
+ self = this
268
+ options = $this.data("alchemy-confirm")
269
+ event.preventDefault()
270
+ Alchemy.openConfirmWindow $.extend(options,
271
+ okLabel: options.okLabel || options.ok_label, #hmpf
272
+ cancelLabel: options.cancelLabel || options.cancel_label, #hmpf
273
+ okCallback: ->
274
+ Alchemy.pleaseWaitOverlay()
275
+ self.form.submit()
276
+ return
277
+ )
278
+ false
@@ -2,6 +2,7 @@
2
2
  * -------------------------------
3
3
  *= require_self
4
4
  */
5
+
5
6
  @import "alchemy/defaults";
6
7
  @import "alchemy/base";
7
8
  @import "alchemy/toolbar";
@@ -13,6 +14,7 @@
13
14
  @import "alchemy/form_elements";
14
15
  @import "alchemy/frame";
15
16
  @import "alchemy/icons";
17
+ @import "alchemy/fonts";
16
18
  @import "alchemy/login";
17
19
  @import "alchemy/modules";
18
20
  @import "alchemy/notices";
@@ -14,6 +14,17 @@ div#image_assign_filter_and_image_sizing {
14
14
  }
15
15
  }
16
16
 
17
+ #zoomed_picture_background {
18
+ text-align: center;
19
+ width: 100%;
20
+ height: 100%;
21
+ position: absolute;
22
+
23
+ .zoomed_picture {
24
+ max-height: 99%;
25
+ }
26
+ }
27
+
17
28
  .picture_thumbnail {
18
29
  padding: $default-padding;
19
30
  margin: 2px 1px 2px 2px;
@@ -23,10 +34,10 @@ div#image_assign_filter_and_image_sizing {
23
34
  display: inline-block;
24
35
  border: 1px solid #c0c0c0;
25
36
  position: relative;
26
- @include rounded-corner;
37
+ @extend .rounded-border;
27
38
 
28
39
  .thumbnail_background {
29
- @include thumbnail-background;
40
+ @extend %thumbnail-background;
30
41
  width: 160px;
31
42
  height: 120px;
32
43
  }
@@ -59,16 +70,6 @@ div#image_assign_filter_and_image_sizing {
59
70
  width: 80px;
60
71
  height: 60px;
61
72
  }
62
-
63
- .image_spinner {
64
- height: 60px;
65
- margin: $default-margin;
66
-
67
- img {
68
- top: 14px;
69
- left: 25px;
70
- }
71
- }
72
73
  }
73
74
 
74
75
  &.medium {
@@ -83,16 +84,6 @@ div#image_assign_filter_and_image_sizing {
83
84
  width: 160px;
84
85
  height: 120px;
85
86
  }
86
-
87
- .image_spinner {
88
- height: 120px;
89
- margin: $default-margin;
90
-
91
- img {
92
- top: 42px;
93
- left: 64px;
94
- }
95
- }
96
87
  }
97
88
 
98
89
  &.large {
@@ -107,15 +98,6 @@ div#image_assign_filter_and_image_sizing {
107
98
  width: 240px;
108
99
  height: 180px;
109
100
  }
110
-
111
- .image_spinner {
112
- height: 180px;
113
-
114
- img {
115
- top: 74px;
116
- left: 108px;
117
- }
118
- }
119
101
  }
120
102
 
121
103
  &:hover {
@@ -128,6 +110,7 @@ div#image_assign_filter_and_image_sizing {
128
110
 
129
111
  #pictures {
130
112
  margin-right: 232px;
113
+ padding-bottom: 60px;
131
114
 
132
115
  .picture_thumbnail {
133
116
  margin: 0 8px 8px 0;
@@ -148,29 +131,16 @@ div.assign_image_list_image {
148
131
  text-align: center;
149
132
  overflow: hidden;
150
133
  position: relative;
151
- }
152
-
153
- div.image_spinner {
154
- background-color: $dark-gray;
155
- width: 1px;
156
- margin: $default-margin;
157
134
 
158
135
  img {
159
- position: absolute;
160
- z-index: 0;
161
- top: 32px;
162
- left: 40px;
136
+ border-style: none;
163
137
  }
164
138
  }
165
139
 
166
- #assign_image_list {
140
+ #assign_image_list, #assign_file_list {
167
141
  position: relative;
168
142
  padding-right: 244px;
169
143
  height: 519px;
170
-
171
- div.assign_image_list_image img {
172
- border-style: none;
173
- }
174
144
  }
175
145
 
176
146
  .picture_tool {
@@ -238,7 +208,7 @@ div.image_spinner {
238
208
 
239
209
  div#library_sidebar {
240
210
  @include box-sizing(border-box);
241
- position: absolute;
211
+ position: fixed;
242
212
  border-left: 1px solid $default-border-color;
243
213
  top: 0;
244
214
  right: 0;
@@ -246,7 +216,7 @@ div#library_sidebar {
246
216
  padding-top: 96px;
247
217
  padding: 84px 4*$default-padding 0 4*$default-padding;
248
218
  height: 100%;
249
- z-index: 1;
219
+ z-index: 0;
250
220
  background-color: $light-gray;
251
221
 
252
222
  h2 {
@@ -254,29 +224,60 @@ div#library_sidebar {
254
224
  }
255
225
  }
256
226
 
227
+ .alchemy_overlay #library_sidebar {
228
+ position: absolute;
229
+ }
230
+
257
231
  div#filter_bar {
258
232
 
259
233
  .selectboxit {
260
- width: 192px;
234
+ width: 194px;
261
235
  }
262
236
  }
263
237
 
264
- div#tag_list {
238
+ #tag_list {
265
239
  @include box-sizing(border-box);
266
- height: 80%;
240
+ height: 100%;
241
+ padding-bottom: 138px;
242
+
243
+ &.filtered {
244
+ padding-bottom: 164px;
245
+ }
246
+
247
+ &.with_filter_bar {
248
+ padding-bottom: 218px;
249
+
250
+ &.filtered {
251
+ padding-bottom: 244px;
252
+ }
253
+ }
267
254
 
268
255
  .js_filter_field_box {
256
+ position: absolute;
257
+ right: auto;
258
+ top: auto;
259
+ width: 200px;
260
+ z-index: 1100;
261
+
262
+ input {
263
+ width: 200px;
264
+ background-color: #f8f8f8;
265
+ }
269
266
 
270
- input { width: 200px }
271
267
  label { display: none }
272
268
  }
273
269
 
270
+ .js_filter_field_clear {
271
+ right: 4px;
272
+ }
273
+
274
274
  ul {
275
+ @include box-sizing(border-box);
275
276
  list-style-type: none;
276
277
  padding: 0;
277
- margin: $default-margin 0;
278
- height: 95%;
279
- width: 204px;
278
+ margin: 40px 0 4px 0;
279
+ height: 100%;
280
+ width: 200px;
280
281
  overflow-x: hidden;
281
282
  overflow-y: auto;
282
283
 
@@ -285,19 +286,19 @@ div#tag_list {
285
286
  padding: $default-padding 4*$default-padding $default-padding 6*$default-padding ;
286
287
  margin: 2*$default-margin 0;
287
288
  background-color: $medium-gray;
288
- @include border-radius(16px);
289
- white-space: nowrap;
289
+ @extend .rounded-border;
290
290
  overflow: hidden;
291
291
  position: relative;
292
292
 
293
+ &:first-child { margin-top: 0 }
294
+
293
295
  &:before {
294
- content: '';
295
296
  position: absolute;
296
297
  left: 8px;
297
- top: 7px;
298
- background: url("ui-icons_666666_256x240.png") -242px -100px;
299
- width: 12px;
300
- height: 12px;
298
+ top: 8px;
299
+ font-family: 'Alchemy Icons';
300
+ @extend .icon-tag:before;
301
+ line-height: 10px;
301
302
  }
302
303
 
303
304
  a {
@@ -310,7 +311,7 @@ div#tag_list {
310
311
  &.active {
311
312
  background-color: $dark-gray;
312
313
 
313
- a { color: $light-gray }
314
+ a, &:before { color: $light-gray }
314
315
  }
315
316
  }
316
317
  }
@@ -321,9 +322,27 @@ div#alchemy_window_body {
321
322
  #library_sidebar {
322
323
  padding: 0 4*$default-padding;
323
324
  }
325
+ }
324
326
 
325
- div#tag_list ul {
326
- height: 364px;
327
+ #assign_image_list {
328
+
329
+ #tag_list ul {
330
+ height: 316px;
331
+ }
332
+
333
+ &.filtered #tag_list ul {
334
+ height: 292px;
335
+ }
336
+ }
337
+
338
+ #assign_file_list {
339
+
340
+ #tag_list ul {
341
+ height: 396px;
342
+ }
343
+
344
+ &.filtered #tag_list ul {
345
+ height: 372px;
327
346
  }
328
347
  }
329
348
 
@@ -343,3 +362,28 @@ div#pictures_page_list {
343
362
 
344
363
  li.even, li.odd { padding: $default-padding }
345
364
  }
365
+
366
+ #overlay_file_list {
367
+
368
+ .assign_file_file {
369
+ display: block;
370
+ margin-bottom: 4px;
371
+ }
372
+
373
+ > ul {
374
+ margin: 0;
375
+
376
+ a {
377
+ @extend %text-overflow;
378
+ display: block;
379
+ line-height: 25px;
380
+ text-decoration: none;
381
+ padding: 0px 4px 2px 4px;
382
+ }
383
+
384
+ .icon {
385
+ margin-top: -2px;
386
+ margin-right: 4px;
387
+ }
388
+ }
389
+ }