alchemy_cms 2.1.beta6 → 2.1.rc2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (137) hide show
  1. data/.gitignore +3 -1
  2. data/Gemfile +10 -2
  3. data/Guardfile +16 -0
  4. data/README.md +3 -3
  5. data/Rakefile +0 -5
  6. data/alchemy_cms.gemspec +1 -9
  7. data/app/assets/javascripts/alchemy/alchemy.base.js +5 -4
  8. data/app/assets/javascripts/alchemy/{alchemy.dragndrop.js.erb → alchemy.dragndrop.js} +0 -0
  9. data/app/assets/javascripts/alchemy/alchemy.elements_window.js +96 -0
  10. data/app/assets/javascripts/alchemy/alchemy.image_cropper.js +48 -50
  11. data/app/assets/javascripts/alchemy/alchemy.jquery_loader.js +41 -0
  12. data/app/assets/javascripts/alchemy/alchemy.js +2 -0
  13. data/app/assets/javascripts/alchemy/alchemy.menubar.js +55 -0
  14. data/app/assets/javascripts/alchemy/alchemy.preview.js +94 -139
  15. data/app/assets/javascripts/alchemy/alchemy.preview_window.js +98 -0
  16. data/app/assets/javascripts/alchemy/alchemy.windows.js +1 -174
  17. data/app/assets/javascripts/alchemy/menubar.js +2 -0
  18. data/app/assets/javascripts/alchemy/preview.js +2 -1
  19. data/app/assets/stylesheets/alchemy/_defaults.scss +7 -8
  20. data/app/assets/stylesheets/alchemy/base.css.scss +29 -33
  21. data/app/assets/stylesheets/alchemy/elements.css.scss +4 -4
  22. data/app/assets/stylesheets/alchemy/jquery-ui.alchemy.css.scss +1 -1
  23. data/app/assets/stylesheets/alchemy/jquery.Jcrop.css.scss +1 -1
  24. data/app/assets/stylesheets/alchemy/jquery.sb.css.scss +19 -4
  25. data/app/assets/stylesheets/alchemy/menubar.css.scss +85 -0
  26. data/app/assets/stylesheets/alchemy/standard_set.css +3 -5
  27. data/app/assets/stylesheets/alchemy/tinymce_content.css.scss +1 -1
  28. data/app/assets/stylesheets/alchemy/tinymce_dialog.css.scss +1 -1
  29. data/app/controllers/alchemy/admin/attachments_controller.rb +2 -18
  30. data/app/controllers/alchemy/admin/base_controller.rb +1 -1
  31. data/app/controllers/alchemy/admin/elements_controller.rb +2 -2
  32. data/app/controllers/alchemy/admin/essence_files_controller.rb +4 -2
  33. data/app/controllers/alchemy/admin/pictures_controller.rb +6 -20
  34. data/app/controllers/alchemy/admin/resources_controller.rb +7 -5
  35. data/app/controllers/alchemy/base_controller.rb +14 -4
  36. data/app/controllers/alchemy/messages_controller.rb +4 -4
  37. data/app/controllers/alchemy/pages_controller.rb +51 -32
  38. data/app/controllers/alchemy/pictures_controller.rb +0 -3
  39. data/app/controllers/alchemy/user_sessions_controller.rb +1 -1
  40. data/app/helpers/alchemy/admin/base_helper.rb +6 -4
  41. data/app/helpers/alchemy/base_helper.rb +26 -0
  42. data/app/helpers/alchemy/pages_helper.rb +42 -22
  43. data/app/models/alchemy/attachment.rb +10 -2
  44. data/app/models/alchemy/cell.rb +1 -0
  45. data/app/models/alchemy/content.rb +8 -6
  46. data/app/models/alchemy/element.rb +1 -1
  47. data/app/models/alchemy/essence_audio.rb +1 -8
  48. data/app/models/alchemy/essence_date.rb +2 -9
  49. data/app/models/alchemy/essence_file.rb +1 -8
  50. data/app/models/alchemy/essence_flash.rb +0 -7
  51. data/app/models/alchemy/essence_html.rb +1 -8
  52. data/app/models/alchemy/essence_picture.rb +0 -11
  53. data/app/models/alchemy/essence_richtext.rb +4 -12
  54. data/app/models/alchemy/essence_text.rb +1 -13
  55. data/app/models/alchemy/essence_video.rb +1 -8
  56. data/app/models/alchemy/page.rb +28 -22
  57. data/app/models/alchemy/picture.rb +19 -0
  58. data/app/sweepers/alchemy/pages_sweeper.rb +17 -6
  59. data/app/sweepers/alchemy/pictures_sweeper.rb +1 -3
  60. data/app/views/alchemy/admin/attachments/_archive_overlay.html.erb +2 -2
  61. data/app/views/alchemy/admin/attachments/_attachment.html.erb +1 -1
  62. data/app/views/alchemy/admin/attachments/_file_to_assign.html.erb +2 -2
  63. data/app/views/alchemy/admin/attachments/_files_list.html.erb +13 -11
  64. data/app/views/alchemy/admin/attachments/create.js.erb +1 -1
  65. data/app/views/alchemy/admin/attachments/edit.html.erb +2 -2
  66. data/app/views/alchemy/admin/elements/_new_element_form.html.erb +1 -2
  67. data/app/views/alchemy/admin/elements/new.html.erb +1 -1
  68. data/app/views/alchemy/admin/essence_files/edit.html.erb +32 -32
  69. data/app/views/alchemy/admin/essence_pictures/crop.html.erb +29 -29
  70. data/app/views/alchemy/admin/essence_pictures/update.js.erb +13 -12
  71. data/app/views/alchemy/admin/pages/_create_language_form.html.erb +4 -1
  72. data/app/views/alchemy/admin/pages/_new_page_form.html.erb +1 -1
  73. data/app/views/alchemy/admin/pages/edit.html.erb +8 -8
  74. data/app/views/alchemy/admin/pages/index.html.erb +1 -1
  75. data/app/views/alchemy/admin/pages/new.html.erb +1 -1
  76. data/app/views/alchemy/admin/pages/update.js.erb +19 -12
  77. data/app/views/alchemy/admin/pictures/_picture.html.erb +1 -1
  78. data/app/views/alchemy/admin/pictures/_pictures_list.html.erb +8 -6
  79. data/app/views/alchemy/admin/pictures/show_in_window.html.erb +6 -1
  80. data/app/views/alchemy/admin/resources/_table.html.erb +1 -1
  81. data/app/views/alchemy/admin/users/_table.html.erb +13 -13
  82. data/app/views/alchemy/admin/users/_user.html.erb +1 -1
  83. data/app/views/alchemy/admin/users/index.html.erb +2 -2
  84. data/app/views/alchemy/elements/_contactform_view.html.erb +78 -78
  85. data/app/views/alchemy/elements/_download_editor.html.erb +1 -0
  86. data/app/views/alchemy/elements/_download_view.html.erb +3 -0
  87. data/app/views/alchemy/essences/_essence_date_editor.html.erb +1 -1
  88. data/app/views/alchemy/essences/_essence_file_editor.html.erb +1 -0
  89. data/app/views/alchemy/essences/_essence_file_view.html.erb +6 -2
  90. data/app/views/alchemy/essences/_essence_picture_editor.html.erb +3 -2
  91. data/app/views/alchemy/essences/_essence_picture_view.html.erb +1 -1
  92. data/app/views/alchemy/navigation/_link.html.erb +1 -2
  93. data/app/views/alchemy/notifications/admin_user_created.text.erb +7 -7
  94. data/app/views/alchemy/notifications/registered_user_created.text.erb +5 -5
  95. data/app/views/alchemy/user_sessions/login.html.erb +34 -35
  96. data/app/views/layouts/alchemy/login.html.erb +3 -8
  97. data/app/views/layouts/alchemy/pages.html.erb +1 -0
  98. data/bin/alchemy +43 -75
  99. data/config/alchemy/config.yml +10 -0
  100. data/config/alchemy/elements.yml +5 -0
  101. data/config/alchemy/page_layouts.yml +1 -1
  102. data/config/locales/alchemy.de.yml +21 -8
  103. data/config/locales/alchemy.en.yml +20 -4
  104. data/config/routes.rb +25 -20
  105. data/db/migrate/{20111116125112_namespace_models.rb → 20111116125112_namespace_alchemy_models.rb} +1 -1
  106. data/lib/alchemy/capistrano.rb +4 -17
  107. data/lib/alchemy/engine.rb +2 -0
  108. data/lib/alchemy/essence.rb +29 -41
  109. data/lib/alchemy/i18n.rb +1 -1
  110. data/lib/alchemy/mount_point.rb +10 -0
  111. data/lib/alchemy/page_layout.rb +7 -7
  112. data/lib/alchemy/seeder.rb +85 -47
  113. data/lib/alchemy/upgrader.rb +115 -0
  114. data/lib/alchemy/version.rb +1 -1
  115. data/lib/alchemy_cms.rb +4 -3
  116. data/lib/rails/generators/alchemy/scaffold/scaffold_generator.rb +6 -2
  117. data/lib/tasks/ferret.rake +12 -0
  118. data/lib/tasks/install.rake +16 -105
  119. data/lib/tasks/routes.rake +29 -0
  120. data/lib/tasks/upgrade.rake +5 -67
  121. data/spec/controllers/admin/pages_controller_spec.rb +1 -1
  122. data/spec/controllers/pages_controller_spec.rb +31 -0
  123. data/spec/factories.rb +24 -15
  124. data/spec/helpers/admin/base_helper_spec.rb +0 -7
  125. data/spec/helpers/pages_helper_spec.rb +54 -29
  126. data/spec/helpers/url_helpers_spec.rb +40 -0
  127. data/spec/integration/admin/pages_controller_spec.rb +3 -3
  128. data/spec/integration/pages_controller_spec.rb +80 -6
  129. data/spec/integration/security_spec.rb +2 -2
  130. data/spec/models/content_spec.rb +24 -0
  131. data/spec/models/page_spec.rb +174 -47
  132. data/spec/models/picture_spec.rb +54 -0
  133. data/spec/page_layout_spec.rb +2 -2
  134. data/spec/routing_spec.rb +205 -1
  135. data/spec/spec_helper.rb +53 -32
  136. metadata +51 -46
  137. data/lib/alchemy/file_utilz.rb +0 -73
