alchemy_cms 3.3.0.rc1 → 3.3.0.rc2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (269) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +3 -2
  3. data/Gemfile +1 -0
  4. data/alchemy_cms.gemspec +6 -6
  5. data/app/assets/javascripts/alchemy/alchemy.base.js.coffee +0 -7
  6. data/app/assets/javascripts/alchemy/alchemy.dialog.js.coffee +4 -4
  7. data/app/assets/javascripts/alchemy/alchemy.element_editors.js.coffee +51 -5
  8. data/app/assets/javascripts/alchemy/alchemy.sitemap.js.coffee +0 -2
  9. data/app/assets/stylesheets/alchemy/elements.scss +2 -2
  10. data/app/controllers/alchemy/admin/elements_controller.rb +2 -0
  11. data/app/controllers/alchemy/admin/pages_controller.rb +11 -3
  12. data/app/controllers/alchemy/admin/pictures_controller.rb +1 -0
  13. data/app/models/alchemy/element.rb +3 -1
  14. data/app/models/alchemy/element/element_contents.rb +2 -7
  15. data/app/models/alchemy/element/presenters.rb +11 -4
  16. data/app/models/alchemy/page.rb +3 -1
  17. data/app/views/alchemy/admin/attachments/archive_overlay.js.erb +0 -1
  18. data/app/views/alchemy/admin/contents/create.js.erb +0 -1
  19. data/app/views/alchemy/admin/elements/_element_header.html.erb +3 -1
  20. data/app/views/alchemy/admin/elements/order.js.erb +25 -10
  21. data/app/views/alchemy/admin/elements/update.js.erb +1 -2
  22. data/app/views/alchemy/admin/essence_files/assign.js.erb +0 -1
  23. data/app/views/alchemy/admin/essence_pictures/assign.js.erb +0 -1
  24. data/app/views/alchemy/admin/legacy_page_urls/create.js.erb +0 -1
  25. data/app/views/alchemy/admin/pages/destroy.js.erb +0 -1
  26. data/app/views/alchemy/admin/pages/update.js.erb +6 -4
  27. data/app/views/alchemy/admin/pictures/_filter_and_size_bar.html.erb +2 -1
  28. data/app/views/alchemy/admin/pictures/_picture_to_assign.html.erb +1 -7
  29. data/app/views/alchemy/admin/pictures/archive_overlay.js.erb +0 -1
  30. data/bin/alchemy +1 -1
  31. data/bin/rspec +3 -2
  32. data/bin/spring +6 -6
  33. data/config/alchemy/config.yml +6 -1
  34. data/lib/alchemy/seeder.rb +9 -3
  35. data/lib/alchemy/version.rb +1 -1
  36. metadata +6 -471
  37. data/spec/controllers/alchemy/admin/attachments_controller_spec.rb +0 -193
  38. data/spec/controllers/alchemy/admin/base_controller_spec.rb +0 -87
  39. data/spec/controllers/alchemy/admin/clipboard_controller_spec.rb +0 -60
  40. data/spec/controllers/alchemy/admin/contents_controller_spec.rb +0 -78
  41. data/spec/controllers/alchemy/admin/dashboard_controller_spec.rb +0 -144
  42. data/spec/controllers/alchemy/admin/elements_controller_spec.rb +0 -496
  43. data/spec/controllers/alchemy/admin/essence_files_controller_spec.rb +0 -76
  44. data/spec/controllers/alchemy/admin/essence_pictures_controller_spec.rb +0 -202
  45. data/spec/controllers/alchemy/admin/languages_controller_spec.rb +0 -73
  46. data/spec/controllers/alchemy/admin/layoutpages_controller_spec.rb +0 -21
  47. data/spec/controllers/alchemy/admin/pages_controller_spec.rb +0 -639
  48. data/spec/controllers/alchemy/admin/pictures_controller_spec.rb +0 -383
  49. data/spec/controllers/alchemy/admin/resources_controller_spec.rb +0 -81
  50. data/spec/controllers/alchemy/admin/tags_controller_spec.rb +0 -63
  51. data/spec/controllers/alchemy/admin/trash_controller_spec.rb +0 -67
  52. data/spec/controllers/alchemy/api/contents_controller_spec.rb +0 -125
  53. data/spec/controllers/alchemy/api/elements_controller_spec.rb +0 -124
  54. data/spec/controllers/alchemy/api/pages_controller_spec.rb +0 -167
  55. data/spec/controllers/alchemy/attachments_controller_spec.rb +0 -64
  56. data/spec/controllers/alchemy/base_controller_spec.rb +0 -106
  57. data/spec/controllers/alchemy/elements_controller_spec.rb +0 -48
  58. data/spec/controllers/alchemy/messages_controller_spec.rb +0 -204
  59. data/spec/controllers/alchemy/on_page_layout_mixin_spec.rb +0 -330
  60. data/spec/controllers/alchemy/pages_controller_spec.rb +0 -343
  61. data/spec/controllers/alchemy/pictures_controller_spec.rb +0 -415
  62. data/spec/dummy/Rakefile +0 -6
  63. data/spec/dummy/app/assets/javascripts/application.js +0 -13
  64. data/spec/dummy/app/assets/stylesheets/application.css +0 -15
  65. data/spec/dummy/app/controllers/admin/events_controller.rb +0 -3
  66. data/spec/dummy/app/controllers/application_controller.rb +0 -15
  67. data/spec/dummy/app/controllers/login_controller.rb +0 -5
  68. data/spec/dummy/app/helpers/application_helper.rb +0 -2
  69. data/spec/dummy/app/mailers/.gitkeep +0 -0
  70. data/spec/dummy/app/models/ability.rb +0 -9
  71. data/spec/dummy/app/models/dummy_model.rb +0 -3
  72. data/spec/dummy/app/models/dummy_user.rb +0 -15
  73. data/spec/dummy/app/models/event.rb +0 -10
  74. data/spec/dummy/app/models/location.rb +0 -3
  75. data/spec/dummy/app/views/alchemy/elements/_all_you_can_eat_editor.html.erb +0 -11
  76. data/spec/dummy/app/views/alchemy/elements/_all_you_can_eat_view.html.erb +0 -31
  77. data/spec/dummy/app/views/alchemy/elements/_article_editor.html.erb +0 -6
  78. data/spec/dummy/app/views/alchemy/elements/_article_view.html.erb +0 -10
  79. data/spec/dummy/app/views/alchemy/elements/_bild_editor.html.erb +0 -3
  80. data/spec/dummy/app/views/alchemy/elements/_bild_view.html.erb +0 -5
  81. data/spec/dummy/app/views/alchemy/elements/_contactform_editor.html.erb +0 -6
  82. data/spec/dummy/app/views/alchemy/elements/_contactform_view.html.erb +0 -16
  83. data/spec/dummy/app/views/alchemy/elements/_download_editor.html.erb +0 -3
  84. data/spec/dummy/app/views/alchemy/elements/_download_view.html.erb +0 -5
  85. data/spec/dummy/app/views/alchemy/elements/_erb_element_editor.html.erb +0 -3
  86. data/spec/dummy/app/views/alchemy/elements/_erb_element_view.html.erb +0 -5
  87. data/spec/dummy/app/views/alchemy/elements/_header_editor.html.erb +0 -3
  88. data/spec/dummy/app/views/alchemy/elements/_header_view.html.erb +0 -5
  89. data/spec/dummy/app/views/alchemy/elements/_headline_editor.html.erb +0 -1
  90. data/spec/dummy/app/views/alchemy/elements/_headline_view.html.erb +0 -1
  91. data/spec/dummy/app/views/alchemy/elements/_news_editor.html.erb +0 -5
  92. data/spec/dummy/app/views/alchemy/elements/_news_view.html.erb +0 -11
  93. data/spec/dummy/app/views/alchemy/elements/_search_editor.html.erb +0 -1
  94. data/spec/dummy/app/views/alchemy/elements/_search_view.html.erb +0 -4
  95. data/spec/dummy/app/views/alchemy/elements/_slide_editor.html.erb +0 -3
  96. data/spec/dummy/app/views/alchemy/elements/_slide_view.html.erb +0 -5
  97. data/spec/dummy/app/views/alchemy/elements/_slider_editor.html.erb +0 -2
  98. data/spec/dummy/app/views/alchemy/elements/_slider_view.html.erb +0 -4
  99. data/spec/dummy/app/views/alchemy/elements/_text_editor.html.erb +0 -3
  100. data/spec/dummy/app/views/alchemy/elements/_text_view.html.erb +0 -5
  101. data/spec/dummy/app/views/alchemy/page_layouts/_standard.html.erb +0 -15
  102. data/spec/dummy/app/views/layouts/application.html.erb +0 -17
  103. data/spec/dummy/bin/bundle +0 -3
  104. data/spec/dummy/bin/rails +0 -4
  105. data/spec/dummy/bin/rake +0 -4
  106. data/spec/dummy/config.ru +0 -4
  107. data/spec/dummy/config/alchemy/cells.yml +0 -5
  108. data/spec/dummy/config/alchemy/elements.yml +0 -109
  109. data/spec/dummy/config/alchemy/page_layouts.yml +0 -32
  110. data/spec/dummy/config/application.rb +0 -32
  111. data/spec/dummy/config/boot.rb +0 -5
  112. data/spec/dummy/config/database.yml +0 -32
  113. data/spec/dummy/config/environment.rb +0 -5
  114. data/spec/dummy/config/environments/development.rb +0 -41
  115. data/spec/dummy/config/environments/production.rb +0 -77
  116. data/spec/dummy/config/environments/test.rb +0 -43
  117. data/spec/dummy/config/initializers/alchemy.rb +0 -3
  118. data/spec/dummy/config/initializers/assets.rb +0 -11
  119. data/spec/dummy/config/initializers/backtrace_silencers.rb +0 -7
  120. data/spec/dummy/config/initializers/cookies_serializer.rb +0 -3
  121. data/spec/dummy/config/initializers/filter_parameter_logging.rb +0 -4
  122. data/spec/dummy/config/initializers/inflections.rb +0 -16
  123. data/spec/dummy/config/initializers/mime_types.rb +0 -4
  124. data/spec/dummy/config/initializers/secret_token.rb +0 -12
  125. data/spec/dummy/config/initializers/session_store.rb +0 -3
  126. data/spec/dummy/config/initializers/wrap_parameters.rb +0 -14
  127. data/spec/dummy/config/locales/kl.yml +0 -2
  128. data/spec/dummy/config/routes.rb +0 -12
  129. data/spec/dummy/config/secrets.yml +0 -22
  130. data/spec/dummy/db/migrate/20121026104128_create_events.rb +0 -20
  131. data/spec/dummy/db/migrate/20130328101418_create_locations.rb +0 -9
  132. data/spec/dummy/db/migrate/20130827094554_alchemy_two_point_six.rb +0 -1
  133. data/spec/dummy/db/migrate/20130828121054_remove_do_not_index_from_alchemy_essence_texts.rb +0 -1
  134. data/spec/dummy/db/migrate/20130828121120_remove_do_not_index_from_alchemy_essence_richtexts.rb +0 -1
  135. data/spec/dummy/db/migrate/20130918201742_add_published_at_to_alchemy_pages.rb +0 -1
  136. data/spec/dummy/db/migrate/20131209225243_create_dummy_users.rb +0 -9
  137. data/spec/dummy/db/migrate/20150122213511_acts_as_taggable_on_migration.acts_as_taggable_on_engine.rb +0 -31
  138. data/spec/dummy/db/migrate/20150122213512_add_missing_unique_indices.acts_as_taggable_on_engine.rb +0 -20
  139. data/spec/dummy/db/migrate/20150122213513_add_taggings_counter_cache_to_tags.acts_as_taggable_on_engine.rb +0 -15
  140. data/spec/dummy/db/migrate/20150122213514_add_missing_taggable_index.acts_as_taggable_on_engine.rb +0 -10
  141. data/spec/dummy/db/migrate/20150412103152_create_dummy_model.rb +0 -7
  142. data/spec/dummy/db/migrate/20150608204610_add_parent_element_id_to_alchemy_elements.rb +0 -1
  143. data/spec/dummy/db/migrate/20150729151825_add_link_text_to_alchemy_essence_files.rb +0 -1
  144. data/spec/dummy/db/migrate/20150906195818_add_locale_to_alchemy_languages.rb +0 -1
  145. data/spec/dummy/db/schema.rb +0 -326
  146. data/spec/dummy/db/seeds.rb +0 -1
  147. data/spec/dummy/lib/assets/.gitkeep +0 -0
  148. data/spec/dummy/public/404.html +0 -67
  149. data/spec/dummy/public/422.html +0 -67
  150. data/spec/dummy/public/500.html +0 -66
  151. data/spec/dummy/public/favicon.ico +0 -0
  152. data/spec/dummy/spec/javascripts +0 -1
  153. data/spec/factories.rb +0 -13
  154. data/spec/features/admin/admin_layout_spec.rb +0 -14
  155. data/spec/features/admin/dashboard_spec.rb +0 -81
  156. data/spec/features/admin/edit_elements_feature_spec.rb +0 -36
  157. data/spec/features/admin/language_tree_feature_spec.rb +0 -32
  158. data/spec/features/admin/languages_features_spec.rb +0 -65
  159. data/spec/features/admin/legacy_page_url_management_spec.rb +0 -62
  160. data/spec/features/admin/link_overlay_spec.rb +0 -53
  161. data/spec/features/admin/locale_select_feature_spec.rb +0 -25
  162. data/spec/features/admin/modules_integration_spec.rb +0 -23
  163. data/spec/features/admin/navigation_feature_spec.rb +0 -22
  164. data/spec/features/admin/page_creation_feature_spec.rb +0 -51
  165. data/spec/features/admin/page_editing_feature_spec.rb +0 -135
  166. data/spec/features/admin/picture_library_integration_spec.rb +0 -62
  167. data/spec/features/admin/resources_integration_spec.rb +0 -128
  168. data/spec/features/admin/site_select_feature_spec.rb +0 -31
  169. data/spec/features/admin/tinymce_feature_spec.rb +0 -33
  170. data/spec/features/navigation_spec.rb +0 -9
  171. data/spec/features/page_feature_spec.rb +0 -186
  172. data/spec/features/page_redirects_spec.rb +0 -358
  173. data/spec/features/picture_security_spec.rb +0 -29
  174. data/spec/features/security_spec.rb +0 -24
  175. data/spec/features/translation_integration_spec.rb +0 -51
  176. data/spec/fixtures/500x500.png +0 -0
  177. data/spec/fixtures/80x60.png +0 -0
  178. data/spec/fixtures/animated.gif +0 -0
  179. data/spec/fixtures/image with spaces.png +0 -0
  180. data/spec/fixtures/image.png +0 -0
  181. data/spec/fixtures/image2.PNG +0 -0
  182. data/spec/fixtures/image3.jpeg +0 -0
  183. data/spec/helpers/alchemy/admin/attachments_helper_spec.rb +0 -15
  184. data/spec/helpers/alchemy/admin/base_helper_spec.rb +0 -280
  185. data/spec/helpers/alchemy/admin/contents_helper_spec.rb +0 -46
  186. data/spec/helpers/alchemy/admin/elements_helper_spec.rb +0 -314
  187. data/spec/helpers/alchemy/admin/essences_helper_spec.rb +0 -201
  188. data/spec/helpers/alchemy/admin/navigation_helper_spec.rb +0 -294
  189. data/spec/helpers/alchemy/admin/pages_helper_spec.rb +0 -63
  190. data/spec/helpers/alchemy/admin/pictures_helper_spec.rb +0 -28
  191. data/spec/helpers/alchemy/admin/tags_helper_spec.rb +0 -111
  192. data/spec/helpers/alchemy/base_helper_spec.rb +0 -44
  193. data/spec/helpers/alchemy/elements_block_helper_spec.rb +0 -135
  194. data/spec/helpers/alchemy/elements_helper_spec.rb +0 -326
  195. data/spec/helpers/alchemy/essences_helper_spec.rb +0 -85
  196. data/spec/helpers/alchemy/pages_helper_spec.rb +0 -499
  197. data/spec/helpers/alchemy/picture_url_helpers_spec.rb +0 -78
  198. data/spec/helpers/alchemy/url_helper_spec.rb +0 -200
  199. data/spec/javascripts/alchemy/dialog_spec.coffee +0 -82
  200. data/spec/javascripts/alchemy/link_overlay_spec.coffee +0 -25
  201. data/spec/javascripts/alchemy_integration_spec.coffee +0 -3
  202. data/spec/javascripts/fixtures/select.html +0 -3
  203. data/spec/javascripts/helpers/mock-ajax.js +0 -199
  204. data/spec/javascripts/helpers/test_responses/test_responses.js +0 -1
  205. data/spec/javascripts/support/jasmine.yml +0 -29
  206. data/spec/libraries/auth_accessors_spec.rb +0 -40
  207. data/spec/libraries/config_spec.rb +0 -111
  208. data/spec/libraries/controller_actions_spec.rb +0 -133
  209. data/spec/libraries/i18n_spec.rb +0 -37
  210. data/spec/libraries/kaminari/scoped_pagination_url_helper_spec.rb +0 -30
  211. data/spec/libraries/modules_spec.rb +0 -67
  212. data/spec/libraries/mount_point_spec.rb +0 -77
  213. data/spec/libraries/page_layout_spec.rb +0 -150
  214. data/spec/libraries/paths_spec.rb +0 -15
  215. data/spec/libraries/permissions_spec.rb +0 -260
  216. data/spec/libraries/resource_spec.rb +0 -344
  217. data/spec/libraries/resources_helper_spec.rb +0 -193
  218. data/spec/libraries/shell_spec.rb +0 -121
  219. data/spec/libraries/template_tracker_spec.rb +0 -85
  220. data/spec/libraries/tinymce_spec.rb +0 -111
  221. data/spec/libraries/userstamp_spec.rb +0 -10
  222. data/spec/mailers/alchemy/messages_spec.rb +0 -21
  223. data/spec/models/alchemy/attachment_spec.rb +0 -250
  224. data/spec/models/alchemy/cell_spec.rb +0 -101
  225. data/spec/models/alchemy/content_spec.rb +0 -513
  226. data/spec/models/alchemy/element_spec.rb +0 -862
  227. data/spec/models/alchemy/element_to_page_spec.rb +0 -13
  228. data/spec/models/alchemy/essence_boolean_spec.rb +0 -10
  229. data/spec/models/alchemy/essence_date_spec.rb +0 -28
  230. data/spec/models/alchemy/essence_file_spec.rb +0 -40
  231. data/spec/models/alchemy/essence_html_spec.rb +0 -18
  232. data/spec/models/alchemy/essence_link_spec.rb +0 -10
  233. data/spec/models/alchemy/essence_picture_spec.rb +0 -255
  234. data/spec/models/alchemy/essence_richtext_spec.rb +0 -23
  235. data/spec/models/alchemy/essence_select_spec.rb +0 -10
  236. data/spec/models/alchemy/essence_text_spec.rb +0 -110
  237. data/spec/models/alchemy/language_spec.rb +0 -243
  238. data/spec/models/alchemy/legacy_page_url_spec.rb +0 -21
  239. data/spec/models/alchemy/message_spec.rb +0 -55
  240. data/spec/models/alchemy/page_spec.rb +0 -2108
  241. data/spec/models/alchemy/picture_spec.rb +0 -418
  242. data/spec/models/alchemy/site_spec.rb +0 -168
  243. data/spec/models/alchemy/tag_spec.rb +0 -29
  244. data/spec/models/dummy_model_spec.rb +0 -10
  245. data/spec/requests/alchemy/admin/resources_requests_spec.rb +0 -26
  246. data/spec/requests/alchemy/admin/site_requests_spec.rb +0 -19
  247. data/spec/requests/alchemy/site_requests_spec.rb +0 -18
  248. data/spec/requests/alchemy/sitemap_spec.rb +0 -56
  249. data/spec/routing/api_routing_spec.rb +0 -150
  250. data/spec/routing/routing_spec.rb +0 -340
  251. data/spec/spec_helper.rb +0 -90
  252. data/spec/support/ci/install_phantomjs +0 -7
  253. data/spec/support/hint_examples.rb +0 -28
  254. data/spec/support/test_tweaks.rb +0 -31
  255. data/spec/support/transformation_examples.rb +0 -179
  256. data/spec/tasks/helpers_spec.rb +0 -217
  257. data/spec/views/admin/pictures/show_spec.rb +0 -43
  258. data/spec/views/essences/essence_boolean_editor_spec.rb +0 -32
  259. data/spec/views/essences/essence_boolean_view_spec.rb +0 -23
  260. data/spec/views/essences/essence_date_view_spec.rb +0 -38
  261. data/spec/views/essences/essence_file_editor_spec.rb +0 -59
  262. data/spec/views/essences/essence_file_view_spec.rb +0 -77
  263. data/spec/views/essences/essence_html_view_spec.rb +0 -22
  264. data/spec/views/essences/essence_link_view_spec.rb +0 -41
  265. data/spec/views/essences/essence_picture_editor_spec.rb +0 -80
  266. data/spec/views/essences/essence_picture_view_spec.rb +0 -128
  267. data/spec/views/essences/essence_richtext_view_spec.rb +0 -32
  268. data/spec/views/essences/essence_select_view_spec.rb +0 -11
  269. data/spec/views/essences/essence_text_view_spec.rb +0 -51
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0aceaeeaef206172b82d634ae32252349217f322
4
- data.tar.gz: 649efbc4c49f43b6d42bd57455c0fffceae6b28f
3
+ metadata.gz: 5b96881451c7611c03a33ac92666841c2bd6a03e
4
+ data.tar.gz: 0b5bbdccfe93eb0dd472e22bdd4bef342c5e5dfa
5
5
  SHA512:
6
- metadata.gz: 1520b2d1092a8a0341ea3e01bd45a981f94559112208b0405c84c5bbdf199c3e0f84789df79b03776ce7a2c5e5e9f837c44ee537dff7edf1f56715aaefc43f9c
7
- data.tar.gz: eadd3e19d0eb0bab2b9f929beb66a25989e71e086bdb104e42944342da5ce8ec07c5510e8d8eec35da6466d1110ee5e45110c0803137afb7f470ee6aebbb98ed
6
+ metadata.gz: 83f2371b4a3f76bc1fe5fa6aa1f716aebea9105d0891b878fa7620cb5f2e75b228e579670f1a03da00b24dcc4aa666e380738bda5312889d9cc85f730b1649c0
7
+ data.tar.gz: 58cf314fe01120b0bd00b18dcb891df015baed64fa0cb73611b76d50194b8227fb2d09f9185813568ad10346c3fb02f32a93f72aed54f3e0a515c32ef7600ce8
@@ -15,9 +15,10 @@ __New Features__
15
15
  * Resource forms can now have Tinymce enabled by adding `.tinymce` class
16
16
  * `Alchemy::EssenceFile` now has a `link_text` attribute, so the editor is able to change the linked text of the download link.
17
17
  * Enable to pass multiple page layout names to `on_page_layout` callbacks
