alchemy_cms 2.2.4 → 2.3.rc5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (215) hide show
  1. data/.gitignore +1 -1
  2. data/.travis.yml +3 -4
  3. data/Gemfile +1 -0
  4. data/README.md +10 -6
  5. data/alchemy_cms.gemspec +5 -2
  6. data/app/assets/images/alchemy/icons.png +0 -0
  7. data/app/assets/images/sassy-ie-overlay.png +0 -0
  8. data/app/assets/javascripts/alchemy/alchemy.base.js +50 -59
  9. data/app/assets/javascripts/alchemy/alchemy.buttons.js +14 -4
  10. data/app/assets/javascripts/alchemy/alchemy.datepicker.js +8 -2
  11. data/app/assets/javascripts/alchemy/alchemy.elements_window.js +11 -3
  12. data/app/assets/javascripts/alchemy/alchemy.gui.js.coffee +1 -1
  13. data/app/assets/javascripts/alchemy/alchemy.link_overlay.js.coffee +14 -1
  14. data/app/assets/javascripts/alchemy/alchemy.preview.js +1 -1
  15. data/app/assets/javascripts/alchemy/alchemy.preview_window.js +12 -4
  16. data/app/assets/javascripts/alchemy/alchemy.uploader.js +4 -1
  17. data/app/assets/javascripts/alchemy/alchemy.windows.js +18 -8
  18. data/app/assets/stylesheets/alchemy/_defaults.scss +84 -120
  19. data/app/assets/stylesheets/alchemy/alchemy.css +2 -2
  20. data/app/assets/stylesheets/alchemy/archive.css.scss +288 -0
  21. data/app/assets/stylesheets/alchemy/base.css.scss +95 -390
  22. data/app/assets/stylesheets/alchemy/dashboard.css.scss +4 -4
  23. data/app/assets/stylesheets/alchemy/elements.css.scss +83 -118
  24. data/app/assets/stylesheets/alchemy/flash.css.scss +1 -1
  25. data/app/assets/stylesheets/alchemy/form_elements.css.scss +528 -0
  26. data/app/assets/stylesheets/alchemy/frame.css.scss +13 -39
  27. data/app/assets/stylesheets/alchemy/icons.css.scss +217 -228
  28. data/app/assets/stylesheets/alchemy/jquery-ui.alchemy.css.scss +48 -50
  29. data/app/assets/stylesheets/alchemy/jquery.Jcrop.css.scss +1 -1
  30. data/app/assets/stylesheets/alchemy/login.css.scss +1 -5
  31. data/app/assets/stylesheets/alchemy/menubar.css.scss +19 -29
  32. data/app/assets/stylesheets/alchemy/pagination.css.scss +3 -4
  33. data/app/assets/stylesheets/alchemy/sitemap.css.scss +81 -81
  34. data/app/assets/stylesheets/alchemy/tables.css.scss +63 -57
  35. data/app/assets/stylesheets/alchemy/tinymce_dialog.css.scss +57 -57
  36. data/app/assets/stylesheets/alchemy/upload.css.scss +6 -6
  37. data/app/assets/stylesheets/tiny_mce/plugins/inlinepopups/skins/alchemy/window.css.scss +6 -10
  38. data/app/controllers/alchemy/admin/attachments_controller.rb +5 -4
  39. data/app/controllers/alchemy/admin/base_controller.rb +1 -9
  40. data/app/controllers/alchemy/admin/contents_controller.rb +4 -6
  41. data/app/controllers/alchemy/admin/elements_controller.rb +2 -2
  42. data/app/controllers/alchemy/admin/pages_controller.rb +2 -2
  43. data/app/controllers/alchemy/admin/pictures_controller.rb +74 -15
  44. data/app/controllers/alchemy/attachments_controller.rb +8 -2
  45. data/app/controllers/alchemy/base_controller.rb +47 -5
  46. data/app/controllers/alchemy/elements_controller.rb +1 -1
  47. data/app/controllers/alchemy/messages_controller.rb +12 -12
  48. data/app/controllers/alchemy/pages_controller.rb +5 -1
  49. data/app/controllers/alchemy/pictures_controller.rb +9 -4
  50. data/app/controllers/alchemy/user_sessions_controller.rb +2 -4
  51. data/app/helpers/alchemy/admin/base_helper.rb +98 -19
  52. data/app/helpers/alchemy/admin/contents_helper.rb +2 -2
  53. data/app/helpers/alchemy/admin/elements_helper.rb +2 -3
  54. data/app/helpers/alchemy/base_helper.rb +6 -5
  55. data/app/helpers/alchemy/elements_helper.rb +2 -2
  56. data/app/helpers/alchemy/essences_helper.rb +4 -5
  57. data/app/helpers/alchemy/pages_helper.rb +15 -79
  58. data/app/helpers/alchemy/url_helper.rb +67 -0
  59. data/app/mailers/alchemy/messages.rb +1 -1
  60. data/app/mailers/alchemy/notifications.rb +1 -1
  61. data/app/models/alchemy/attachment.rb +11 -2
  62. data/app/models/alchemy/cell.rb +20 -10
  63. data/app/models/alchemy/content.rb +4 -3
  64. data/app/models/alchemy/element.rb +170 -178
  65. data/app/models/alchemy/language/code.rb +4 -1
  66. data/app/models/alchemy/message.rb +19 -3
  67. data/app/models/alchemy/page.rb +45 -40
  68. data/app/models/alchemy/picture.rb +24 -2
  69. data/app/models/alchemy/user.rb +2 -3
  70. data/app/views/alchemy/admin/attachments/_archive_overlay.html.erb +12 -12
  71. data/app/views/alchemy/admin/attachments/_attachment.html.erb +1 -1
  72. data/app/views/alchemy/admin/attachments/create.js.erb +1 -0
  73. data/app/views/alchemy/admin/attachments/edit.html.erb +9 -3
  74. data/app/views/alchemy/admin/attachments/index.html.erb +3 -2
  75. data/app/views/alchemy/admin/contents/_missing.html.erb +1 -1
  76. data/app/views/alchemy/admin/contents/create.js.erb +54 -0
  77. data/app/views/alchemy/admin/contents/new.html.erb +9 -4
  78. data/app/views/alchemy/admin/elements/{_add_content.html.erb → _add_picture.html.erb} +4 -4
  79. data/app/views/alchemy/admin/elements/_elements_select.html.erb +2 -1
  80. data/app/views/alchemy/admin/elements/_new_element_form.html.erb +1 -1
  81. data/app/views/alchemy/admin/elements/{_picture_editor.html.erb → _picture_gallery_editor.html.erb} +7 -11
  82. data/app/views/alchemy/admin/elements/fold.js.erb +46 -0
  83. data/app/views/alchemy/admin/elements/index.html.erb +24 -24
  84. data/app/views/alchemy/admin/elements/list.js.erb +11 -9
  85. data/app/views/alchemy/admin/essence_files/assign.js.erb +3 -1
  86. data/app/views/alchemy/admin/essence_pictures/destroy.js.erb +28 -0
  87. data/app/views/alchemy/admin/pages/_contactform_links.html.erb +8 -6
  88. data/app/views/alchemy/admin/pages/_external_link.html.erb +11 -9
  89. data/app/views/alchemy/admin/pages/_file_link.html.erb +10 -8
  90. data/app/views/alchemy/admin/pages/_internal_link.html.erb +14 -10
  91. data/app/views/alchemy/admin/pages/_new_page_form.html.erb +1 -1
  92. data/app/views/alchemy/admin/pages/_page.html.erb +1 -1
  93. data/app/views/alchemy/admin/pages/_page_for_links.html.erb +32 -21
  94. data/app/views/alchemy/admin/pages/configure.html.erb +2 -2
  95. data/app/views/alchemy/admin/pages/configure_external.html.erb +13 -13
  96. data/app/views/alchemy/admin/pages/edit.html.erb +2 -2
  97. data/app/views/alchemy/admin/pages/index.html.erb +26 -24
  98. data/app/views/alchemy/admin/pages/link.html.erb +2 -5
  99. data/app/views/alchemy/admin/partials/_upload_form.html.erb +28 -12
  100. data/app/views/alchemy/admin/pictures/_archive.html.erb +54 -0
  101. data/app/views/alchemy/admin/pictures/_archive_overlay.html.erb +10 -7
  102. data/app/views/alchemy/admin/pictures/_filter_and_size_bar.html.erb +21 -22
  103. data/app/views/alchemy/admin/pictures/_filter_bar.html.erb +31 -0
  104. data/app/views/alchemy/admin/pictures/_overlay_picture_list.html.erb +9 -0
  105. data/app/views/alchemy/admin/pictures/_picture.html.erb +36 -6
  106. data/app/views/alchemy/admin/pictures/_tag_list.html.erb +27 -0
  107. data/app/views/alchemy/admin/pictures/archive_overlay.js.erb +3 -1
  108. data/app/views/alchemy/admin/pictures/create.js.erb +4 -5
  109. data/app/views/alchemy/admin/pictures/edit.html.erb +26 -0
  110. data/app/views/alchemy/admin/pictures/edit_multiple.html.erb +39 -0
  111. data/app/views/alchemy/admin/pictures/index.html.erb +81 -70
  112. data/app/views/alchemy/admin/pictures/index.js.erb +3 -0
  113. data/app/views/alchemy/admin/pictures/new.html.erb +1 -0
  114. data/app/views/alchemy/admin/resources/index.html.erb +3 -1
  115. data/app/views/alchemy/admin/users/_table.html.erb +1 -1
  116. data/app/views/alchemy/admin/users/index.html.erb +27 -23
  117. data/app/views/alchemy/elements/_article_editor.html.erb +7 -2
  118. data/app/views/alchemy/elements/_bild_editor.html.erb +1 -1
  119. data/app/views/alchemy/elements/_bild_text_editor.html.erb +6 -1
  120. data/app/views/alchemy/elements/_bild_text_view.html.erb +3 -3
  121. data/app/views/alchemy/elements/_image_mosaic_editor.html.erb +1 -1
  122. data/app/views/alchemy/elements/_image_mosaic_view.html.erb +2 -2
  123. data/app/views/alchemy/elements/_intro_image_text_view.html.erb +4 -4
  124. data/app/views/alchemy/elements/_searchresult_editor.html.erb +4 -1
  125. data/app/views/alchemy/essences/_essence_boolean_editor.html.erb +1 -1
  126. data/app/views/alchemy/essences/_essence_picture_editor.html.erb +2 -3
  127. data/app/views/alchemy/essences/_essence_picture_tools.html.erb +1 -1
  128. data/app/views/alchemy/search/_form.html.erb +8 -0
  129. data/app/views/alchemy/search/_result.html.erb +3 -2
  130. data/app/views/alchemy/search/_results.html.erb +28 -0
  131. data/app/views/alchemy/user_sessions/leave.html.erb +4 -4
  132. data/app/views/alchemy/user_sessions/login.html.erb +1 -2
  133. data/app/views/layouts/alchemy/admin.html.erb +30 -10
  134. data/app/views/layouts/alchemy/login.html.erb +2 -39
  135. data/config/alchemy/elements.yml +1 -2
  136. data/config/alchemy/page_layouts.yml +8 -5
  137. data/config/authorization_rules.rb +27 -18
  138. data/config/initializers/localeapp.rb +9 -0
  139. data/config/locales/alchemy.de.yml +93 -56
  140. data/config/locales/alchemy.en.yml +73 -50
  141. data/config/routes.rb +3 -1
  142. data/db/migrate/20120704181529_add_upload_hash_to_alchemy_picture.rb +5 -0
  143. data/db/migrate/20120705214247_acts_as_taggable_on_migration.rb +28 -0
  144. data/db/migrate/20120728185830_add_cached_tag_list_to_alchemy_pictures.rb +5 -0
  145. data/db/migrate/20120831135441_set_alchemy_languages_country_code_default_to_empty_string.rb +9 -0
  146. data/lib/alchemy/capistrano.rb +2 -2
  147. data/lib/alchemy/essence.rb +14 -0
  148. data/lib/alchemy/page_layout.rb +0 -6
  149. data/lib/alchemy/resource.rb +9 -15
  150. data/lib/alchemy/upgrader.rb +18 -3
  151. data/lib/alchemy/version.rb +5 -1
  152. data/lib/alchemy_cms.rb +4 -1
  153. data/lib/rails/generators/alchemy/deploy_script/deploy_script_generator.rb +16 -6
  154. data/lib/rails/generators/alchemy/deploy_script/templates/deploy.rb.tt +17 -3
  155. data/lib/rails/generators/alchemy/elements/elements_generator.rb +6 -1
  156. data/lib/rails/generators/alchemy/elements/templates/editor.html.erb +10 -1
  157. data/lib/rails/generators/alchemy/elements/templates/view.html.erb +17 -18
  158. data/lib/rails/generators/alchemy/scaffold/files/pages.html.erb +4 -2
  159. data/lib/tasks/fleximage.rake +2 -2
  160. data/spec/controllers/admin/contents_controller_spec.rb +2 -2
  161. data/spec/controllers/admin/elements_controller_spec.rb +30 -1
  162. data/spec/controllers/admin/pages_controller_spec.rb +35 -18
  163. data/spec/controllers/admin/trash_controller_spec.rb +40 -16
  164. data/spec/controllers/attachments_controller_spec.rb +62 -0
  165. data/spec/controllers/base_controller_spec.rb +43 -42
  166. data/spec/controllers/elements_controller_spec.rb +30 -0
  167. data/spec/controllers/pages_controller_spec.rb +22 -5
  168. data/spec/controllers/pictures_controller_spec.rb +82 -0
  169. data/spec/dummy/app/models/event.rb +2 -1
  170. data/spec/dummy/config/database.yml +3 -2
  171. data/spec/dummy/db/schema.rb +51 -27
  172. data/spec/factories.rb +29 -8
  173. data/spec/helpers/admin/base_helper_spec.rb +134 -21
  174. data/spec/helpers/admin/contents_helper_spec.rb +2 -2
  175. data/spec/helpers/admin/elements_helper_spec.rb +17 -9
  176. data/spec/helpers/admin/essences_helper_spec.rb +7 -6
  177. data/spec/helpers/essences_helper_spec.rb +8 -7
  178. data/spec/helpers/pages_helper_spec.rb +208 -325
  179. data/spec/helpers/url_helper_spec.rb +171 -0
  180. data/spec/integration/admin/link_overlay_spec.rb +53 -0
  181. data/spec/integration/admin/modules_integration_spec.rb +22 -26
  182. data/spec/integration/admin/pages_controller_spec.rb +10 -19
  183. data/spec/integration/admin/picture_library_integration_spec.rb +52 -0
  184. data/spec/integration/admin/resources_integration_spec.rb +68 -75
  185. data/spec/integration/pages_controller_spec.rb +70 -61
  186. data/spec/integration/security_spec.rb +3 -5
  187. data/spec/integration/translation_integration_spec.rb +56 -0
  188. data/spec/libraries/essence_spec.rb +18 -0
  189. data/spec/libraries/resource_spec.rb +101 -79
  190. data/spec/libraries/resources_helper_spec.rb +3 -0
  191. data/spec/models/content_spec.rb +63 -60
  192. data/spec/models/element_spec.rb +203 -93
  193. data/spec/models/language_spec.rb +90 -65
  194. data/spec/models/page_layout_spec.rb +37 -0
  195. data/spec/models/page_spec.rb +181 -113
  196. data/spec/models/picture_spec.rb +73 -26
  197. data/spec/models/resource_spec.rb +52 -23
  198. data/spec/support/alchemy/specs_helpers.rb +2 -0
  199. data/spec/support/image.png +0 -0
  200. data/spec/{helpers/url_helpers_spec.rb → url_helpers_spec.rb} +0 -0
  201. data/vendor/assets/javascripts/jquery_plugins/jquery.selectBoxIt.js +1909 -0
  202. data/vendor/assets/javascripts/jquery_plugins/preloadCssImages.jQuery_v5.js +152 -0
  203. metadata +106 -33
  204. data/app/assets/stylesheets/alchemy/buttons.css.scss +0 -361
  205. data/app/assets/stylesheets/alchemy/jquery.sb.css.scss +0 -260
  206. data/app/views/alchemy/admin/contents/create.js.coffee +0 -49
  207. data/app/views/alchemy/admin/elements/fold.js.coffee +0 -37
  208. data/app/views/alchemy/admin/essence_pictures/destroy.js.coffee +0 -19
  209. data/app/views/alchemy/admin/pictures/_pictures_list.html.erb +0 -16
  210. data/app/views/alchemy/admin/pictures/update.js.erb +0 -3
  211. data/spec/dummy/config/locales/en.yml +0 -5
  212. data/spec/dummy/config/locales/fo.yml +0 -5
  213. data/spec/page_layout_spec.rb +0 -35
  214. data/vendor/assets/javascripts/jquery_plugins/jquery.in-place-edit.js +0 -172
  215. data/vendor/assets/javascripts/jquery_plugins/jquery.sb.min.js +0 -14
