alchemy_cms 3.0.0.rc5 → 3.0.0.rc6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (124) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +2 -5
  3. data/README.md +32 -5
  4. data/alchemy_cms.gemspec +1 -1
  5. data/app/assets/javascripts/alchemy/alchemy.buttons.js.coffee +3 -3
  6. data/app/assets/javascripts/alchemy/alchemy.char_counter.js.coffee +19 -0
  7. data/app/assets/javascripts/alchemy/alchemy.confirm_dialog.js.coffee +5 -0
  8. data/app/assets/javascripts/alchemy/alchemy.dialog.js.coffee +3 -2
  9. data/app/assets/javascripts/alchemy/alchemy.dragndrop.js.coffee +2 -0
  10. data/app/assets/javascripts/alchemy/alchemy.element_editors.js.coffee +1 -1
  11. data/app/assets/javascripts/alchemy/alchemy.elements_window.js.coffee +2 -26
  12. data/app/assets/javascripts/alchemy/alchemy.file_progress.js.coffee +1 -1
  13. data/app/assets/javascripts/alchemy/alchemy.gui.js.coffee +2 -0
  14. data/app/assets/javascripts/alchemy/alchemy.i18n.js.coffee +12 -7
  15. data/app/assets/javascripts/alchemy/alchemy.js +1 -1
  16. data/app/assets/javascripts/alchemy/alchemy.link_dialog.js.coffee +33 -4
  17. data/app/assets/javascripts/alchemy/alchemy.preview_window.js.coffee +1 -1
  18. data/app/assets/javascripts/alchemy/alchemy.sitemap.js.coffee +2 -13
  19. data/app/assets/javascripts/alchemy/{alchemy.tinymce.js.coffee.erb → alchemy.tinymce.js.coffee} +1 -25
  20. data/app/assets/javascripts/alchemy/alchemy.translations.js.coffee +63 -105
  21. data/app/assets/javascripts/alchemy/alchemy.uploader.js.coffee +3 -3
  22. data/app/assets/stylesheets/alchemy/_extends.scss +2 -8
  23. data/app/assets/stylesheets/alchemy/_mixins.scss +4 -9
  24. data/app/assets/stylesheets/alchemy/base.scss +6 -6
  25. data/app/assets/stylesheets/alchemy/buttons.scss +56 -29
  26. data/app/assets/stylesheets/alchemy/elements.scss +66 -14
  27. data/app/assets/stylesheets/alchemy/form_fields.scss +39 -6
  28. data/app/assets/stylesheets/alchemy/forms.scss +32 -0
  29. data/app/assets/stylesheets/alchemy/frame.scss +44 -44
  30. data/app/assets/stylesheets/alchemy/icons.scss +2 -2
  31. data/app/assets/stylesheets/alchemy/jquery-ui.scss +2 -0
  32. data/app/assets/stylesheets/alchemy/notices.scss +6 -0
  33. data/app/assets/stylesheets/alchemy/selects.scss +10 -0
  34. data/app/assets/stylesheets/alchemy/sitemap.scss +8 -10
  35. data/app/assets/stylesheets/alchemy/toolbar.scss +40 -31
  36. data/app/assets/stylesheets/tinymce/skins/alchemy/skin.min.css.scss +11 -22
  37. data/app/controllers/alchemy/admin/base_controller.rb +14 -1
  38. data/app/controllers/alchemy/admin/elements_controller.rb +4 -2
  39. data/app/controllers/alchemy/admin/layoutpages_controller.rb +5 -0
  40. data/app/controllers/alchemy/admin/legacy_page_urls_controller.rb +39 -0
  41. data/app/controllers/alchemy/admin/pages_controller.rb +0 -3
  42. data/app/controllers/alchemy/base_controller.rb +7 -4
  43. data/app/helpers/alchemy/admin/base_helper.rb +33 -3
  44. data/app/helpers/alchemy/pages_helper.rb +1 -1
  45. data/app/models/alchemy/element.rb +6 -4
  46. data/app/models/alchemy/legacy_page_url.rb +5 -1
  47. data/app/models/alchemy/message.rb +2 -2
  48. data/app/models/alchemy/page.rb +8 -9
  49. data/app/models/alchemy/page/{cells.rb → page_cells.rb} +1 -1
  50. data/app/models/alchemy/page/{elements.rb → page_elements.rb} +1 -1
  51. data/app/models/alchemy/page/{naming.rb → page_naming.rb} +33 -18
  52. data/app/models/alchemy/page/{natures.rb → page_natures.rb} +1 -1
  53. data/app/models/alchemy/page/{scopes.rb → page_scopes.rb} +1 -1
  54. data/app/models/alchemy/page/{users.rb → page_users.rb} +13 -1
  55. data/app/views/alchemy/admin/elements/_add_element_button.html.erb +18 -0
  56. data/app/views/alchemy/admin/elements/_add_picture.html.erb +1 -1
  57. data/app/views/alchemy/admin/elements/_element.html.erb +12 -11
  58. data/app/views/alchemy/admin/elements/_new_element_form.html.erb +3 -0
  59. data/app/views/alchemy/admin/elements/create.js.erb +3 -3
  60. data/app/views/alchemy/admin/elements/index.html.erb +19 -4
  61. data/app/views/alchemy/admin/elements/new.html.erb +3 -0
  62. data/app/views/alchemy/admin/elements/trash.js.erb +16 -12
  63. data/app/views/alchemy/admin/layoutpages/_layoutpage.html.erb +1 -1
  64. data/app/views/alchemy/admin/layoutpages/edit.html.erb +11 -0
  65. data/app/views/alchemy/admin/layoutpages/index.html.erb +4 -16
  66. data/app/views/alchemy/admin/legacy_page_urls/_form.html.erb +5 -0
  67. data/app/views/alchemy/admin/legacy_page_urls/_label.html.erb +1 -0
  68. data/app/views/alchemy/admin/legacy_page_urls/_legacy_page_url.html.erb +13 -0
  69. data/app/views/alchemy/admin/legacy_page_urls/_new.html.erb +20 -0
  70. data/app/views/alchemy/admin/legacy_page_urls/create.js.erb +10 -0
  71. data/app/views/alchemy/admin/legacy_page_urls/destroy.js.erb +6 -0
  72. data/app/views/alchemy/admin/legacy_page_urls/update.js.erb +2 -0
  73. data/app/views/alchemy/admin/pages/_form.html.erb +58 -0
  74. data/app/views/alchemy/admin/pages/_internal_link.html.erb +9 -4
  75. data/app/views/alchemy/admin/pages/_legacy_urls.html.erb +23 -0
  76. data/app/views/alchemy/admin/pages/_locked_page.html.erb +21 -0
  77. data/app/views/alchemy/admin/pages/_page.html.erb +2 -2
  78. data/app/views/alchemy/admin/pages/_page_status.html.erb +11 -9
  79. data/app/views/alchemy/admin/pages/_tinymce_custom_config.html.erb +13 -0
  80. data/app/views/alchemy/admin/pages/configure.html.erb +16 -57
  81. data/app/views/alchemy/admin/pages/edit.html.erb +64 -66
  82. data/app/views/alchemy/admin/pages/index.html.erb +9 -19
  83. data/app/views/alchemy/admin/pages/update.js.erb +1 -1
  84. data/app/views/alchemy/admin/partials/_remote_search_form.html.erb +7 -12
  85. data/app/views/alchemy/admin/partials/_routes.html.erb +25 -0
  86. data/app/views/alchemy/admin/partials/_search_form.html.erb +10 -12
  87. data/app/views/alchemy/admin/pictures/_filter_and_size_bar.html.erb +53 -47
  88. data/app/views/alchemy/admin/pictures/index.html.erb +34 -29
  89. data/app/views/alchemy/essences/shared/_essence_picture_tools.html.erb +1 -1
  90. data/app/views/alchemy/navigation/_link.html.erb +9 -9
  91. data/app/views/alchemy/pages/show.rss.builder +2 -2
  92. data/app/views/layouts/alchemy/admin.html.erb +20 -9
  93. data/bin/alchemy +1 -1
  94. data/config/alchemy/config.yml +1 -0
  95. data/config/locales/alchemy.de.yml +15 -1
  96. data/config/locales/alchemy.en.yml +29 -19
  97. data/config/locales/alchemy.nl.yml +11 -1
  98. data/config/routes.rb +2 -1
  99. data/lib/alchemy/errors.rb +2 -2
  100. data/lib/alchemy/permissions.rb +2 -0
  101. data/lib/alchemy/resource.rb +22 -9
  102. data/lib/alchemy/tinymce.rb +13 -7
  103. data/lib/alchemy/version.rb +1 -1
  104. data/spec/controllers/admin/base_controller_spec.rb +39 -0
  105. data/spec/controllers/admin/elements_controller_spec.rb +17 -14
  106. data/spec/controllers/admin/pages_controller_spec.rb +1 -2
  107. data/spec/controllers/pages_controller_spec.rb +7 -3
  108. data/spec/dummy/app/models/dummy_user.rb +12 -2
  109. data/spec/features/admin/dashboard_spec.rb +45 -0
  110. data/spec/features/admin/legacy_page_url_management_spec.rb +62 -0
  111. data/spec/features/admin/page_editing_feature_spec.rb +66 -6
  112. data/spec/features/page_feature_spec.rb +13 -0
  113. data/spec/helpers/admin/base_helper_spec.rb +36 -0
  114. data/spec/libraries/resource_spec.rb +168 -84
  115. data/spec/libraries/tinymce_spec.rb +10 -0
  116. data/spec/models/element_spec.rb +16 -0
  117. data/spec/models/legacy_page_url_spec.rb +21 -0
  118. data/spec/models/message_spec.rb +23 -7
  119. data/spec/models/page_spec.rb +89 -12
  120. data/vendor/assets/javascripts/tinymce/plugins/anchor/plugin.min.js +1 -0
  121. data/vendor/assets/javascripts/tinymce/plugins/hr/plugin.min.js +1 -0
  122. metadata +96 -75
  123. data/app/assets/javascripts/alchemy/alchemy.routes.js.erb +0 -38
  124. data/spec/models/resource_spec.rb +0 -159