18
- * Client side rendering of the pages admin _(not merged yet)_
19
- * Deprecate `redirect_index` configuration _(not merged yet)_
18
+ * Client side rendering of the pages admin
19
+ * Deprecate `redirect_index` configuration
20
20
  * Add Nestable elements feature
21
+ * Default site in seeder is now configurable
21
22
 
22
23
  __Notable Changes__
23
24
 
data/Gemfile CHANGED
@@ -31,6 +31,7 @@ group :development, :test do
31
31
  gem 'poltergeist', '~> 1.5'
32
32
  gem 'rspec-activemodel-mocks', '~> 1.0'
33
33
  gem 'rspec-rails', '~> 3.0'
34
+ gem 'shoulda-matchers', '~> 3.1'
34
35
  end
35
36
 
36
37
  # We need this if we want to start the dummy app in development mode
@@ -1,21 +1,21 @@
1
- # -*- encoding: utf-8 -*-
2
- $:.push File.expand_path('../lib', __FILE__)
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
4
  require 'alchemy/version'
4
5
 
5
6
  Gem::Specification.new do |gem|
6
7
  gem.name = 'alchemy_cms'
7
8
  gem.version = Alchemy::VERSION
8
9
  gem.platform = Gem::Platform::RUBY
9
- gem.authors = ['Thomas von Deyen', 'Robin Boening', 'Marc Schettke', 'Hendrik Mans', 'Carsten Fregin']
10
+ gem.authors = ['Thomas von Deyen', 'Robin Boening', 'Marc Schettke', 'Hendrik Mans', 'Carsten Fregin', 'Martin Meyerhoff']
10
11
  gem.email = ['alchemy@magiclabs.de']