@@ -74,10 +74,10 @@ en:
74
74
 
75
75
  # == Translations for the build in full text search.
76
76
  search_result_page:
77
- no_results: 'No results found'
77
+ result_page: Page
78
+ no_results: "Your search for '%{query}' offers no result"
78
79
  result_heading: "Your search for '%{query}'"
79
80
  result_count:
80
- zero: 'Offers no results'
81
81
  one: 'Offers one result'
82
82
  other: 'Offers %{count} results'
83
83
 
@@ -177,6 +177,7 @@ en:
177
177
  assign_file: "Assign a file"
178
178
  assign_file_from_archive: "assign a file from your archive"
179
179
  assign_image: "Assign an image"
180
+ attachment_filename_notice: "*) Please do not use any special characters for the filename."
180
181
  auto_play: "Play movie after load"
181
182
  big_thumbnails: "Big thumbnails"
182
183
  choose_element_as_target: "Please choose an element as target"
@@ -186,6 +187,7 @@ en:
186
187
  confirm_to_delete_file: "Do you really want to delete this file from the server?"
187
188
  confirm_to_delete_image: "Do you really want to delete this image from server?"
188
189
  confirm_to_delete_image_from_server: "Do you really want to delete this image from the server?"
190
+ confirm_to_delete_images_from_server: "Do you really want to delete these images from the server?"
189
191
  confirm_to_delete_user: "Do you really want to delete this user?"