@@ -186,3 +186,4 @@ open_external_links_in_new_tab: true
186
186
  format_matchers:
187
187
  email: !ruby/regexp '/\A[^@\s]+@([^@\s]+\.)+[^@\s]+\z/'
188
188
  url: !ruby/regexp '/\A[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5}(:[0-9]{1,5})?(\/.*)?\z/ix'
189
+ link_url: !ruby/regexp '/^(mailto:|\/|[a-z]+:\/\/)/'
@@ -169,11 +169,13 @@ de:
169
169
  site:
170
170
  aliases: Weitere Domains bitte mit Leerzeichen oder Leerzeile getrennt angeben.
171
171
 
172
+ anchor: 'Sprungmarke'
172
173
  back: 'zurück'
173
174
  create_tree_as_new_language: "%{language} als neuen Sprachbaum anlegen"
174
175
  "<a href=\"http://get.adobe.com/flashplayer\" target=\"_blank\">%{value}</a>": ""
175
176
  "Active Pages": "Aktive Seiten"
176
177
  "Add global page": "Neue globale Seite"
178
+ "Add page link": "Verweis hinzufügen"
177
179
  "Adobe Website": "Adobe Webseite"
178
180
  "Alchemy is open software and itself uses open software and free resources:": "Alchemy ist offene Software und benutzt selbst offene Software und freie Ressourcen:"