@@ -39,6 +39,16 @@
39
39
  :show_root: true
40
40
  :show_flag: false
41
41
 
42
+ # === URL nesting
43
+ # By default Alchemy does not nest page urls respectivley to their page tree position.
44
+ # Enable +url_nesting+ to get nested urls.
45
+ # ==== Example of a nested url:
46
+ # +http://homepage.com/company/history/the-early-years+
47
+ # Alchemy supports url nesting up to three levels deep. We think that's more then enough,
48
+ # because URLs like this are possible:
49
+ # +http://homepage.com/en/2011/12/08/my-post
50
+ url_nesting: false
51
+
42
52
  # === Picture rendering settings
43
53
  # Alchemy uses Fleximage and RMagick to render images. Use {:image_size => "XXXxYYY", :crop => BOOLEAN [true]} to resize images.
44
54
  # See https://github.com/Squeegy/fleximage for further infos.
@@ -191,6 +191,11 @@
191
191
  - name: subheadline
192
192
  type: EssenceText
193
193
 
194
+ - name: download
195
+ contents:
196
+ - name: file
197
+ type: EssenceFile
198
+
194
199
  - name: news
195
200
  contents:
196
201
  - name: date
@@ -34,7 +34,7 @@
34
34
  autogenerate: [header, intro_image_text]