11
- gem.homepage = 'http://alchemy-cms.com'
12
+ gem.homepage = 'https://alchemy-cms.com'
12
13
  gem.summary = 'A powerful, userfriendly and flexible CMS for Rails 4'
13
14
  gem.description = 'Alchemy is a powerful, userfriendly and flexible Rails 4 CMS.'
14
15
  gem.requirements << 'ImageMagick (libmagick), v6.6 or greater.'
15
16
  gem.required_ruby_version = '>= 2.0.0'
16
17
  gem.license = 'BSD New'
17
- gem.files = `git ls-files`.split("\n")
18
- gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
18
+ gem.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^spec/}) }
19
19
  gem.executables = 'alchemy'
20
20
  gem.require_paths = ['lib']
21
21
 
@@ -69,13 +69,6 @@ $.extend Alchemy,
69
69
  Alchemy.setElementDirty $element
70
70
  false
71
71
 
72
- # Sets the element to saved state
73
- setElementSaved: (selector) ->
74
- $element = $(selector)
75
- Alchemy.setElementClean selector
76
- Alchemy.Buttons.enable $element
77
- true
78
-
79
72
  # Initializes all select tag with .alchemy_selectbox class as selectBoxIt instance
80
73
  # Pass a jQuery scope to only init a subset of selectboxes.
