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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -2
- data/Gemfile +1 -0
- data/alchemy_cms.gemspec +6 -6
- data/app/assets/javascripts/alchemy/alchemy.base.js.coffee +0 -7
- data/app/assets/javascripts/alchemy/alchemy.dialog.js.coffee +4 -4
- data/app/assets/javascripts/alchemy/alchemy.element_editors.js.coffee +51 -5
- data/app/assets/javascripts/alchemy/alchemy.sitemap.js.coffee +0 -2
- data/app/assets/stylesheets/alchemy/elements.scss +2 -2
- data/app/controllers/alchemy/admin/elements_controller.rb +2 -0
- data/app/controllers/alchemy/admin/pages_controller.rb +11 -3
- data/app/controllers/alchemy/admin/pictures_controller.rb +1 -0
- data/app/models/alchemy/element.rb +3 -1
- data/app/models/alchemy/element/element_contents.rb +2 -7
- data/app/models/alchemy/element/presenters.rb +11 -4
- data/app/models/alchemy/page.rb +3 -1
- data/app/views/alchemy/admin/attachments/archive_overlay.js.erb +0 -1
- data/app/views/alchemy/admin/contents/create.js.erb +0 -1
- data/app/views/alchemy/admin/elements/_element_header.html.erb +3 -1
- data/app/views/alchemy/admin/elements/order.js.erb +25 -10
- data/app/views/alchemy/admin/elements/update.js.erb +1 -2
- data/app/views/alchemy/admin/essence_files/assign.js.erb +0 -1
- data/app/views/alchemy/admin/essence_pictures/assign.js.erb +0 -1
- data/app/views/alchemy/admin/legacy_page_urls/create.js.erb +0 -1
- data/app/views/alchemy/admin/pages/destroy.js.erb +0 -1
- data/app/views/alchemy/admin/pages/update.js.erb +6 -4
- data/app/views/alchemy/admin/pictures/_filter_and_size_bar.html.erb +2 -1
- data/app/views/alchemy/admin/pictures/_picture_to_assign.html.erb +1 -7
- data/app/views/alchemy/admin/pictures/archive_overlay.js.erb +0 -1
- data/bin/alchemy +1 -1
- data/bin/rspec +3 -2
- data/bin/spring +6 -6
- data/config/alchemy/config.yml +6 -1
- data/lib/alchemy/seeder.rb +9 -3
- data/lib/alchemy/version.rb +1 -1
- metadata +6 -471
- data/spec/controllers/alchemy/admin/attachments_controller_spec.rb +0 -193
- data/spec/controllers/alchemy/admin/base_controller_spec.rb +0 -87
- data/spec/controllers/alchemy/admin/clipboard_controller_spec.rb +0 -60
- data/spec/controllers/alchemy/admin/contents_controller_spec.rb +0 -78
- data/spec/controllers/alchemy/admin/dashboard_controller_spec.rb +0 -144
- data/spec/controllers/alchemy/admin/elements_controller_spec.rb +0 -496
- data/spec/controllers/alchemy/admin/essence_files_controller_spec.rb +0 -76
- data/spec/controllers/alchemy/admin/essence_pictures_controller_spec.rb +0 -202
- data/spec/controllers/alchemy/admin/languages_controller_spec.rb +0 -73
- data/spec/controllers/alchemy/admin/layoutpages_controller_spec.rb +0 -21
- data/spec/controllers/alchemy/admin/pages_controller_spec.rb +0 -639
- data/spec/controllers/alchemy/admin/pictures_controller_spec.rb +0 -383
- data/spec/controllers/alchemy/admin/resources_controller_spec.rb +0 -81
- data/spec/controllers/alchemy/admin/tags_controller_spec.rb +0 -63
- data/spec/controllers/alchemy/admin/trash_controller_spec.rb +0 -67
- data/spec/controllers/alchemy/api/contents_controller_spec.rb +0 -125
- data/spec/controllers/alchemy/api/elements_controller_spec.rb +0 -124
- data/spec/controllers/alchemy/api/pages_controller_spec.rb +0 -167
- data/spec/controllers/alchemy/attachments_controller_spec.rb +0 -64
- data/spec/controllers/alchemy/base_controller_spec.rb +0 -106
- data/spec/controllers/alchemy/elements_controller_spec.rb +0 -48
- data/spec/controllers/alchemy/messages_controller_spec.rb +0 -204
- data/spec/controllers/alchemy/on_page_layout_mixin_spec.rb +0 -330
- data/spec/controllers/alchemy/pages_controller_spec.rb +0 -343
- data/spec/controllers/alchemy/pictures_controller_spec.rb +0 -415
- data/spec/dummy/Rakefile +0 -6
- data/spec/dummy/app/assets/javascripts/application.js +0 -13
- data/spec/dummy/app/assets/stylesheets/application.css +0 -15
- data/spec/dummy/app/controllers/admin/events_controller.rb +0 -3
- data/spec/dummy/app/controllers/application_controller.rb +0 -15
- data/spec/dummy/app/controllers/login_controller.rb +0 -5
- data/spec/dummy/app/helpers/application_helper.rb +0 -2
- data/spec/dummy/app/mailers/.gitkeep +0 -0
- data/spec/dummy/app/models/ability.rb +0 -9
- data/spec/dummy/app/models/dummy_model.rb +0 -3
- data/spec/dummy/app/models/dummy_user.rb +0 -15
- data/spec/dummy/app/models/event.rb +0 -10
- data/spec/dummy/app/models/location.rb +0 -3
- data/spec/dummy/app/views/alchemy/elements/_all_you_can_eat_editor.html.erb +0 -11
- data/spec/dummy/app/views/alchemy/elements/_all_you_can_eat_view.html.erb +0 -31
- data/spec/dummy/app/views/alchemy/elements/_article_editor.html.erb +0 -6
- data/spec/dummy/app/views/alchemy/elements/_article_view.html.erb +0 -10
- data/spec/dummy/app/views/alchemy/elements/_bild_editor.html.erb +0 -3
- data/spec/dummy/app/views/alchemy/elements/_bild_view.html.erb +0 -5
- data/spec/dummy/app/views/alchemy/elements/_contactform_editor.html.erb +0 -6
- data/spec/dummy/app/views/alchemy/elements/_contactform_view.html.erb +0 -16
- data/spec/dummy/app/views/alchemy/elements/_download_editor.html.erb +0 -3
- data/spec/dummy/app/views/alchemy/elements/_download_view.html.erb +0 -5
- data/spec/dummy/app/views/alchemy/elements/_erb_element_editor.html.erb +0 -3
- data/spec/dummy/app/views/alchemy/elements/_erb_element_view.html.erb +0 -5
- data/spec/dummy/app/views/alchemy/elements/_header_editor.html.erb +0 -3
- data/spec/dummy/app/views/alchemy/elements/_header_view.html.erb +0 -5
- data/spec/dummy/app/views/alchemy/elements/_headline_editor.html.erb +0 -1
- data/spec/dummy/app/views/alchemy/elements/_headline_view.html.erb +0 -1
- data/spec/dummy/app/views/alchemy/elements/_news_editor.html.erb +0 -5
- data/spec/dummy/app/views/alchemy/elements/_news_view.html.erb +0 -11
- data/spec/dummy/app/views/alchemy/elements/_search_editor.html.erb +0 -1
- data/spec/dummy/app/views/alchemy/elements/_search_view.html.erb +0 -4
- data/spec/dummy/app/views/alchemy/elements/_slide_editor.html.erb +0 -3
- data/spec/dummy/app/views/alchemy/elements/_slide_view.html.erb +0 -5
- data/spec/dummy/app/views/alchemy/elements/_slider_editor.html.erb +0 -2
- data/spec/dummy/app/views/alchemy/elements/_slider_view.html.erb +0 -4
- data/spec/dummy/app/views/alchemy/elements/_text_editor.html.erb +0 -3
- data/spec/dummy/app/views/alchemy/elements/_text_view.html.erb +0 -5
- data/spec/dummy/app/views/alchemy/page_layouts/_standard.html.erb +0 -15
- data/spec/dummy/app/views/layouts/application.html.erb +0 -17
- data/spec/dummy/bin/bundle +0 -3
- data/spec/dummy/bin/rails +0 -4
- data/spec/dummy/bin/rake +0 -4
- data/spec/dummy/config.ru +0 -4
- data/spec/dummy/config/alchemy/cells.yml +0 -5
- data/spec/dummy/config/alchemy/elements.yml +0 -109
- data/spec/dummy/config/alchemy/page_layouts.yml +0 -32
- data/spec/dummy/config/application.rb +0 -32
- data/spec/dummy/config/boot.rb +0 -5
- data/spec/dummy/config/database.yml +0 -32
- data/spec/dummy/config/environment.rb +0 -5
- data/spec/dummy/config/environments/development.rb +0 -41
- data/spec/dummy/config/environments/production.rb +0 -77
- data/spec/dummy/config/environments/test.rb +0 -43
- data/spec/dummy/config/initializers/alchemy.rb +0 -3
- data/spec/dummy/config/initializers/assets.rb +0 -11
- data/spec/dummy/config/initializers/backtrace_silencers.rb +0 -7
- data/spec/dummy/config/initializers/cookies_serializer.rb +0 -3
- data/spec/dummy/config/initializers/filter_parameter_logging.rb +0 -4
- data/spec/dummy/config/initializers/inflections.rb +0 -16
- data/spec/dummy/config/initializers/mime_types.rb +0 -4
- data/spec/dummy/config/initializers/secret_token.rb +0 -12
- data/spec/dummy/config/initializers/session_store.rb +0 -3
- data/spec/dummy/config/initializers/wrap_parameters.rb +0 -14
- data/spec/dummy/config/locales/kl.yml +0 -2
- data/spec/dummy/config/routes.rb +0 -12
- data/spec/dummy/config/secrets.yml +0 -22
- data/spec/dummy/db/migrate/20121026104128_create_events.rb +0 -20
- data/spec/dummy/db/migrate/20130328101418_create_locations.rb +0 -9
- data/spec/dummy/db/migrate/20130827094554_alchemy_two_point_six.rb +0 -1
- data/spec/dummy/db/migrate/20130828121054_remove_do_not_index_from_alchemy_essence_texts.rb +0 -1
- data/spec/dummy/db/migrate/20130828121120_remove_do_not_index_from_alchemy_essence_richtexts.rb +0 -1
- data/spec/dummy/db/migrate/20130918201742_add_published_at_to_alchemy_pages.rb +0 -1
- data/spec/dummy/db/migrate/20131209225243_create_dummy_users.rb +0 -9
- data/spec/dummy/db/migrate/20150122213511_acts_as_taggable_on_migration.acts_as_taggable_on_engine.rb +0 -31
- data/spec/dummy/db/migrate/20150122213512_add_missing_unique_indices.acts_as_taggable_on_engine.rb +0 -20
- data/spec/dummy/db/migrate/20150122213513_add_taggings_counter_cache_to_tags.acts_as_taggable_on_engine.rb +0 -15
- data/spec/dummy/db/migrate/20150122213514_add_missing_taggable_index.acts_as_taggable_on_engine.rb +0 -10
- data/spec/dummy/db/migrate/20150412103152_create_dummy_model.rb +0 -7
- data/spec/dummy/db/migrate/20150608204610_add_parent_element_id_to_alchemy_elements.rb +0 -1
- data/spec/dummy/db/migrate/20150729151825_add_link_text_to_alchemy_essence_files.rb +0 -1
- data/spec/dummy/db/migrate/20150906195818_add_locale_to_alchemy_languages.rb +0 -1
- data/spec/dummy/db/schema.rb +0 -326
- data/spec/dummy/db/seeds.rb +0 -1
- data/spec/dummy/lib/assets/.gitkeep +0 -0
- data/spec/dummy/public/404.html +0 -67
- data/spec/dummy/public/422.html +0 -67
- data/spec/dummy/public/500.html +0 -66
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/dummy/spec/javascripts +0 -1
- data/spec/factories.rb +0 -13
- data/spec/features/admin/admin_layout_spec.rb +0 -14
- data/spec/features/admin/dashboard_spec.rb +0 -81
- data/spec/features/admin/edit_elements_feature_spec.rb +0 -36
- data/spec/features/admin/language_tree_feature_spec.rb +0 -32
- data/spec/features/admin/languages_features_spec.rb +0 -65
- data/spec/features/admin/legacy_page_url_management_spec.rb +0 -62
- data/spec/features/admin/link_overlay_spec.rb +0 -53
- data/spec/features/admin/locale_select_feature_spec.rb +0 -25
- data/spec/features/admin/modules_integration_spec.rb +0 -23
- data/spec/features/admin/navigation_feature_spec.rb +0 -22
- data/spec/features/admin/page_creation_feature_spec.rb +0 -51
- data/spec/features/admin/page_editing_feature_spec.rb +0 -135
- data/spec/features/admin/picture_library_integration_spec.rb +0 -62
- data/spec/features/admin/resources_integration_spec.rb +0 -128
- data/spec/features/admin/site_select_feature_spec.rb +0 -31
- data/spec/features/admin/tinymce_feature_spec.rb +0 -33
- data/spec/features/navigation_spec.rb +0 -9
- data/spec/features/page_feature_spec.rb +0 -186
- data/spec/features/page_redirects_spec.rb +0 -358
- data/spec/features/picture_security_spec.rb +0 -29
- data/spec/features/security_spec.rb +0 -24
- data/spec/features/translation_integration_spec.rb +0 -51
- data/spec/fixtures/500x500.png +0 -0
- data/spec/fixtures/80x60.png +0 -0
- data/spec/fixtures/animated.gif +0 -0
- data/spec/fixtures/image with spaces.png +0 -0
- data/spec/fixtures/image.png +0 -0
- data/spec/fixtures/image2.PNG +0 -0
- data/spec/fixtures/image3.jpeg +0 -0
- data/spec/helpers/alchemy/admin/attachments_helper_spec.rb +0 -15
- data/spec/helpers/alchemy/admin/base_helper_spec.rb +0 -280
- data/spec/helpers/alchemy/admin/contents_helper_spec.rb +0 -46
- data/spec/helpers/alchemy/admin/elements_helper_spec.rb +0 -314
- data/spec/helpers/alchemy/admin/essences_helper_spec.rb +0 -201
- data/spec/helpers/alchemy/admin/navigation_helper_spec.rb +0 -294
- data/spec/helpers/alchemy/admin/pages_helper_spec.rb +0 -63
- data/spec/helpers/alchemy/admin/pictures_helper_spec.rb +0 -28
- data/spec/helpers/alchemy/admin/tags_helper_spec.rb +0 -111
- data/spec/helpers/alchemy/base_helper_spec.rb +0 -44
- data/spec/helpers/alchemy/elements_block_helper_spec.rb +0 -135
- data/spec/helpers/alchemy/elements_helper_spec.rb +0 -326
- data/spec/helpers/alchemy/essences_helper_spec.rb +0 -85
- data/spec/helpers/alchemy/pages_helper_spec.rb +0 -499
- data/spec/helpers/alchemy/picture_url_helpers_spec.rb +0 -78
- data/spec/helpers/alchemy/url_helper_spec.rb +0 -200
- data/spec/javascripts/alchemy/dialog_spec.coffee +0 -82
- data/spec/javascripts/alchemy/link_overlay_spec.coffee +0 -25
- data/spec/javascripts/alchemy_integration_spec.coffee +0 -3
- data/spec/javascripts/fixtures/select.html +0 -3
- data/spec/javascripts/helpers/mock-ajax.js +0 -199
- data/spec/javascripts/helpers/test_responses/test_responses.js +0 -1
- data/spec/javascripts/support/jasmine.yml +0 -29
- data/spec/libraries/auth_accessors_spec.rb +0 -40
- data/spec/libraries/config_spec.rb +0 -111
- data/spec/libraries/controller_actions_spec.rb +0 -133
- data/spec/libraries/i18n_spec.rb +0 -37
- data/spec/libraries/kaminari/scoped_pagination_url_helper_spec.rb +0 -30
- data/spec/libraries/modules_spec.rb +0 -67
- data/spec/libraries/mount_point_spec.rb +0 -77
- data/spec/libraries/page_layout_spec.rb +0 -150
- data/spec/libraries/paths_spec.rb +0 -15
- data/spec/libraries/permissions_spec.rb +0 -260
- data/spec/libraries/resource_spec.rb +0 -344
- data/spec/libraries/resources_helper_spec.rb +0 -193
- data/spec/libraries/shell_spec.rb +0 -121
- data/spec/libraries/template_tracker_spec.rb +0 -85
- data/spec/libraries/tinymce_spec.rb +0 -111
- data/spec/libraries/userstamp_spec.rb +0 -10
- data/spec/mailers/alchemy/messages_spec.rb +0 -21
- data/spec/models/alchemy/attachment_spec.rb +0 -250
- data/spec/models/alchemy/cell_spec.rb +0 -101
- data/spec/models/alchemy/content_spec.rb +0 -513
- data/spec/models/alchemy/element_spec.rb +0 -862
- data/spec/models/alchemy/element_to_page_spec.rb +0 -13
- data/spec/models/alchemy/essence_boolean_spec.rb +0 -10
- data/spec/models/alchemy/essence_date_spec.rb +0 -28
- data/spec/models/alchemy/essence_file_spec.rb +0 -40
- data/spec/models/alchemy/essence_html_spec.rb +0 -18
- data/spec/models/alchemy/essence_link_spec.rb +0 -10
- data/spec/models/alchemy/essence_picture_spec.rb +0 -255
- data/spec/models/alchemy/essence_richtext_spec.rb +0 -23
- data/spec/models/alchemy/essence_select_spec.rb +0 -10
- data/spec/models/alchemy/essence_text_spec.rb +0 -110
- data/spec/models/alchemy/language_spec.rb +0 -243
- data/spec/models/alchemy/legacy_page_url_spec.rb +0 -21
- data/spec/models/alchemy/message_spec.rb +0 -55
- data/spec/models/alchemy/page_spec.rb +0 -2108
- data/spec/models/alchemy/picture_spec.rb +0 -418
- data/spec/models/alchemy/site_spec.rb +0 -168
- data/spec/models/alchemy/tag_spec.rb +0 -29
- data/spec/models/dummy_model_spec.rb +0 -10
- data/spec/requests/alchemy/admin/resources_requests_spec.rb +0 -26
- data/spec/requests/alchemy/admin/site_requests_spec.rb +0 -19
- data/spec/requests/alchemy/site_requests_spec.rb +0 -18
- data/spec/requests/alchemy/sitemap_spec.rb +0 -56
- data/spec/routing/api_routing_spec.rb +0 -150
- data/spec/routing/routing_spec.rb +0 -340
- data/spec/spec_helper.rb +0 -90
- data/spec/support/ci/install_phantomjs +0 -7
- data/spec/support/hint_examples.rb +0 -28
- data/spec/support/test_tweaks.rb +0 -31
- data/spec/support/transformation_examples.rb +0 -179
- data/spec/tasks/helpers_spec.rb +0 -217
- data/spec/views/admin/pictures/show_spec.rb +0 -43
- data/spec/views/essences/essence_boolean_editor_spec.rb +0 -32
- data/spec/views/essences/essence_boolean_view_spec.rb +0 -23
- data/spec/views/essences/essence_date_view_spec.rb +0 -38
- data/spec/views/essences/essence_file_editor_spec.rb +0 -59
- data/spec/views/essences/essence_file_view_spec.rb +0 -77
- data/spec/views/essences/essence_html_view_spec.rb +0 -22
- data/spec/views/essences/essence_link_view_spec.rb +0 -41
- data/spec/views/essences/essence_picture_editor_spec.rb +0 -80
- data/spec/views/essences/essence_picture_view_spec.rb +0 -128
- data/spec/views/essences/essence_richtext_view_spec.rb +0 -32
- data/spec/views/essences/essence_select_view_spec.rb +0 -11
- 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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5b96881451c7611c03a33ac92666841c2bd6a03e
|
4
|
+
data.tar.gz: 0b5bbdccfe93eb0dd472e22bdd4bef342c5e5dfa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 83f2371b4a3f76bc1fe5fa6aa1f716aebea9105d0891b878fa7620cb5f2e75b228e579670f1a03da00b24dcc4aa666e380738bda5312889d9cc85f730b1649c0
|
7
|
+
data.tar.gz: 58cf314fe01120b0bd00b18dcb891df015baed64fa0cb73611b76d50194b8227fb2d09f9185813568ad10346c3fb02f32a93f72aed54f3e0a515c32ef7600ce8
|
data/CHANGELOG.md
CHANGED
@@ -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
|
19
|
-
* Deprecate `redirect_index` configuration
|
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
data/alchemy_cms.gemspec
CHANGED
@@ -1,21 +1,21 @@
|
|
1
|
-
#
|
2
|
-
|
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 = '
|
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("\
|
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
|
-
$('
|
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
|
-
$('
|
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
|
-
$('
|
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
|
-
|
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
|
-
|
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)
|
@@ -32,12 +32,12 @@
|
|
32
32
|
.element-title {
|
33
33
|
overflow: hidden;
|
34
34
|
white-space: nowrap;
|
35
|
-
max-width:
|
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:
|
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
|
-
|
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
|
-
|
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] (
|
42
|
+
# @param maxlength [Fixnum] (60)
|
43
43
|
# Length of characters after the text will be cut off.
|
44
44
|
#
|
45
|
-
def preview_text(maxlength =
|
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
|
-
|
102
|
+
preview_content.try!(:preview_text, maxlength)
|
96
103
|
end
|
97
104
|
end
|
98
105
|
end
|
data/app/models/alchemy/page.rb
CHANGED
@@ -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?
|
@@ -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"
|
12
|
+
<span class="preview_text_quote">
|
13
|
+
<%= sanitize(element.preview_text.presence || ' ') %>
|
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
|
-
|
2
|
-
|
3
|
-
|
4
|
-
Alchemy.
|
5
|
-
|
6
|
-
|
7
|
-
|
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 || ' ') %>'
|
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
|
-
|
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.
|
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 %>);
|
@@ -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 %>
|