35
35
 
36
36
  - name: standard
37
- elements: [article, claim, header, bild, bild_text, text, intro, headline, image_mosaic]
37
+ elements: [article, claim, header, bild, bild_text, text, intro, headline, image_mosaic, download]
38
38
  autogenerate: [header, claim, article]
39
39
 
40
40
  - name: contact
@@ -70,6 +70,7 @@ de:
70
70
  news_headline: "News Überschrift"
71
71
  image_mosaic:
72
72
  caption: "Mosaik Bildunterschrift"
73
+ file: Datei
73
74
 
74
75
  content_validations:
75
76
  errors:
@@ -83,10 +84,13 @@ de:
83
84
  no_float: 'Über dem Text'
84
85
 
85
86
  # == Translations for the build in full text search.
86
- search:
87
+ search_result_page:
87
88
  no_results: 'Ihre Suche ergab kein Ergebnis.'
88
89
  result_heading: "Ihre Suche nach '%{query}'"
89
- result_count: "Ergab %{result_count} Ergebnisse"
90
+ result_count:
91
+ zero: "Ergab keine Ergebnisse"
92
+ one: "Ergab ein Ergebnis"
93
+ other: "Ergab %{count} Ergebnisse"
90
94
 
91
95
  # == Contactform translations
92
96
  contactform:
@@ -195,7 +199,6 @@ de:
195
199
  "Element trashed": "Das Element wurde in den Papierkorb gelegt"
196
200
  "Error with the Flash® Uploader!": "Fehler mit dem Flash® Uploader!"
197
201
  "Excerpt": "Auszug"
198
- "Explain|Sitemap|Dragndrop sorting": "Tip: Halten Sie zum Sortieren der Seiten das Seitensymbol mit der Maus fest und bewegen Sie sie an ihre neue Position."
199
202
  "File %{name} uploaded succesfully": "Datei %{name} wurde hochgeladen"
200
203
  "File renamed successfully from: '%{from}' to '%{to}'": "Datei wurde erfolgreich von: '%{from}' nach '%{to}' umbenannt."
201
204
  "File upload error: %{error}": "Datei konnte nicht hochgeladen werden: %{error}"
@@ -222,6 +225,7 @@ de:
222
225
  "New page": "Neue Seite"
223
226
  "No": "Nein"
224
227
  "No EssenceType given": ""
228
+ "No image found. Did you saved the element?": "Es wurde kein Bild gefunden. Haben Sie das Element auch gespeichert?"
225
229
  "No items in your clipboard": "Ihre Zwischenablage ist leer"
226
230
  "None": ""
227
231
  "Open Link in": "Link öffnen in"
@@ -283,7 +287,7 @@ de:
283
287
  "User deleted": "%{name} wurde gelöscht"
284
288
  "User updated": "%{name} wurde aktualisiert"
285
289
  "Username": "Benutzername"
286
- "Validation failed.": "Pflichtfelder wurden nicht ausgefüllt."
290
+ "Validation failed": "Pflichtfelder wurden nicht ausgefüllt."
287
291
  "Version": "Version"
288
292
  "View File": "Datei anzeigen"
289
293
  "Visit page": "zur Seite gehen"
@@ -366,6 +370,7 @@ de:
366
370
  enter_external_link: "Geben Sie hier die Adresse der Seite ein zu der Sie einen Link setzen wollen."
367
371
  explain cropping: "Sie können den Rahmen verschieben und in der Größe verändern um den Bildausschnitt festzulegen. Wenn Sie zufrieden sind, dann klicken Sie bitte auf speichern."
368
372
  explain_publishing: "Die gecachte Version vom Server löschen und die aktuellen Änderungen veröffentlichen"
373
+ explain_sitemap_dragndrop_sorting: "Tip: Halten Sie zum Sortieren der Seiten das Seitensymbol mit der Maus fest und bewegen Sie sie an ihre neue Position."
369
374
  explain_unlocking: "Die Seite verlassen und für andere Benutzer zum Bearbeiten freigeben."
370
375
  explain_upload:
371
376
  footnote: "TIP! Halten Sie die Strg-Taste (cmd-Taste auf einem Mac) während Sie die %{name} mit der Maus anklicken, um mehrere %{name} gleichzeitig hochzuladen."
@@ -524,9 +529,9 @@ de:
524
529
  "Succesfully created": "Erfolgreich erstellt"
525
530
  "Succesfully updated": "Erfolgreich aktualisiert"
526
531
  "Succesfully removed": "Erfolgreich gelöscht"
527
- "You are already logged in.": "Sie sind bereits angemeldet."
528
- "No users found.": "Keine Benutzer gefunden."
529
- "Nothing found.": "Keine Einträge gefunden."
532
+ "You are already logged in": "Sie sind bereits angemeldet."
533
+ "No users found": "Keine Benutzer gefunden."
534
+ "Nothing found": "Keine Einträge gefunden."
530
535
 