81
74
  SelectBox: (scope) ->
@@ -248,19 +248,19 @@ window.Alchemy.openDialog = (url, options) ->
248
248
  #
249
249
  # See Alchemy.Dialog for further options you can add to the data attribute
250
250
  #
251
- window.Alchemy.watchForDialogs = (scope) ->
252
- $('a[data-alchemy-dialog]', scope).click (e) ->
251
+ window.Alchemy.watchForDialogs = (scope = '#alchemy') ->
252
+ $(scope).on 'click', '[data-alchemy-dialog]', (e) ->
253
253
  $this = $(this)
254
254
  url = $this.attr('href')
255
255
  options = $this.data('alchemy-dialog')
256
256
  Alchemy.openDialog(url, options)
257
257
  false
258
- $('a[data-alchemy-confirm-delete]', scope).click (event) ->
258
+ $(scope).on 'click', '[data-alchemy-confirm-delete]', (event) ->
259
259
  $this = $(this)
260
260
  options = $this.data('alchemy-confirm-delete')
261
261
  Alchemy.confirmToDeleteDialog($this.attr('href'), options)
262
262
  false
263
- $('input[data-alchemy-confirm], button[data-alchemy-confirm]', scope).click (event) ->
263
+ $(scope).on 'click', '[data-alchemy-confirm]', (event) ->
264
264
  options = $(this).data('alchemy-confirm')