190
192
  contactform_body: "Message Template"
191
193
  content_essence_not_found: "Content essence not found"
@@ -194,6 +196,7 @@ en:
194
196
  copy_element: "Copy this element"
195
197
  copy_language_tree_heading: "Copy page tree"
196
198
  copy_page: "Copy page"
199
+ "Could not delete Pictures": "Could not delete Pictures"
197
200
  country_code_placeholder: 'i.e. us (optional)'
198
201
  country_code_foot_note: "You only need to set a country code if you want to provide each country with an individual language."
199
202
  "Create language": "Create a new language"
@@ -218,6 +221,7 @@ en:
218
221
  edit_language: "Edit language"
219
222
  edit_page: "Edit this page"
220
223
  edit_page_properties: "Edit the page´s properties."
224
+ edit_selected_pictures: "Edit selected pictures"
221
225
  edit_user: "Edit the user´s properties."
222
226
  element_dirty_notice: "This element has unsaved changes. Do you really want to fold it?"
223
227
  element_dirty_close_window_notice: "You have unsaved elements. Do you really want to close the elements window?"
@@ -317,7 +321,15 @@ en:
317
321
  picture_gallery_editor: 'Pictures'
318
322
  "Picture uploaded succesfully": "Picture %{name} uploaded succesfully"