179
181
  "Alchemy is up to date": 'Alchemy ist aktuell'
@@ -228,6 +230,7 @@ de:
228
230
  "New": "Neu"
229
231
  "New Element": "Element hinzufügen"
230
232
  "New page": "Neue Seite"
233
+ "No page links for this page found": "Keine Verweise vorhanden."
231
234
  "New password": "Neues Passwort"
232
235
  "New Tag": "Neues Tag"
233
236
  "New Tag Created": "Neues Tag wurde erstellt"
@@ -261,6 +264,7 @@ de:
261
264
  "Please log in": "Bitte melden Sie sich an."
262
265
  "Please seperate the tags with commata": "* Die Tags bitte mit Komma getrennt eingeben."
263
266
  use_alternative_uploader_instead: "Benutzen Sie bitte diesen alternativen Uploader."
267
+ "Properties": "Eigenschaften"
264
268
  "Publish page": "veröffentlichen"
265
269
  "Read the License": "Lizenz lesen"
266
270
  "Redirects to": "Leitet weiter auf"
@@ -423,7 +427,9 @@ de:
423
427
  image_name: "Name"
424
428
  image_title: "Titel-Tag"
425
429
  images: "Bilder"
426
- internal_link_headline: "Wählen Sie eine Seite zum Verlinken."
430
+ internal_link_headline: "Wählen Sie eine Seite zum Verlinken aus."
431
+ internal_link_page_elements_explanation: "Zusätzlich können Sie rechts neben der jeweiligen Seite auf 'Elemente anzeigen' klicken, um eine Sprungmarke zu einem Element dieser Seite zu erstellen."
432
+ internal_link_page_anchors_explanation: "Alternativ können Sie auch eine Sprungmarke innerhalb der aktuellen Seite erstellen."
427
433
  "item copied to clipboard": "%{name} wurde in die Zwischenablage kopiert."