531
536
  # END of Alchemy translation
532
537
 
@@ -554,6 +559,7 @@ de:
554
559
  default: "%d. %b. %Y, %H:%M Uhr"
555
560
  short: "%d. %B, %H:%Mh"
556
561
  long: "%A, %d. %B %Y um %H:%M Uhr"
562
+ date: "%d.%m.%Y"
557
563
  time: "%H:%M"
558
564
  am: "vormittags"
559
565
  pm: "nachmittags"
@@ -680,6 +686,9 @@ de:
680
686
  name: "Name"
681
687
  public: "sichtbar"
682
688
 
689
+ alchemy/essence_file:
690
+ css_class: Textanordnung
691
+
683
692
  alchemy/essence_picture:
684
693
  caption: "Untertitel"
685
694
  title: "Titel"
@@ -687,7 +696,7 @@ de:
687
696
  link: Link
688
697
  link_class_name: "Link CSS-Klasse"
689
698
  link_title: Link-Titel
690
- css_class: CSS-Klasse
699
+ css_class: Textanordnung
691
700
  link_target: Link-Ziel
692
701
  render_size: Darstellungsgröße
693
702
  crop_from: Bildmaskenursprung
@@ -768,6 +777,10 @@ de:
768
777
  even: "%{attribute} muss gerade sein"
769
778
 
770
779
  models:
780
+ alchemy/content:
781
+ attributes:
782
+ essence:
783
+ validation_failed: 'Validierung fehlgeschlagen.'
771
784
  alchemy/language:
772
785
  attributes:
773
786
  code:
@@ -70,10 +70,13 @@ en:
70
70
  caption: "Mosaic Caption"
71
71
 
72
72
  # == Translations for the build in full text search.
73
- search:
73
+ search_result_page:
74
74
  no_results: 'No results found'
75
75
  result_heading: "Your search for '%{query}'"
76
- result_count: 'Offers %{result_count} results'
76
+ result_count:
77
+ zero: 'Offers no results'
78
+ one: 'Offers one result'
79
+ other: 'Offers %{count} results'
77
80
 
78
81
  # == Contactform translations
79
82
  contactform:
@@ -213,7 +216,7 @@ en:
213
216
  edit_file_properties: "Edit Fileproperties"
214
217
  edit_image_properties: "Edit image properties."
215
218
  edit_language: "Edit language"
216
- edit_page: "Edit this page."
219
+ edit_page: "Edit this page"
217
220
  edit_page_properties: "Edit the page properties."
218
221
  edit_user: "Edit this users properties."
219
222
  element_editor_not_found: "Error within this Element"
@@ -221,6 +224,7 @@ en:
221
224
  element_saved: "Saved element."
222
225
  enter_external_link: "Please enter the URL you want to link with"
223
226
  explain_publishing: "Publish the page and remove the cached version from the server."
227
+ explain_sitemap_dragndrop_sorting: "Tip: Drag the pages at the icon in order to sort them."
224
228
  explain_unlocking: "Leave page and unlock it for other users."
225
229
  explain_upload:
226
230
  footnote: "HINT! Hold the CTRL button (CMD on a Mac) while clicking the %{name} with the mouse to upload multiple %{name} at once."
@@ -278,6 +282,7 @@ en:
278
282
  no_images_in_archive: "You don't have any images in your archive."
279
283
  no_more_elements_to_add: "No more elements available."
280
284
  no_search_results: "Your search did not return any results."
285
+ "No users found": "No users found."
281
286
  "not a valid image": "This is not an valid image."
282
287
  "Page created": "Page: '%{name}' created."
283
288
  page_for_links.choose_page: "Choose %{name}"
@@ -343,9 +348,12 @@ en:
343
348
  want_to_make_copy_of_existing_language: "Do you want to copy an existing language tree?"
344
349
  welcome_please_identify_notice: "Welcome! Please identify."
345
350
  width: "Width"
351
+ "You are already logged in": "You are already logged in."
346
352
  "You may upload files with following extensions": "You may upload %{file_types_description} with following extensions: %{file_types}"