265
265
  Alchemy.openConfirmDialog options.message, $.extend options,
266
266
  ok_label: options.ok_label
@@ -14,15 +14,12 @@ Alchemy.ElementEditors =
14
14
  #
15
15
  init: ->
16
16
  @element_area = $("#element_area")
17
- # Binds the custom FocusElementEditor event
18
- @element_area.on "FocusElementEditor.Alchemy", '.element-editor', (e) =>
19
- @onFocusElement(e)
20
- @bindClickEvents()
17
+ @bindEvents()
21
18
  return
22
19
 
23
20
  # Binds click events on several DOM elements from element editors
24
21
  # Uses event delegation, so it is not necessary to rebind these events.
25
- bindClickEvents: ->
22
+ bindEvents: ->
26
23
  @element_area.on "click", ".element-header", (e) =>
27
24
  @onClickElement(e)
28
25
  @element_area.on "dblclick", ".element-header", (e) =>
@@ -31,6 +28,12 @@ Alchemy.ElementEditors =
31
28
  @onClickToggle(e)
32
29
  @element_area.on "click", '[data-create-missing-content]', (e) =>
33
30
  @onClickMissingContent(e)
31
+ # Binds the custom FocusElementEditor event
32
+ @element_area.on "FocusElementEditor.Alchemy", '.element-editor', (e) =>
33
+ @onFocusElement(e)
34
+ # Binds the custom SaveElement event
35
+ @element_area.on "SaveElement.Alchemy", '.element-editor', (e, data) =>
36
+ @onSaveElement(e, data)
34
37
  return
35
38
 
36
39
  # Selects and scrolls to element with given id in the preview window.
@@ -145,6 +148,29 @@ Alchemy.ElementEditors =
145
148
  callback.call()
146
149
  return
147
150
 
151
+ # Updates the title quote if one of the several conditions are met
152
+ updateTitle: (element, title, event) ->
153
+ return true if not @_shouldUpdateTitle(element, event)
154
+ @setTitle(element, title)
155
+ return
156
+
157
+ # Sets the title quote without checking that the conditions are met
158
+ setTitle: (element, title) ->
159
+ $quote = element.find('> .element-header .preview_text_quote')
160
+ $quote.text(title)
161
+ return
162
+
163
+ # Sets the element to saved state
164
+ onSaveElement: (event, data) ->
165
+ $element = $(event.currentTarget)
166
+ # JS event bubbling will also update the parents element quote.
167
+ @updateTitle($element, data.previewText, event)
168
+ # Prevent this event from beeing called twice on the same element
169
+ if event.currentTarget == event.target
170
+ Alchemy.setElementClean($element)
171
+ Alchemy.Buttons.enable($element)
172
+ true
173
+
148
174
  # Event handlers
149
175
 
150
176
  # Click event handler for element head.
@@ -200,3 +226,23 @@ Alchemy.ElementEditors =
200
226
  querystring = link.search.replace(/\?/, '')
201
227
  $.post(url, querystring)
202
228
  false
229
+
230
+ # private
231
+
232
+ _shouldUpdateTitle: (element, event) ->
233
+ editors = element.find('> .element-content .element-content-editors').children()
234
+ if @_hasParents(element)
235
+ editors.length != 0
236
+ else if @_isParent(element) && @_isFirstChild $(event.target)
237
+ editors.length == 0
238
+ else
239
+ not @_isParent(element)
240
+
241
+ _hasParents: (element) ->
242
+ element.parents('.element-editor').length != 0
243
+
244
+ _isParent: (element) ->
245
+ element.find('.nestable-elements').length != 0
246
+
247
+ _isFirstChild: (element) ->
248
+ element.closest('.nestable-elements').find(':first-child').is(element)
@@ -49,8 +49,6 @@ Alchemy.Sitemap =
49
49
  self.items = $(".sitemap_page", '#sitemap')
50
50
  self._observe()
51
51
 
52
- Alchemy.watchForDialogs('#sitemap')
53
-
54
52
  if self.options.ready
55
53
  self.options.ready()
56
54
 
@@ -32,12 +32,12 @@
32
32
  .element-title {
33
33
  overflow: hidden;
34
34
  white-space: nowrap;
35
- max-width: 322px;
35
+ max-width: 85%;
36
36
  margin-left: $default-margin;
37
+ text-overflow: ellipsis;
37
38
 
38
39
  .preview_text_quote {
39
40
  font-size: 10px;
40
- font-style: italic;
41
41
  line-height: 15px;
42
42
  }
43
43
  }
@@ -90,6 +90,7 @@ module Alchemy
90
90
 