319
323
  "Picture renamed successfully": "Picture renamed successfully from %{from} to %{to}"
320
- "Picture deleted successfully": "Picture %{name} deleted"
324
+ "Picture deleted successfully": "Picture %{name} successfully deleted"
325
+ picture_updated_successfully: "Picture %{name} successfully updated"
326
+ picture_update_failed: "Failed to update picture %{name}"
327
+ "Pictures deleted successfully": "Pictures %{names} successfully deleted"
328
+ pictures_deleted_successfully: "Pictures %{name} deleted"
329
+ picture_library:
330
+ filter:
331
+ last_upload: "Showing only pictures from last upload"
332
+ recent: "Showing only recently uploaded pictures"
321
333
  place_link: "Link text"
322
334
  player_version: "Flashplayer Version"
323
335
  "please enter subject and mail address": "Please enter recipient and subject."
@@ -481,7 +493,61 @@ en:
481
493
  one: "over 1 year"
482
494
  many: "over %{count} years"
483
495
 
496
+ errors: &errors
497
+ template:
498
+ header: "Validation failed"
499
+ body: "Please review the form and check the errors."
500
+
501
+ messages:
502
+ inclusion: "is not included in the list"
503
+ exclusion: "is reserved"
504
+ invalid: "is invalid"
505
+ confirmation: "doesn't match confirmation"
506
+ accepted: "must be accepted"
507
+ empty: "can't be empty"
508
+ blank: "can't be blank"
509
+ too_long: "is too long (maximum is %{count} characters)"
510
+ too_short: "is too short (minimum is %{count} characters)"
511
+ wrong_length: "is the wrong length (should be %{count} characters)"
512
+ taken: "has already been taken"
513
+ not_a_number: "is not a number"
514
+ greater_than: "must be greater than %{count}"
515
+ greater_than_or_equal_to: "must be greater than or equal to %{count}"
516
+ equal_to: "must be equal to %{count}"
517
+ less_than: "must be less than %{count}"
518
+ less_than_or_equal_to: "must be less than or equal to %{count}"
519
+ odd: "must be odd"
520
+ even: "must be even"
521
+ models:
522
+ alchemy/content:
523
+ attributes:
524
+ essence:
525
+ validation_failed: 'Validation failed.'
526
+ alchemy/element:
527
+ attributes:
528
+ name:
529
+ blank: "^Please choose an element."
530
+ alchemy/language:
531
+ attributes:
532
+ code:
533
+ invalid: '^Format of languagecode is not valid. Please use exactly two lowercase characters.'
534
+ alchemy/page:
535
+ attributes:
536
+ name:
537
+ blank: "^Please enter a name."
538
+ page_layout:
539
+ blank: "^Please choose a page layout."
540
+ urlname:
541
+ too_short: "^The pages urlname is too short (minimum of 3 characters)."
542
+ taken: "^URL-Name already taken."
543
+ exclusion: "^URL-Name reserved."
544
+
484
545
  activemodel:
546
+ models:
547
+ alchemy/message:
548
+ one: Message
549
+ other: Messages
550
+
485
551
  attributes:
486
552
  alchemy/message:
487
553
  salutation: 'Salutation'
@@ -493,6 +559,9 @@ en:
493
559
  email: 'Email'
494
560
  message: 'Message'
495
561
 
562
+ errors:
563
+ <<: *errors
564
+
496
565
  # Translations for active record database models and error messages.
497
566
  activerecord:
498
567
 
@@ -566,53 +635,7 @@ en:
566
635
  role: "Userrole"
567
636
 
568
637
  errors:
569
- template:
570
- header: "Validation failed"
571
- body: ""
572
-
573
- messages:
574
- inclusion: "is not included in the list"
575
- exclusion: "is reserved"
576
- invalid: "is invalid"
577
- confirmation: "doesn't match confirmation"
578
- accepted: "must be accepted"
579
- empty: "can't be empty"
580
- blank: "can't be blank"
581
- too_long: "is too long (maximum is %{count} characters)"
582
- too_short: "is too short (minimum is %{count} characters)"
583
- wrong_length: "is the wrong length (should be %{count} characters)"
584
- taken: "has already been taken"
585
- not_a_number: "is not a number"
586
- greater_than: "must be greater than %{count}"
587
- greater_than_or_equal_to: "must be greater than or equal to %{count}"
588
- equal_to: "must be equal to %{count}"
589
- less_than: "must be less than %{count}"
590
- less_than_or_equal_to: "must be less than or equal to %{count}"
591
- odd: "must be odd"
592
- even: "must be even"
593
- models:
594
- alchemy/content:
595
- attributes:
596
- essence:
597
- validation_failed: 'Validation failed.'
598
- alchemy/element:
599
- attributes:
600
- name:
601
- blank: "^Please choose an element."
602
- alchemy/language:
603
- attributes:
604
- code:
605
- invalid: '^Format of languagecode is not valid. Please use exactly two lowercase characters.'
606
- alchemy/page:
607
- attributes:
608
- name:
609
- blank: "^Please enter a name."
610
- page_layout:
611
- blank: "^Please choose a page layout."
612
- urlname:
613
- too_short: "^The pages urlname is too short (minimum of 3 characters)."
614
- taken: "^URL-Name already taken."
615
- exclusion: "^URL-Name reserved."
638
+ <<: *errors
616
639
 