347
353
  zoom_image: "Zoom this image."
348
-
354
+ "Nothing found": "Nothing found."
355
+ "Validation failed": "Validation failed."
356
+
349
357
  # END of Alchemy translation
350
358
 
351
359
  will_paginate:
@@ -376,6 +384,7 @@ en:
376
384
  default: "%a, %d %b %Y %H:%M:%S %z"
377
385
  short: "%d %b %H:%M"
378
386
  long: "%B %d, %Y %H:%M"
387
+ date: "%Y-%m-%d"
379
388
  am: "am"
380
389
  pm: "pm"
381
390
  support:
@@ -486,6 +495,9 @@ en:
486
495
  name: "Name"
487
496
  public: "visible"
488
497
 
498
+ alchemy/essence_file:
499
+ css_class: CSS Class
500
+
489
501
  alchemy/language:
490
502
  code: "Languagecode"
491
503
  default: "Default"
@@ -557,6 +569,10 @@ en:
557
569
  odd: "must be odd"
558
570
  even: "must be even"
559
571
  models:
572
+ alchemy/content:
573
+ attributes:
574
+ essence:
575
+ validation_failed: 'Validation failed.'
560
576
  alchemy/language:
561
577
  attributes:
562
578
  code:
@@ -2,7 +2,9 @@ Alchemy::Engine.routes.draw do
2
2
 
3
3
  root :to => 'pages#show'
4
4
 
5
- match '/admin' => redirect("/admin/dashboard")
5
+ match '/admin' => redirect(
6
+ "#{Alchemy.mount_point}/admin/dashboard"
7
+ )
6
8
  match '/admin/login' => 'user_sessions#login',
7
9
  :as => :login
8
10
  match '/admin/signup' => 'user_sessions#signup',
@@ -13,30 +15,24 @@ Alchemy::Engine.routes.draw do
13
15
  :as => :logout
14
16
  match '/admin/dashboard' => 'admin/dashboard#index',
15
17
  :as => :admin_dashboard
16
- match '/attachment/:id/download(/:name)(.:suffix)' => 'attachments#download',
18
+
19
+ match '/attachment/:id/download(/:name)(.:format)' => 'attachments#download',
17
20
  :as => :download_attachment
18
- match '/attachment/:id/show' => 'attachments#show',
19
- :as => :show_attachment
20
- match '/pictures/show/:id/:size/:crop_from/:crop_size/:name.:format' => 'pictures#show',
21
- :as => :show_cropped_picture
22
- match '/pictures/show/:id/:size/:crop/:name.:format' => 'pictures#show',
23
- :as => :show_picture_with_crop
24
- match '/pictures/show/:id/:size/:name.:format' => 'pictures#show',
25
- :as => :show_picture
26
- match '/pictures/zoom/:id/picture.:format' => 'pictures#zoom',
27
- :as => :zoom_picture
28
- match '/pictures/thumbnails/:id/:size(/:crop_from)(/:crop_size)/thumbnail.png' => 'pictures#thumbnail',
29
- :as => :thumbnail, :defaults => { :format => 'png' }
30
- match '/:lang' => 'pages#show',
31
- :constraints => {:lang => /[a-z]{2}/},
32
- :as => :show_language_root
33
- match '(/:lang)/:urlname(.:format)' => 'pages#show',
34
- :constraints => {:lang => /[a-z]{2}/},
35
- :as => :show_page
21
+
36
22
  # catching legacy download urls
37
23
  match '/wa_files/download/:id' => 'attachments#download'
38
24
  match '/uploads/files/0000/:id/:name(.:suffix)' => 'attachments#download'
39
25
 
26
+ match '/attachment/:id/show' => 'attachments#show',
27
+ :as => :show_attachment
28
+
29
+ match "/pictures/:id/show/:size(/:crop)(/:crop_from/:crop_size)/:name.:format" => 'pictures#show',
30
+ :as => :show_picture, :defaults => { :format => Alchemy::Config.get(:image_output_format) }
31
+ match '/pictures/:id/zoom/:name.:format' => 'pictures#zoom',
32
+ :as => :zoom_picture, :defaults => { :format => Alchemy::Config.get(:image_store_format) }
33
+ match "/pictures/:id/thumbnails/:size(/:crop)(/:crop_from/:crop_size)/:name.:format" => 'pictures#thumbnail',
34
+ :as => :thumbnail, :defaults => { :format => 'png', :name => "thumbnail" }
35
+
40
36
  resources :messages, :only => [:index, :new, :create]