91
91
  def order
92
92
  @trashed_element_ids = Element.trashed.where(id: params[:element_ids]).pluck(:id)
93
+ @parent_element = Element.find_by(id: params[:parent_element_id])
93
94
  Element.transaction do
94
95
  params.fetch(:element_ids, []).each_with_index do |element_id, idx|
95
96
  # Ensure to set page_id, cell_id and parent_element_id to the current page and
@@ -101,6 +102,7 @@ module Alchemy
101
102
  position: idx + 1
102
103
  )
103
104
  end
105
+ @parent_element.try!(:touch)
104
106
  end
105
107
  end
106
108
 
@@ -36,9 +36,7 @@ module Alchemy
36
36
  def tree
37
37
  authorize! :tree, :alchemy_admin_pages
38
38
 
39
- render json: PageTreeSerializer.new(@page, ability: current_ability,
40
- user: current_alchemy_user,
41
- full: params[:full] == 'true')
39
+ render json: serialized_page_tree
42
40
  end
43
41
 
44
42
  # Used by page preview iframe in Page#edit view.
@@ -103,6 +101,10 @@ module Alchemy
103
101
  if @page.update_attributes(page_params)
104
102
  @notice = Alchemy.t("Page saved", name: @page.name)
105
103
  @while_page_edit = request.referer.include?('edit')
104
+
105
+ unless @while_page_edit
106
+ @tree = serialized_page_tree
107
+ end
106
108
  else
107
109
  configure
108
110
  end
@@ -372,6 +374,12 @@ module Alchemy
372
374
  def set_root_page
373
375
  @page_root = Language.current_root_page
374
376
  end
377
+
378
+ def serialized_page_tree
379
+ PageTreeSerializer.new(@page, ability: current_ability,
380
+ user: current_alchemy_user,
381
+ full: params[:full] == 'true')
382
+ end
375
383
  end
376
384
  end
377
385
  end
@@ -133,6 +133,7 @@ module Alchemy
133
133
  @content = Content.select('id').find_by(id: params[:content_id])
134
134
  @element = Element.select('id').find_by(id: params[:element_id])
135
135
  @options = options_from_params
136
+
136
137
  respond_to do |format|
137
138
  format.html { render partial: 'archive_overlay' }
138
139
  format.js { render action: 'archive_overlay' }
@@ -57,7 +57,9 @@ module Alchemy
57
57
 
58
58
  stampable stamper_class_name: Alchemy.user_class_name
59
59
 
60
- has_many :contents, -> { order(:position) }, dependent: :destroy
60
+ # Content positions are scoped by their essence_type, so positions can be the same for different contents.
61
+ # In order to get contents in creation order we also order them by id.
62
+ has_many :contents, -> { order(:position, :id) }, dependent: :destroy
61
63
 
62
64
  # Elements can have other elements nested inside
63
65
  has_many :nested_elements,
@@ -137,13 +137,8 @@ module Alchemy
137
137
 
138
138
  # creates the contents for this element as described in the elements.yml
139
139
  def create_contents
140
- contents = []
141
- if definition["contents"].blank?
142
- log_warning "Could not find any content definitions for element: #{name}"
143
- else
144
- definition["contents"].each do |content_hash|
145
- contents << Content.create_from_scratch(self, content_hash.symbolize_keys)
146
- end
140
+ definition.fetch("contents", []).each do |content_hash|
141
+ Content.create_from_scratch(self, content_hash.symbolize_keys)
147
142
  end
148
143
  end
149
144
  end
@@ -39,10 +39,10 @@ module Alchemy
39
39
  #
40
40
  # You can flag a Content as +as_element_title+ to take this as preview.
41
41
  #
42
- # @param maxlength [Fixnum] (30)
42
+ # @param maxlength [Fixnum] (60)
43
43
  # Length of characters after the text will be cut off.
44
44
  #
45
- def preview_text(maxlength = 30)
45
+ def preview_text(maxlength = 60)
46
46
  preview_text_from_preview_content(maxlength) || preview_text_from_nested_elements(maxlength)
47
47
  end
48
48
 
@@ -80,8 +80,15 @@ module Alchemy
80
80
  "#{name}_#{id}"
81
81
  end
82
82
 
83
+ # The content that's used for element's preview text.
84
+ #
85
+ # It tries to find one of element's contents that is defined +as_element_title+.
86
+ # Takes element's first content if no content is defined +as_element_title+.
87
+ #
88
+ # @return (Alchemy::Content)
89
+ #
83
90
  def preview_content
84
- @_preview_content ||= contents.detect(&:preview_content?)
91
+ @_preview_content ||= contents.detect(&:preview_content?) || contents.first
85
92
  end
86
93
 
87
94
  private
@@ -92,7 +99,7 @@ module Alchemy
92
99
  end
93
100
 
94
101
  def preview_text_from_preview_content(maxlength)
95
- (preview_content || contents.first).try(:preview_text, maxlength)
102
+ preview_content.try!(:preview_text, maxlength)
96
103
  end
97
104
  end
98
105
  end
@@ -70,9 +70,11 @@ module Alchemy
70
70
 
71
71
  stampable stamper_class_name: Alchemy.user_class_name
72
72
 
73
+ belongs_to :language
74
+
75
+ has_one :site, through: :language
73
76
  has_many :folded_pages
74
77
  has_many :legacy_urls, class_name: 'Alchemy::LegacyPageUrl'
75
- belongs_to :language
76
78
 