428
434
  "item moved to clipboard": "%{name} wurde in die Zwischenablage bewegt."
429
435
  "item removed from clipboard": "%{name} wurde aus der Zwischenablage entfernt."
@@ -434,6 +440,7 @@ de:
434
440
  language_pages_copied: "Der Sprachbaum wurde kopiert"
435
441
  last_upload_only: "Zuletzt hochgeladene"
436
442
  left: "links"
443
+ legacy_url_info_text: "Ein Verweis ist eine Weiterleitung einer alten URL auf die aktuelle URL dieser Seite. Diese Weiterleitung findet mit einem <a href='https://support.google.com/webmasters/answer/93633' target='_blank'>301-Status-Code</a> statt."
437
444
  link_image: "Bild verlinken"
438
445
  link_overlay_tab_label:
439
446
  contactform: "Kontaktformular"
@@ -822,6 +829,10 @@ de:
822
829
  one: "Element"
823
830
  other: "Elemente"
824
831
 
832
+ alchemy/legacy_page_url:
833
+ one: "Verweis"
834
+ other: "Verweise"
835
+
825
836
  alchemy/language:
826
837
  one: "Sprache"
827
838
  other: "Sprachen"
@@ -884,6 +895,9 @@ de:
884
895
  page_layout: "Seitentyp der Startseite"
885
896
  public: "Sprache veröffentlichen"
886
897
 
898
+ alchemy/legacy_page_url:
899
+ urlname: "URL-Pfad"
900
+
887
901
  alchemy/page:
888
902
  created_at: "Erstellt am"
889
903
  language: "Sprache"
@@ -99,9 +99,9 @@ en:
99
99
  message: 'Message'
100
100
  send: 'Send'
101
101
  mandatory_fields: '*Mandatory fields.'
102
- # The flash message shown after succesfully sending the message.
102
+ # The flash message shown after successfully sending the message.
103
103
  messages:
104
- success: 'Your message was delivered succesfully.'
104
+ success: 'Your message was delivered successfully.'
105
105
 
106
106
  # == Translated language names for translation select
107
107
  translations:
@@ -159,8 +159,8 @@ en:
159
159
  "Page saved": "Page: '%{name}' saved."
160
160
  "Password": "Password"
161
161
  "Paste from clipboard": "Paste from clipboard"
162
- "Successfully added content": "Succesfully added %{content}"
163
- "Successfully deleted content": "Succesfully deleted %{content}"
162
+ "Successfully added content": "Successfully added %{content}"
163
+ "Successfully deleted content": "Successfully deleted %{content}"
164
164
  "User created": "User created"
165
165
  "User deleted": "User deleted"
166
166
  "User updated": "User updated"
@@ -210,11 +210,11 @@ en:
210
210
  download_file: "Download file '%{filename}'"
211
211
  "Drag an element over to the element window to restore it": "Drag an element over to the element window to restore it."
212
212
  drag_to_sort: "Drag'n'Drop to sort images"
213
- edit_file_properties: "Edit Fileproperties"
213
+ edit_file_properties: "Edit file properties."
214
214
  edit_image_properties: "Edit image properties."
215
215
  edit_language: "Edit language"
216
216
  edit_page: "Edit this page"
217
- edit_page_properties: "Edit the page´s properties."
217
+ edit_page_properties: "Edit the page's properties."
218
218
  edit_selected_pictures: "Edit selected pictures"
219
219
  element_description_missing: "WARNING! Missing description. Please check your elements.yml file."
220
220
  element_dirty_close_window_notice: "You have unsaved elements. Do you really want to close the elements window?"
@@ -232,12 +232,12 @@ en:
232
232
  step1: "Click the 'browse' button and navigate to your %{name} folder"
233
233
  step2: "Select all the %{name} you want to upload"
234
234
  step3: "Click the 'open' button. The upload starts!"
235
- external_link_notice_1: "Please enter the complete url with http:// or a similiar protocol."
235
+ external_link_notice_1: "Please enter the complete url with http:// or a similar protocol."
236
236
  external_link_notice_2: "To refer a path from your website url, start with a /."