41
37
 
42
38
  resources :user_sessions
@@ -142,4 +138,13 @@ Alchemy::Engine.routes.draw do
142
138
 
143
139
  end
144
140
 
141
+ match '/:lang' => 'pages#show',
142
+ :constraints => {:lang => /[a-z]{2}/},
143
+ :as => :show_language_root
144
+
145
+ # The page show action has to be last route
146
+ match '(/:lang)(/:level1(/:level2(/:level3)))/:urlname(.:format)' => 'pages#show',
147
+ :constraints => {:lang => /[a-z]{2}/},
148
+ :as => :show_page
149
+
145
150
  end
@@ -1,4 +1,4 @@
1
- class NamespaceModels < ActiveRecord::Migration
1
+ class NamespaceAlchemyModels < ActiveRecord::Migration
2
2
  def change
3
3
  rename_table :attachments, :alchemy_attachments
4
4
  rename_table :cells, :alchemy_cells
@@ -1,15 +1,13 @@
1
1
  # This recipe contains Capistrano recipes for handling the uploads, ferret index and picture cache files while deploying your application.
2
2
  # It also contains a ferret:rebuild_index task to rebuild the index after deploying your application.
3
3
  require "rails"
4
+ require "alchemy/mount_point"
4
5
 
5
6
  Capistrano::Configuration.instance(:must_exist).load do
6
7
 
7
8
  after "deploy:setup", "alchemy:shared_folders:create"
8
9
  after "deploy:symlink", "alchemy:shared_folders:symlink"
9
-
10
- if Rails.version < '3.1'
11
- before "deploy:restart", "alchemy:files:copy"
12
- end
10
+ before "deploy:start", "alchemy:seed"
13
11
 
14
12
  namespace :alchemy do
15
13
 
@@ -22,7 +20,7 @@ Capistrano::Configuration.instance(:must_exist).load do
22
20
  run "mkdir -p #{shared_path}/index"
23
21
  run "mkdir -p #{shared_path}/uploads/pictures"
24
22
  run "mkdir -p #{shared_path}/uploads/attachments"
25
- run "mkdir -p #{shared_path}/cache/pictures"
23
+ run "mkdir -p #{File.join(shared_path, 'cache', Capistrano::CLI.ui.ask("Where is Alchemy CMS mounted at? (/)"), 'pictures')}"
26
24
  end
27
25
 
28
26
  # This task sets the symlinks for uploads, picture cache and ferret index folder.
@@ -31,22 +29,11 @@ Capistrano::Configuration.instance(:must_exist).load do
31
29
  task :symlink, :roles => :app do
32
30
  run "rm -rf #{current_path}/uploads"
33
31
  run "ln -nfs #{shared_path}/uploads #{current_path}/"
34
- run "rm -rf #{current_path}/public/pictures"
35
- run "ln -nfs #{shared_path}/cache/pictures #{current_path}/public/"
32
+ run "ln -nfs #{shared_path}/cache/* #{current_path}/public/"
36
33
  run "rm -rf #{current_path}/index"
37
34
  run "ln -nfs #{shared_path}/index #{current_path}/"
38
35
  end
39
36
 
40
- end
41
-
42
- namespace :files do
43
-
44
- desc "Copies all assets and migration files from Alchemy to project"
45
- task :copy do
46
- run "cd #{current_path} && RAILS_ENV=production #{rake} alchemy:assets:copy:all"
47
- run "cd #{current_path} && RAILS_ENV=production #{rake} alchemy:migrations:sync"
48
- end
49
-
50
37
  end
51
38
 
52
39
  desc "Upgrades production database to current Alchemy CMS version"
@@ -15,6 +15,8 @@ module Alchemy
15
15
  "alchemy/alchemy.js",
16
16
  "alchemy/preview.js",
17
17
  "alchemy/alchemy.css",