77
79
  validates_presence_of :language, on: :create, unless: :root
78
80
  validates_presence_of :page_layout, unless: :systempage?
@@ -2,6 +2,5 @@
2
2
  var dialog = Alchemy.currentDialog();
3
3
  dialog.dialog_body.html('<%= j render("archive_overlay") %>');
4
4
  Alchemy.SelectBox('#filter_bar');
5
- Alchemy.watchForDialogs(dialog.dialog_body);
6
5
  Alchemy.ListFilter(dialog.dialog_body);
7
6
  })();
@@ -53,4 +53,3 @@ Alchemy.Tinymce.initEditor(<%= @content.id %>);
53
53
  Alchemy.reloadPreview();
54
54
  Alchemy.closeCurrentDialog();
55
55
  Alchemy.SelectBox("#element_<%= @element.id %>");
56
- Alchemy.watchForDialogs('#<%= @content.dom_id %>');
@@ -9,7 +9,9 @@
9
9
  </span>
10
10
  <span class="element-title">
11
11
  <span class="preview_text_element_name"><%= element.display_name %></span>
12
- <span class="preview_text_quote"><%= sanitize(element.preview_text) %></span>
12
+ <span class="preview_text_quote">
13
+ <%= sanitize(element.preview_text.presence || '&nbsp;') %>
14
+ </span>
13
15
  </span>
14
16
  <%= render_hint_for(element) unless element.trashed? %>
15
17
  <span class="ajax-folder" <%= element.trashed? ? 'style="display: none"'.html_safe : '' %>>
@@ -1,13 +1,28 @@
1
- $('#element_area .ajax-folder').show();
2
- Alchemy.PreviewWindow.refresh();
3
- <% if @trashed_element_ids.any? %>
4
- Alchemy.growl('<%= Alchemy.t(:successfully_restored_element) -%>');
5
- <% element_ids = @trashed_element_ids.collect do |id|
6
- "#element_area [data-element-id=\"#{id}\"]"
7
- end.join(", ").html_safe %>
8
- <% @trashed_element_ids.each do |id| %>
9
- $('<%= element_ids %>').each(function() { this.id = 'element_' + <%= id %> });
1
+ (function() {
2
+ <% if @parent_element && @parent_element.contents.empty? %>
3
+ var $parent = $('#element_<%= @parent_element.id %>');
4
+ Alchemy.ElementEditors.setTitle(
5
+ $parent,
6
+ '<%= sanitize(@parent_element.preview_text.presence || '&nbsp;') %>'
7
+ );
10
8
  <% end %>
9
+
10
+ <% if @trashed_element_ids.any? %>
11
+
12
+ $('#element_area .ajax-folder').show();
13
+ <% element_ids = @trashed_element_ids.collect do |id|
14
+ "#element_area [data-element-id=\"#{id}\"]"
15
+ end.join(", ").html_safe %>
16
+ <% @trashed_element_ids.each do |id| %>
17
+ $('<%= element_ids %>').each(function() { this.id = 'element_' + <%= id %> });
18
+ <% end %>
19
+ Alchemy.growl('<%= Alchemy.t(:successfully_restored_element) -%>');
20
+
11
21
  <% else %>
12
- Alchemy.growl('<%= Alchemy.t(:successfully_saved_element_position) -%>');
22
+
23
+ Alchemy.growl('<%= Alchemy.t(:successfully_saved_element_position) -%>');
24
+
13
25
  <% end %>
26
+
27
+ Alchemy.PreviewWindow.refresh();
28
+ })();
@@ -5,9 +5,8 @@
5
5
 
6
6
  <%- if @element_validated -%>
7
7
 
8
- $el.find('> .element-header').replaceWith('<%= j render("element_header", element: @element) %>');
9
8
  $errors.hide();
10
- Alchemy.setElementSaved($el);
9
+ $el.trigger('SaveElement.Alchemy', {previewText: '<%= sanitize(@element.preview_text) %>'});
11
10
  Alchemy.growl('<%= Alchemy.t(:element_saved) %>');
12
11
  Alchemy.PreviewWindow.refresh(function() {
13
12
  Alchemy.ElementEditors.selectElementInPreview(<%= @element.id %>);
@@ -6,4 +6,3 @@ $('#<%= @content.dom_id %>').replaceWith('<%= j(
6
6
  ) %>');
7
7
  Alchemy.closeCurrentDialog();
8
8
  Alchemy.setElementDirty($('#element_<%= @content.element.id %>'));
9
- Alchemy.watchForDialogs($('#<%= @content.dom_id %>'));
@@ -15,4 +15,3 @@ Alchemy.SortableContents('#<%= @content.element.id -%>_contents', '<%= form_auth
15
15
 
16
16
  Alchemy.closeCurrentDialog();
17
17
  Alchemy.setElementDirty('#element_<%= @content.element.id %>');
18
- Alchemy.watchForDialogs('#<%= @content.dom_id %>');
@@ -4,7 +4,6 @@
4
4
  $('#legacy_page_url_urlname').val('');
5
5
  $('#no_page_links_notice').hide();
6
6
  $('#legacy_page_urls').append('<%=j render "legacy_page_url", legacy_page_url: @legacy_page_url %>');
7
- Alchemy.watchForDialogs('#<%= dom_id(@legacy_page_url) %>');
8
7
  <% else %>
9
8
  $('#new_legacy_page_url').replaceWith('<%=j render("new") %>');
10
9
  <% end %>