617
640
  # Translations for the authentication system used in alchemy.
618
641
  authlogic:
@@ -85,7 +85,9 @@ Alchemy::Engine.routes.draw do
85
85
 
86
86
  resources :pictures do
87
87
  collection do
88
- post :flush
88
+ post :flush, :update_multiple
89
+ delete :delete_multiple
90
+ get :edit_multiple
89
91
  end
90
92
  member do
91
93
  get :show_in_window
@@ -0,0 +1,5 @@
1
+ class AddUploadHashToAlchemyPicture < ActiveRecord::Migration
2
+ def change
3
+ add_column :alchemy_pictures, :upload_hash, :string
4
+ end
5
+ end
@@ -0,0 +1,28 @@
1
+ class ActsAsTaggableOnMigration < ActiveRecord::Migration
2
+ def self.up
3
+ create_table :tags do |t|
4
+ t.string :name
5
+ end
6
+
7
+ create_table :taggings do |t|
8
+ t.references :tag
9
+
10
+ # You should make sure that the column created is
11
+ # long enough to store the required class names.
12
+ t.references :taggable, :polymorphic => true
13
+ t.references :tagger, :polymorphic => true
14
+
15
+ t.string :context
16
+
17
+ t.datetime :created_at
18
+ end
19
+
20
+ add_index :taggings, :tag_id
21
+ add_index :taggings, [:taggable_id, :taggable_type, :context]
22
+ end
23
+
24
+ def self.down
25
+ drop_table :taggings
26
+ drop_table :tags
27
+ end
28
+ end
@@ -0,0 +1,5 @@
1
+ class AddCachedTagListToAlchemyPictures < ActiveRecord::Migration
2
+ def change
3
+ add_column :alchemy_pictures, :cached_tag_list, :string
4
+ end
5
+ end
@@ -0,0 +1,9 @@
1
+ class SetAlchemyLanguagesCountryCodeDefaultToEmptyString < ActiveRecord::Migration
2
+ def up
3
+ change_column :alchemy_languages, :country_code, :string, :default => '', :null => false
4
+ end
5
+
6
+ def down
7
+ change_column :alchemy_languages, :country_code, :string, :default => nil, :null => true
8
+ end
9
+ end
@@ -17,7 +17,7 @@ Capistrano::Configuration.instance(:must_exist).load do
17
17
  run "mkdir -p #{shared_path}/index"
18
18
  run "mkdir -p #{shared_path}/uploads/pictures"
19
19
  run "mkdir -p #{shared_path}/uploads/attachments"
20
- run "mkdir -p #{File.join(shared_path, 'cache', Capistrano::CLI.ui.ask("Where is Alchemy CMS mounted at? ('/')"), 'pictures')}"
20
+ run "mkdir -p #{File.join(shared_path, 'cache', Capistrano::CLI.ui.ask("\nWhere is Alchemy CMS mounted at? ('/'): "), 'pictures')}"
21
21
  end