18
+ "alchemy/menubar.css",
19
+ "alchemy/menubar.js",
18
20
  "alchemy/print.css",
19
21
  "alchemy/tinymce_content.css",
20
22
  "alchemy/tinymce_dialog.css",
@@ -29,6 +29,7 @@ module Alchemy #:nodoc:
29
29
  include Alchemy::Essence::InstanceMethods
30
30
  stampable
31
31
  validate :essence_validations, :on => :update
32
+ has_many :contents, :as => :essence
32
33
 
33
34
  def acts_as_essence_class
34
35
  #{self.name}
@@ -92,47 +93,34 @@ module Alchemy #:nodoc:
92
93
  # validate: [format]
93
94
  # validate_format_with: '^[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5}(:[0-9]{1,5})?(\/.*)?$'
94
95
  #
95
- def essence_validations
96
- return true if description.blank? || description['validate'].blank?
97
- description['validate'].each do |validation|
98
- if validation == 'presence' && ingredient.blank?
99
- add_essence_error "blank"
100
- elsif validation == 'format'
101
- if description['validate_format_as'].blank? && !description['validate_format_with'].blank?
102
- matcher = Regexp.new(description['validate_format_with'])
103
- elsif !description['validate_format_as'].blank? && description['validate_format_with'].blank?
104
- case description['validate_format_as']
105
- when 'email'
106
- then matcher = Authlogic::Regex.email
107
- when 'url'
108
- then matcher = /^[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5}(:[0-9]{1,5})?(\/.*)?$/ix
109
- else
110
- raise "No validation format matcher found for #{description['validate_format_as']}"
111
- end
112
- else
113
- raise 'No validation format matcher given'
114
- end
115
- if ingredient.match(matcher).nil?
116
- add_essence_error "wrong_format"
117
- end
118
- elsif validation == 'uniqueness' && !acts_as_essence_class.send("find_by_#{ingredient_column}", ingredient).blank?
119
- add_essence_error "taken"
120
- end
121
- end
122
- end
123
-
124
- def essence_errors
125
- @essence_errors ||= []
126
- end
127
-
128
- def essence_errors=(errors)
129
- @essence_errors ||= errors
130
- end
131
-
132
- def add_essence_error(error)
133
- essence_errors << error
134
- errors.add(:base, :essence_validation_failed)
135
- end
96
+ def essence_validations
97
+ return true if description.blank? || description['validate'].blank?
98
+ description['validate'].each do |validation|
99
+ if validation == 'presence' && ingredient.blank?
100
+ errors.add(ingredient_column.to_sym, :blank)
101
+ elsif validation == 'format'
102
+ if description['validate_format_as'].blank? && !description['validate_format_with'].blank?
103
+ matcher = Regexp.new(description['validate_format_with'])
104
+ elsif !description['validate_format_as'].blank? && description['validate_format_with'].blank?
105
+ case description['validate_format_as']
106
+ when 'email'
107
+ then matcher = Authlogic::Regex.email
108
+ when 'url'
109
+ then matcher = /^[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5}(:[0-9]{1,5})?(\/.*)?$/ix
110
+ else
111
+ raise "No validation format matcher found for #{description['validate_format_as']}"
112
+ end
113
+ else
114
+ raise 'No validation format matcher given'
115
+ end
116
+ if ingredient.match(matcher).nil?
117
+ errors.add(ingredient_column.to_sym, :invalid)
118
+ end
119
+ elsif validation == 'uniqueness' && !acts_as_essence_class.send("find_by_#{ingredient_column}", ingredient).blank?
120
+ errors.add(ingredient_column.to_sym, :taken)
121
+ end
122
+ end
123
+ end
136
124
 
137
125
  # Essence description from config/elements.yml
138
126
  def description
@@ -22,7 +22,7 @@ module Alchemy
22
22
  #
23
23
  def self.t(msg, *args)
24
24
  options = args.extract_options!
25
- options[:default] = options[:default] ? options[:default] : msg.to_s.humanize
25
+ options[:default] = options[:default] ? options[:default] : msg
26
26
  scope = ['alchemy']
27
27
  case options[:scope].class.name
28
28
  when "Array"