237
237
  female: "Female"
238
238
  file: "File"
239
239
  file_rename_error: "Error renaming file."
240
- "File uploaded succesfully": "File %{name} succesfully uploaded"
240
+ "File uploaded succesfully": "File %{name} successfully uploaded"
241
241
  "File upload error": "File upload error: %{error}"
242
242
  from_at: "from %{by} at %{at}"
243
243
  'Global shortcuts': 'Global shortcuts'
@@ -249,7 +249,7 @@ en:
249
249
  "Open logout dialog": "Open logout dialog"
250
250
  "Focus search field": "Focus search field"
251
251
  "Create a new record": "Create a new record"
252
- "Show page infos": "Show page infos"
252
+ "Show page infos": "Show page info"
253
253
  "Create new element": "Create new element"
254
254
  "Edit page properties": "Edit page properties"
255
255
  "Reload the preview": "Reload the preview"
@@ -264,6 +264,8 @@ en:
264
264
  image_name: "Name"
265
265
  image_title: "Title-tag"
266
266
  internal_link_headline: "Choose a page to link to."
267
+ internal_link_page_elements_explanation: "Additionally you can click right beside a page on 'Show Elements' to link to an anchor of an element from that page."
268
+ internal_link_page_anchors_explanation: "Alternatively you can link to an anchor of the actual page."
267
269
  "item copied to clipboard": "Copied %{name} to clipboard"
268
270
  "item moved to clipboard": "Moved %{name} to clipboard"
269
271
  "item removed from clipboard": "Removed %{name} from clipboard"
@@ -271,15 +273,16 @@ en:
271
273
  javascript_disabled_text: "Alchemy needs Javascript to run smoothly. Please enable it in your browser settings."
272
274
  language_code_placeholder: 'i.e. en'
273
275
  language_does_not_exist: "This language tree does not exist"
274
- language_pages_copied: "Language tree succesfully copied."
276
+ language_pages_copied: "Language tree successfully copied."
277
+ legacy_url_info_text: "A link is a redirect from an old URL to the current URL of this page. This redirect happens with a <a href='https://support.google.com/webmasters/answer/93633' target='_blank'>301 status code</a>."
275
278
  "Library shortcuts": "Library shortcuts"
276
279
  link_image: "Link this image."
277
280
  link_overlay_tab_label:
278
- contactform: "Contactform"
281
+ contactform: "Contact form"
279
282
  external: "External"
280
283
  file: "File"
281
284
  internal: "Internal"
282
- link_title: "Linktitle"
285
+ link_title: "Link title"
283
286
  mail_to: "Recipient"
284
287
  male: "Male"
285
288
  medium_thumbnails: "Medium thumbnails"
@@ -298,7 +301,7 @@ en:
298
301
  sites: "Sites"
299
302
  name: "Name"
300
303
  names: "Names"
301
- navigation_name: "Navigationname"
304
+ navigation_name: "Navigation name"
302
305
  no_default_language_found: "No default language found."
303
306
  no_element_given: "No element given."
304
307
  no_files_in_archive: "You do not have any files in your archive."
@@ -340,7 +343,7 @@ en:
340
343
  comma_seperated: "Separate by comma"
341
344
  password: "Password"
342
345
  picture_gallery_editor: 'Pictures'
343
- "Picture uploaded succesfully": "Picture %{name} uploaded succesfully"
346
+ "Picture uploaded succesfully": "Picture %{name} uploaded successfully"
344
347
  "Picture validation error": "Error while uploading %{name}"
345
348
  "Picture renamed successfully": "Picture renamed successfully from %{from} to %{to}"
346
349
  "Picture deleted successfully": "Picture %{name} successfully deleted"
@@ -354,7 +357,7 @@ en:
354
357
  recent: "that where recently uploaded"
355
358
  without_tag: "without tag"
356
359
  place_link: "Link text"
357
- player_version: "Flashplayer Version"
360
+ player_version: "Flash Player version"
358
361
  "please enter subject and mail address": "Please enter recipient and subject."
359
362
  please_confirm: "Please confirm"
360
363
  please_wait: "Please wait"
@@ -372,7 +375,7 @@ en:
372
375
  robot_follow: "robot may follow links."
373
376
  robot_index: "allow robot to index."
374
377
  saved_link: "Link saved."