22
22
 
23
23
  # This task sets the symlinks for uploads, picture cache and ferret index folder.
@@ -42,7 +42,7 @@ Capistrano::Configuration.instance(:must_exist).load do
42
42
 
43
43
  desc "Creates the database.yml file"
44
44
  task :create do
45
- db_adapter = Capistrano::CLI.ui.ask("Please enter database adapter (Options: mysql2, or postgresql. Default mysql2): ")
45
+ db_adapter = Capistrano::CLI.ui.ask("\nPlease enter database adapter (Options: mysql2, or postgresql. Default mysql2): ")
46
46
  db_adapter = db_adapter.empty? ? 'mysql2' : db_adapter.gsub(/^mysql$/, 'mysql2')
47
47
  db_name = Capistrano::CLI.ui.ask("Please enter database name: ")
48
48
  db_username = Capistrano::CLI.ui.ask("Please enter database username: ")
@@ -31,6 +31,8 @@ module Alchemy #:nodoc:
31
31
  stampable(:stamper_class_name => 'Alchemy::User')
32
32
  validate :essence_validations, :on => :update
33
33
  has_many :contents, :as => :essence
34
+ has_many :elements, :through => :contents
35
+ has_many :pages, :through => :elements
34
36
 
35
37
  def acts_as_essence_class
36
38
  #{self.name}
@@ -132,6 +134,18 @@ module Alchemy #:nodoc:
132
134
  end
133
135
  end
134
136
 
137
+ # Returns the value stored from the database column that is configured as ingredient column.
138
+ def ingredient=(value)
139
+ if self.respond_to?(ingredient_setter_method)
140
+ self.send(ingredient_setter_method, value)
141
+ end
142
+ end
143
+
144
+ # Returns the setter method for ingredient column
145
+ def ingredient_setter_method
146
+ ingredient_column.to_s + '='
147
+ end
148
+
135
149
  # Essence description from config/elements.yml
136
150
  def description
137
151
  return {} if element.nil? or element.content_descriptions.nil?
@@ -77,12 +77,6 @@ module Alchemy
77
77
  end
78
78
  end
79
79
 
80
- def self.get_page_layout_names
81
- a = []
82
- get_layouts.each { |l| a << l.keys.first }
83
- a
84
- end
85
-
86
80
  def self.has_a_page_this_layout?(layout, language_id)
87
81
  Page.where({:page_layout => layout, :language_id => language_id}).any?
88
82
  end
@@ -1,16 +1,18 @@
1
1
  require 'active_support/inflector'
2
+ require 'active_support/core_ext'
2
3
 
3
4
  module Alchemy
4
5
  class Resource
5
6
 
6
- attr_accessor :skip_attributes
7
+ attr_accessor :skip_attributes, :resource_relations
7
8
 
8
9
  DEFAULT_SKIPPED_ATTRIBUTES = %W[id updated_at created_at creator_id updater_id]
9
10
 
10
11
  def initialize(controller_path, module_definition=nil)
11
12
  @controller_path = controller_path
12
13
  @module_definition = module_definition
13
- self.skip_attributes = DEFAULT_SKIPPED_ATTRIBUTES
14
+ self.skip_attributes = model.respond_to?(:skip_attributes) ? model.skip_attributes : DEFAULT_SKIPPED_ATTRIBUTES
15
+ self.resource_relations = model.resource_relations if model.respond_to?(:resource_relations)
14
16
  end
15
17
 
16
18
  def model_array
@@ -43,7 +45,7 @@ module Alchemy
43
45
  end
44
46
 
45
47
  def attributes
46
- self.model.columns.collect do |col|
48
+ @_attributes ||= self.model.columns.collect do |col|
47
49
  {:name => (resource_relation_name(col.name) || col.name), :type => (resource_relation_type(col.name) || col.type)} unless self.skip_attributes.include?(col.name)
48
50
  end.compact
49
51
  end
@@ -67,7 +69,7 @@ module Alchemy
67
69
  @module_definition and @module_definition['engine_name']
68
70
  end
69
71
 
70
- protected
72
+ protected
71
73
 
72
74
  def controller_path_array
73
75
  @controller_path.split('/')
@@ -78,23 +80,15 @@ module Alchemy
78
80
  end
79
81
 
80
82
  def resource_relation_name(column_name)
81
- resource_relation(column_name)['attr_method'].to_s if resource_relation(column_name).present?
83
+ resource_relation(column_name).try(:[], :attr_method)
82
84
  end
83
85
 
84
86
  def resource_relation_type(column_name)