375
- search_engines: "Searchengines"
378
+ search_engines: "Search engines"
376
379
  select_element: "Select element"
377
380
  show_element_content: "Show content of this element."
378
381
  show_elements_from_page: "Show all elements from this page"
@@ -383,9 +386,9 @@ en:
383
386
  sitemap_editor_notice: "The sitemap is autogenerated."
384
387
  searchresults_editor_info: "This element displays the search and the searchresults."
385
388
  small_thumbnails: "Small thumbnails"
386
- successfully_added_element: "Succesfully added new element."
387
- successfully_restored_element: "Element restored succesfully."
388
- successfully_saved_element_position: "Element position updated succesfully."
389
+ successfully_added_element: "Successfully added new element."
390
+ successfully_restored_element: "Element restored successfully."
391
+ successfully_saved_element_position: "Element position updated successfully."
389
392
  swap_image: "Change image"
390
393
  "These pictures could not be deleted, because they were in use": "These pictures could not be deleted, because they were in use: %{names}"
391
394
  insert_image: "Insert image"
@@ -614,6 +617,10 @@ en:
614
617
  one: File
615
618
  other: Files
616
619
 
620
+ alchemy/legacy_page_url:
621
+ one: "Link"
622
+ other: "Links"
623
+
617
624
  alchemy/picture:
618
625
  one: Picture
619
626
  other: Pictures
@@ -646,6 +653,9 @@ en:
646
653
  page_layout: "Pagetype of frontpage"
647
654
  public: "Public"
648
655
 
656
+ alchemy/legacy_page_url:
657
+ urlname: "URL path"
658
+
649
659
  alchemy/page:
650
660
  created_at: "Created at"
651
661
  language: "Language"
@@ -411,6 +411,8 @@ nl:
411
411
  image_title: "Titel-tag"
412
412
  images: "Bilder"
413
413
  internal_link_headline: "Kies een pagina om een snelkoppeling naar te maken."
414
+ internal_link_page_elements_explanation: "Additionally you can click right beside a page on 'Show Elements' to link to an anchor of an element from that page."
415
+ internal_link_page_anchors_explanation: "Alternativly you can link to an anchor of the actual page."
414
416
  "item copied to clipboard": "%{name} naar het klembord gekopieerd"
415
417
  "item moved to clipboard": "%{name} naar het klembord verplaatst"
416
418
  "item removed from clipboard": "%{name} van het klembord verwijderd"
@@ -421,6 +423,7 @@ nl:
421
423
  language_pages_copied: "Boomstructuur gekopieerd."
422
424
  last_upload_only: "Alleen de laatste upload"
423
425
  left: "links"
426
+ legacy_url_info_text: "A link is a redirect from an old URL to the current URL of this page. This redirect happens with a <a href='https://support.google.com/webmasters/answer/93633' target='_blank'>301 status code</a>."
424
427
  link_image: "Snelkoppeling naar deze afbeelding maken."
425
428
  link_overlay_tab_label:
426
429
  contactform: "Contactformulier"
@@ -692,7 +695,7 @@ nl:
692
695
  hour: "Uur"
693
696
  day: "Dag"
694
697
  month: "Maand"
695
- year: "Jaar"
698
+ year: "Jaar"
696
699
  number:
697
700
  format:
698
701
  precision: 2
@@ -828,6 +831,10 @@ nl:
828
831
  one: "Element"
829
832
  other: "Elementen"
830
833
 
834
+ alchemy/legacy_page_url:
835
+ one: "Link"
836
+ other: "Links"
837
+
831
838
  alchemy/language:
832
839
  one: "Taal"
833
840
  other: "Talen"
@@ -890,6 +897,9 @@ nl:
890
897
  page_layout: "Paginatype van voorpagina"
891
898
  public: "Publiek"
892
899
 
900
+ alchemy/legacy_page_url:
901
+ urlname: "URL path"
902
+
893
903
  alchemy/page:
894
904
  created_at: "Aangemaakt op"
895
905
  language: "Taal"
@@ -78,7 +78,7 @@ Alchemy::Engine.routes.draw do
78
78
  end
79
79
  end
80
80
 
81
- resources :layoutpages, :only => :index
81
+ resources :layoutpages, :only => [:index, :edit]
82
82
 
83
83
  resources :pictures do
84
84
  collection do
@@ -113,6 +113,7 @@ Alchemy::Engine.routes.draw do
113
113
  end
114
114
  end
115
115
 