85
- resource_relation(column_name)['attr_type'].to_sym if resource_relation(column_name).present?
86
- end
87
-
88
- def self.resource_relations
89
- Config.get(:resource_relations)
90
- end
91
-
92
- def resource_relations
93
- self.class.resource_relations[model_name.to_s] if self.class.resource_relations
87
+ resource_relation(column_name).try(:[], :attr_type)
94
88
  end
95
89
 
96
90
  def resource_relation(column_name)
97
- resource_relations[column_name.to_s] if resource_relations
91
+ resource_relations[column_name.to_sym] if resource_relations
98
92
  end
99
93
 
100
94
  end
@@ -1,3 +1,5 @@
1
+ require 'fileutils'
2
+
1
3
  module Alchemy
2
4
  class Upgrader < Alchemy::Seeder
3
5
 
@@ -14,6 +16,7 @@ module Alchemy
14
16
  upgrade_to_namespaced_essence_type
15
17
  convert_essence_texts_displayed_as_select_into_essence_selects
16
18
  convert_essence_texts_displayed_as_checkbox_into_essence_booleans
19
+ copy_new_config_file
17
20
 
18
21
  display_todos
19
22
  end
@@ -71,11 +74,11 @@ module Alchemy
71
74
  essences.each do |essence|
72
75
  case essence.link_target
73
76
  when '1'
74
- if essence.update_attribute(:link_target, 'blank')
77
+ if essence.update_column(:link_target, 'blank')
75
78
  log("Updated #{essence.preview_text} link target to #{essence.link_target}.")
76
79
  end
77
80
  when '0'
78
- essence.update_attribute(:link_target, nil)
81
+ essence.update_column(:link_target, nil)
79
82
  log("Updated #{essence.preview_text} link target to #{essence.link_target.inspect}.")
80
83
  else
81
84
  log("#{essence.preview_text} already upgraded.", :skip)
@@ -94,7 +97,7 @@ module Alchemy
94
97
  success = 0
95
98
  errors = []
96
99
  depricated_contents.each do |c|
97
- if c.update_attribute(:essence_type, c.essence_type.gsub(/^Essence/, 'Alchemy::Essence'))
100
+ if c.update_column(:essence_type, c.essence_type.gsub(/^Essence/, 'Alchemy::Essence'))
98
101
  success += 1
99
102
  else
100
103
  errors << c.errors.full_messages
@@ -176,6 +179,18 @@ module Alchemy
176
179
  end
177
180
  end
178
181
 
182
+ def copy_new_config_file
183
+ desc "Copy config file"
184
+ old_config_file = Rails.root.join('config/alchemy/config.yml')
185
+ if File.exist?(old_config_file)
186
+ FileUtils.mv old_config_file, Rails.root.join('config/alchemy/config.yml.old')
187
+ log "Backed up old config file"
188
+ end
189
+ FileUtils.cp File.join(File.dirname(__FILE__), '../../config/alchemy/config.yml'), old_config_file
190
+ log "Copied new config file"
191
+ todo "Check the config/alchemy/config.yml.old file for custom configuration options and insert them into the new config file."
192
+ end
193
+
179
194
  end
180
195
 
181
196
  end
@@ -1,5 +1,9 @@
1
1
  module Alchemy
2
2
 
3
- VERSION = "2.2.4"
3
+ VERSION = "2.3.rc5"
4
+
5
+ def self.version
6
+ VERSION
7
+ end
4
8
 
5
9
  end
@@ -1,5 +1,6 @@
1
1
  if defined?(Rails) && Rails::VERSION::MAJOR == 3 && Rails::VERSION::MINOR == 2
2
2
  require 'acts_as_list'
3
+ require 'acts-as-taggable-on'
3
4
  require 'attachment_magic'
4
5
  require 'authlogic'
5
6
  require 'awesome_nested_set'
@@ -10,7 +11,9 @@ if defined?(Rails) && Rails::VERSION::MAJOR == 3 && Rails::VERSION::MINOR == 2
10
11
  require 'userstamp'
11
12
  require 'yaml'
12
13
  require 'sass-rails'
14
+ require 'compass-rails'
13
15
  require 'coffee-rails'
16
+ require 'sassy-buttons'
14
17
  require 'declarative_authorization'
15
18
  require 'extensions/hash'
16
19
  require 'extensions/array'
@@ -24,7 +27,7 @@ if defined?(Rails) && Rails::VERSION::MAJOR == 3 && Rails::VERSION::MINOR == 2
24
27
  end
25
28
  require File.join(File.dirname(__FILE__), "alchemy", "seeder")
26
29
  else
27
- raise "Alchemy 2.2 needs Rails 3.2 or higher. You are currently using Rails #{Rails::VERSION::STRING}"
30
+ raise "Alchemy 2.3 needs Rails 3.2 or higher. You are currently using Rails #{Rails::VERSION::STRING}"
28
31
  end
29
32
 
30
33
  module Alchemy