116
+ resources :legacy_page_urls
116
117
  resources :languages
117
118
 
118
119
  resource :clipboard, :only => :index, :controller => 'clipboard' do
@@ -50,9 +50,9 @@ module Alchemy
50
50
  end
51
51
 
52
52
  class MissingActiveRecordAssociation < StandardError
53
- # Raised if a resource_relation is defined without proper ActiveRecord association
53
+ # Raised if a alchemy_resource_relation is defined without proper ActiveRecord association
54
54
  def message
55
- "You need to define proper ActiveRecord associations, if you want to use resource_relations."
55
+ "You need to define proper ActiveRecord associations, if you want to use alchemy_resource_relations."
56
56
  end
57
57
  end
58
58
 
@@ -87,6 +87,7 @@ module Alchemy
87
87
  # Controller actions
88
88
  can [:info, :help], :alchemy_admin_dashboard
89
89
  can :index, :trash
90
+ can :edit, :alchemy_admin_layoutpages
90
91
 
91
92
  # Resources
92
93
  can [:read, :download], Alchemy::Attachment
@@ -95,6 +96,7 @@ module Alchemy
95
96
  can :manage, Alchemy::Element
96
97
  can :manage, Alchemy::EssenceFile
97
98
  can :manage, Alchemy::EssencePicture
99
+ can :manage, Alchemy::LegacyPageUrl
98
100
  can :edit_content, Alchemy::Page
99
101
  can [:read, :thumbnail, :info], Alchemy::Picture
100
102
  can [:read, :autocomplete], Alchemy::Tag
@@ -23,8 +23,14 @@ module Alchemy
23
23
  # Usually you don't want your users to edit all attributes provided by a model. Hence some default attributes,
24
24
  # namely id, updated_at, created_at, creator_id and updater_id are not returned by Resource#attributes.
25
25
  #
26
- # If you want to skip a different set of attributes just define a skip_attributes class method in your model class
27
- # that returns an array of strings: %W[id, updated_at]
26
+ # If you want to skip a different set of attributes just define a +skipped_alchemy_resource_attributes+ class method in your model class
27
+ # that returns an array of strings.
28
+ #
29
+ # === Example
30
+ #
31
+ # def self.skipped_alchemy_resource_attributes
32
+ # %w(id updated_at secret_token remote_ip)
33
+ # end
28
34
  #
29
35
  # == Resource relations
30
36
  #
@@ -67,17 +73,17 @@ module Alchemy
67
73
  # resource = Resource.new('/admin/tags', {"engine_name"=>"alchemy"}, ActsAsTaggableOn::Tag)
68
74
  #
69
75
  class Resource
70
- attr_accessor :skip_attributes, :resource_relations, :model_associations
76
+ attr_accessor :skipped_attributes, :resource_relations, :model_associations
71
77
  attr_reader :model
72
78
 
73
- DEFAULT_SKIPPED_ATTRIBUTES = %W[id updated_at created_at creator_id updater_id]
79
+ DEFAULT_SKIPPED_ATTRIBUTES = %w(id updated_at created_at creator_id updater_id)
74
80
  DEFAULT_SKIPPED_ASSOCIATIONS = %w(creator updater)
75
81
 
76
82
  def initialize(controller_path, module_definition=nil, custom_model=nil)
77
83
  @controller_path = controller_path
78
84
  @module_definition = module_definition
79
85
  @model = (custom_model or guess_model_from_controller_path)
80
- self.skip_attributes = model.respond_to?(:skip_attributes) ? model.skip_attributes : DEFAULT_SKIPPED_ATTRIBUTES
86
+ self.skipped_attributes = model.respond_to?(:skipped_alchemy_resource_attributes) ? model.skipped_alchemy_resource_attributes : DEFAULT_SKIPPED_ATTRIBUTES
81
87
  if model.respond_to?(:alchemy_resource_relations)
82
88
  if not model.respond_to?(:reflect_on_all_associations)
83
89
  raise MissingActiveRecordAssociation
@@ -114,8 +120,12 @@ module Alchemy
114
120
 
115
121
  def attributes
116
122
  @_attributes ||= self.model.columns.collect do |col|
117
- unless self.skip_attributes.include?(col.name)
118
- { :name => col.name, :type => resource_relation_type(col.name) || col.type, :relation => resource_relation(col.name) }.delete_if { |k, v | v.nil? }
123
+ unless self.skipped_attributes.include?(col.name)
124
+ {
125
+ name: col.name,
126
+ type: resource_column_type(col),
127
+ relation: resource_relation(col.name)
128
+ }.delete_if { |k, v| v.nil? }
119
129
  end
120
130
  end.compact
121
131
  end
@@ -152,8 +162,7 @@ module Alchemy
152
162
  false
153
163
  end
154
164
 
155
-
156
- private
165
+ private
157
166
 
158
167
  def guess_model_from_controller_path
159
168
  resource_array.join('/').classify.constantize
@@ -171,6 +180,10 @@ module Alchemy
171
180
  resource_relation(column_name).try(:[], :attr_type)
172
181
  end
173
182
 
183
+ def resource_column_type(col)
184
+ resource_relation_type(col.name) || (col.try(:array) ? :array : col.type)
185
+ end
186
+
174
187
  def resource_relation(column_name)
175
188
  resource_relations[column_name.to_sym] if resource_relations
176
189
  end
@@ -2,20 +2,22 @@ module Alchemy
2
2
  module Tinymce
3
3
  mattr_accessor :languages, :plugins
4
4
 
5
- @@plugins = %w(alchemy_link autoresize charmap code directionality fullscreen link paste tabfocus table)
5
+ @@plugins = %w(alchemy_link anchor autoresize charmap code directionality fullscreen hr link paste tabfocus table)
6
6
  @@languages = ['en', 'de']
7
7
  @@init = {
8
8
  skin: 'alchemy',
9
9
  width: '100%',
10
- resize: false,
10
+ resize: true,
11
11
  autoresize_min_height: '105',
12
+ autoresize_max_height: '480',
12
13
  menubar: false,
13
- statusbar: false,
14
+ statusbar: true,
14
15
  toolbar1: 'bold italic underline | strikethrough subscript superscript | numlist bullist indent outdent | removeformat | fullscreen',
15
- toolbar2: 'pastetext charmap code | undo redo | alchemy_link unlink',
16
+ toolbar2: 'pastetext charmap hr | undo redo | alchemy_link unlink anchor | code',
16
17
  fix_list_elements: true,
17
18
  convert_urls: false,
18
- entity_encoding: 'raw'
19
+ entity_encoding: 'raw',
20
+ element_format: 'html'
19
21
  }
20
22
 
21
23
  def self.init=(settings)
@@ -26,8 +28,12 @@ module Alchemy
26
28
  @@init
27
29
  end
28
30
 
29
- def self.custom_config_contents
30
- @@custom_config_contents ||= content_definitions_from_elements(Element.definitions)
31
+ def self.custom_config_contents(page = nil)
32
+ if page
33
+ content_definitions_from_elements(page.element_definitions)
34
+ else
35
+ content_definitions_from_elements(Element.definitions)
36
+ end
31
37
  end
32
38
 
33
39
  private
@@ -1,5 +1,5 @@
1
1
  module Alchemy
2
- VERSION = "3.0.0.rc5"
2
+ VERSION = "3.0.0.rc6"
3
3
 
4
4
  def self.version
5
5
  VERSION
@@ -32,4 +32,43 @@ describe Alchemy::Admin::BaseController do
32
32
  end
33
33
  end
34
34
 
35
+ describe '#raise_exception?' do
36
+ subject { controller.send(:raise_exception?) }
37
+
38
+ context 'in test mode' do
39
+ before { Rails.env.stub(test?: true) }
40
+ it { should be_true }
41
+ end
42
+
43
+ context 'in page preview' do
44
+ before { controller.stub(is_page_preview?: true) }
45
+ it { should be_true }
46
+ end
47
+
48
+ context 'not in test mode' do
49
+ before { Rails.env.stub(test?: false) }
50
+ it { should be_false }
51
+
52
+ context 'and not in page preview' do
53
+ before { controller.stub(is_page_preview?: false) }
54
+ it { should be_false }
55
+ end
56
+ end
57
+ end
58
+
59
+ describe '#is_page_preview?' do
60
+ subject { controller.send(:is_page_preview?) }
61
+
62
+ it { should be_false }
63
+
64
+ context 'is pages controller and show action' do
65
+ before do
66
+ controller.stub(controller_path: 'alchemy/admin/pages')
67
+ controller.stub(action_name: 'show')
68
+ end
69
+
70
+ it { should be_true }
71
+ end
72
+ end
73
+
35
74
  end