alchemy_cms 2.5.3.1 → 2.6.0.rc5
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +1 -1
- data/.travis.yml +5 -13
- data/Gemfile +6 -3
- data/README.md +3 -2
- data/alchemy_cms.gemspec +22 -22
- data/app/assets/fonts/alchemy-icons.eot +0 -0
- data/app/assets/fonts/alchemy-icons.svg +54 -0
- data/app/assets/fonts/alchemy-icons.ttf +0 -0
- data/app/assets/fonts/alchemy-icons.woff +0 -0
- data/app/assets/images/alchemy/icons.png +0 -0
- data/app/assets/javascripts/alchemy/alchemy.base.js.coffee +151 -0
- data/app/assets/javascripts/alchemy/alchemy.buttons.js.coffee +3 -2
- data/app/assets/javascripts/alchemy/alchemy.datepicker.js.coffee +31 -0
- data/app/assets/javascripts/alchemy/alchemy.dragndrop.js +1 -1
- data/app/assets/javascripts/alchemy/alchemy.element_editors.js.coffee +98 -0
- data/app/assets/javascripts/alchemy/alchemy.elements_window.js.coffee +23 -24
- data/app/assets/javascripts/alchemy/alchemy.growler.js.coffee +27 -0
- data/app/assets/javascripts/alchemy/alchemy.gui.js.coffee +11 -8
- data/app/assets/javascripts/alchemy/alchemy.hotkeys.js.coffee +32 -0
- data/app/assets/javascripts/alchemy/alchemy.image_cropper.js.coffee +46 -0
- data/app/assets/javascripts/alchemy/alchemy.js +8 -2
- data/app/assets/javascripts/alchemy/alchemy.link_overlay.js.coffee +5 -4
- data/app/assets/javascripts/alchemy/alchemy.list_filter.js.coffee +49 -0
- data/app/assets/javascripts/alchemy/alchemy.onload.js.coffee +3 -0
- data/app/assets/javascripts/alchemy/alchemy.preview_window.js.coffee +71 -0
- data/app/assets/javascripts/alchemy/alchemy.sitemap.js.coffee +61 -0
- data/app/assets/javascripts/alchemy/alchemy.spinner.js.coffee +35 -0
- data/app/assets/javascripts/alchemy/alchemy.string_extension.js.coffee +11 -0
- data/app/assets/javascripts/alchemy/alchemy.windows.js.coffee +278 -0
- data/app/assets/stylesheets/alchemy/admin.css.scss +2 -0
- data/app/assets/stylesheets/alchemy/archive.scss +109 -65
- data/app/assets/stylesheets/alchemy/base.scss +16 -188
- data/app/assets/stylesheets/alchemy/dashboard.scss +2 -2
- data/app/assets/stylesheets/alchemy/defaults.scss +2 -1
- data/app/assets/stylesheets/alchemy/elements.scss +58 -94
- data/app/assets/stylesheets/alchemy/errors.scss +2 -2
- data/app/assets/stylesheets/alchemy/{mixins.scss → extends.scss} +104 -80
- data/app/assets/stylesheets/alchemy/flash.scss +4 -6
- data/app/assets/stylesheets/alchemy/fonts.scss +46 -0
- data/app/assets/stylesheets/alchemy/form_elements.scss +46 -45
- data/app/assets/stylesheets/alchemy/frame.scss +20 -15
- data/app/assets/stylesheets/alchemy/icons.scss +22 -9
- data/app/assets/stylesheets/alchemy/jquery-ui.scss +476 -399
- data/app/assets/stylesheets/alchemy/login.scss +1 -1
- data/app/assets/stylesheets/alchemy/menubar.css.scss +1 -1
- data/app/assets/stylesheets/alchemy/notices.scss +5 -5
- data/app/assets/stylesheets/alchemy/pagination.scss +25 -13
- data/app/assets/stylesheets/alchemy/search.scss +29 -17
- data/app/assets/stylesheets/alchemy/sitemap.scss +41 -36
- data/app/assets/stylesheets/alchemy/tables.scss +102 -50
- data/app/assets/stylesheets/alchemy/tinymce_dialog.css.scss +18 -16
- data/app/assets/stylesheets/alchemy/toolbar.scss +84 -24
- data/app/assets/stylesheets/alchemy/upload.scss +14 -9
- data/app/assets/stylesheets/alchemy/variables.scss +1 -0
- data/app/assets/stylesheets/tiny_mce/plugins/inlinepopups/skins/alchemy/window.css.scss +18 -21
- data/app/controllers/alchemy/admin/attachments_controller.rb +29 -39
- data/app/controllers/alchemy/admin/base_controller.rb +3 -9
- data/app/controllers/alchemy/admin/clipboard_controller.rb +1 -1
- data/app/controllers/alchemy/admin/contents_controller.rb +1 -1
- data/app/controllers/alchemy/admin/dashboard_controller.rb +1 -1
- data/app/controllers/alchemy/admin/elements_controller.rb +3 -3
- data/app/controllers/alchemy/admin/essence_files_controller.rb +1 -1
- data/app/controllers/alchemy/admin/essence_pictures_controller.rb +5 -5
- data/app/controllers/alchemy/admin/languages_controller.rb +1 -1
- data/app/controllers/alchemy/admin/pages_controller.rb +18 -16
- data/app/controllers/alchemy/admin/pictures_controller.rb +11 -10
- data/app/controllers/alchemy/admin/resources_controller.rb +87 -14
- data/app/controllers/alchemy/admin/tags_controller.rb +3 -3
- data/app/controllers/alchemy/admin/trash_controller.rb +3 -3
- data/app/controllers/alchemy/admin/users_controller.rb +6 -11
- data/app/controllers/alchemy/attachments_controller.rb +8 -9
- data/app/controllers/alchemy/base_controller.rb +17 -10
- data/app/controllers/alchemy/pages_controller.rb +7 -19
- data/app/controllers/alchemy/passwords_controller.rb +15 -3
- data/app/controllers/alchemy/user_sessions_controller.rb +5 -4
- data/app/controllers/alchemy/users_controller.rb +1 -1
- data/app/helpers/alchemy/admin/attachments_helper.rb +2 -2
- data/app/helpers/alchemy/admin/base_helper.rb +62 -90
- data/app/helpers/alchemy/admin/elements_helper.rb +13 -5
- data/app/helpers/alchemy/admin/essences_helper.rb +3 -5
- data/app/helpers/alchemy/admin/pages_helper.rb +6 -3
- data/app/helpers/alchemy/admin/tags_helper.rb +60 -0
- data/app/helpers/alchemy/base_helper.rb +16 -20
- data/app/helpers/alchemy/elements_helper.rb +7 -11
- data/app/helpers/alchemy/essences_helper.rb +2 -2
- data/app/helpers/alchemy/pages_helper.rb +31 -69
- data/app/helpers/alchemy/url_helper.rb +11 -3
- data/app/models/alchemy/attachment.rb +73 -45
- data/app/models/alchemy/cell.rb +1 -1
- data/app/models/alchemy/content.rb +20 -9
- data/app/models/alchemy/element.rb +9 -7
- data/app/models/alchemy/page.rb +15 -248
- data/app/models/alchemy/page/cells.rb +71 -0
- data/app/models/alchemy/page/elements.rb +147 -0
- data/app/models/alchemy/page/naming.rb +90 -0
- data/app/models/alchemy/picture.rb +18 -13
- data/app/models/alchemy/tag.rb +1 -1
- data/app/models/alchemy/user.rb +38 -6
- data/app/views/alchemy/admin/attachments/_archive_overlay.html.erb +14 -7
- data/app/views/alchemy/admin/attachments/_attachment.html.erb +17 -12
- data/app/views/alchemy/admin/attachments/_file_to_assign.html.erb +3 -8
- data/app/views/alchemy/admin/attachments/_files_list.html.erb +20 -12
- data/app/views/alchemy/admin/attachments/_overlay_file_list.html.erb +11 -0
- data/app/views/alchemy/admin/attachments/_tag_list.html.erb +31 -0
- data/app/views/alchemy/admin/attachments/archive_overlay.js.erb +4 -0
- data/app/views/alchemy/admin/attachments/edit.html.erb +8 -7
- data/app/views/alchemy/admin/attachments/index.html.erb +19 -12
- data/app/views/alchemy/admin/attachments/new.html.erb +2 -2
- data/app/views/alchemy/admin/attachments/show.html.erb +3 -0
- data/app/views/alchemy/admin/contents/_missing.html.erb +4 -4
- data/app/views/alchemy/admin/contents/create.js.erb +1 -1
- data/app/views/alchemy/admin/contents/new.html.erb +6 -3
- data/app/views/alchemy/admin/dashboard/_locked_pages.html.erb +1 -1
- data/app/views/alchemy/admin/dashboard/_users.html.erb +1 -1
- data/app/views/alchemy/admin/dashboard/index.html.erb +3 -3
- data/app/views/alchemy/admin/dashboard/info.html.erb +16 -13
- data/app/views/alchemy/admin/elements/_add_picture.html.erb +1 -1
- data/app/views/alchemy/admin/elements/_element_foot.html.erb +4 -4
- data/app/views/alchemy/admin/elements/_element_head.html.erb +1 -7
- data/app/views/alchemy/admin/elements/_elements_select.html.erb +2 -2
- data/app/views/alchemy/admin/elements/_new_element_form.html.erb +4 -4
- data/app/views/alchemy/admin/elements/_picture_gallery_editor.html.erb +1 -1
- data/app/views/alchemy/admin/elements/create.js.erb +2 -2
- data/app/views/alchemy/admin/elements/fold.js.erb +3 -6
- data/app/views/alchemy/admin/elements/new.html.erb +1 -1
- data/app/views/alchemy/admin/elements/order.js.erb +1 -1
- data/app/views/alchemy/admin/elements/trash.js.erb +1 -1
- data/app/views/alchemy/admin/elements/update.js.erb +2 -2
- data/app/views/alchemy/admin/essence_files/edit.html.erb +4 -4
- data/app/views/alchemy/admin/essence_pictures/crop.html.erb +17 -18
- data/app/views/alchemy/admin/essence_pictures/edit.html.erb +2 -2
- data/app/views/alchemy/admin/essence_pictures/update.js.erb +1 -0
- data/app/views/alchemy/admin/languages/_form.html.erb +12 -10
- data/app/views/alchemy/admin/languages/_language.html.erb +2 -1
- data/app/views/alchemy/admin/languages/_table.html.erb +3 -3
- data/app/views/alchemy/admin/languages/index.html.erb +15 -15
- data/app/views/alchemy/admin/layoutpages/_layoutpage.html.erb +6 -6
- data/app/views/alchemy/admin/layoutpages/index.html.erb +41 -40
- data/app/views/alchemy/admin/pages/_contactform_links.html.erb +4 -4
- data/app/views/alchemy/admin/pages/_create_language_form.html.erb +6 -6
- data/app/views/alchemy/admin/pages/_external_link.html.erb +2 -2
- data/app/views/alchemy/admin/pages/_file_link.html.erb +3 -3
- data/app/views/alchemy/admin/pages/_internal_link.html.erb +1 -1
- data/app/views/alchemy/admin/pages/_new_page_form.html.erb +1 -1
- data/app/views/alchemy/admin/pages/_page.html.erb +13 -13
- data/app/views/alchemy/admin/pages/_page_for_links.html.erb +2 -4
- data/app/views/alchemy/admin/pages/_sitemap.html.erb +5 -0
- data/app/views/alchemy/admin/pages/configure.html.erb +7 -7
- data/app/views/alchemy/admin/pages/configure_external.html.erb +4 -4
- data/app/views/alchemy/admin/pages/edit.html.erb +23 -30
- data/app/views/alchemy/admin/pages/index.html.erb +34 -23
- data/app/views/alchemy/admin/pages/new.html.erb +1 -1
- data/app/views/alchemy/admin/pages/sort.js.erb +1 -1
- data/app/views/alchemy/admin/partials/_flash_upload.html.erb +2 -3
- data/app/views/alchemy/admin/partials/_remote_search_form.html.erb +2 -2
- data/app/views/alchemy/admin/partials/_search_form.html.erb +3 -3
- data/app/views/alchemy/admin/partials/_upload_form.html.erb +2 -2
- data/app/views/alchemy/admin/pictures/_archive.html.erb +7 -7
- data/app/views/alchemy/admin/pictures/_archive_overlay.html.erb +1 -1
- data/app/views/alchemy/admin/pictures/_filter_and_size_bar.html.erb +6 -6
- data/app/views/alchemy/admin/pictures/_filter_bar.html.erb +4 -4
- data/app/views/alchemy/admin/pictures/_overlay_picture_list.html.erb +1 -1
- data/app/views/alchemy/admin/pictures/_picture.html.erb +3 -8
- data/app/views/alchemy/admin/pictures/_picture_to_assign.html.erb +9 -14
- data/app/views/alchemy/admin/pictures/_tag_list.html.erb +27 -25
- data/app/views/alchemy/admin/pictures/archive_overlay.js.erb +3 -1
- data/app/views/alchemy/admin/pictures/index.html.erb +49 -42
- data/app/views/alchemy/admin/pictures/new.html.erb +2 -2
- data/app/views/alchemy/admin/pictures/show.html.erb +11 -0
- data/app/views/alchemy/admin/resources/_boolean.html.erb +2 -2
- data/app/views/alchemy/admin/resources/_datetime.html.erb +2 -2
- data/app/views/alchemy/admin/resources/_form.html.erb +9 -8
- data/app/views/alchemy/admin/resources/_resource.html.erb +15 -21
- data/app/views/alchemy/admin/resources/_string.html.erb +2 -2
- data/app/views/alchemy/admin/resources/_table.html.erb +11 -13
- data/app/views/alchemy/admin/resources/_text.html.erb +2 -2
- data/app/views/alchemy/admin/resources/index.csv.erb +13 -0
- data/app/views/alchemy/admin/resources/index.html.erb +24 -15
- data/app/views/alchemy/admin/sites/index.html.erb +23 -0
- data/app/views/alchemy/admin/tags/_radio_tag.html.erb +1 -1
- data/app/views/alchemy/admin/tags/_tag.html.erb +2 -1
- data/app/views/alchemy/admin/tags/edit.html.erb +1 -1
- data/app/views/alchemy/admin/tags/index.html.erb +16 -11
- data/app/views/alchemy/admin/tags/new.html.erb +3 -3
- data/app/views/alchemy/admin/trash/clear.js.coffee +1 -1
- data/app/views/alchemy/admin/users/_table.html.erb +12 -5
- data/app/views/alchemy/admin/users/_user.html.erb +16 -16
- data/app/views/alchemy/admin/users/index.html.erb +28 -16
- data/app/views/alchemy/breadcrumb/_page.html.erb +15 -0
- data/app/views/alchemy/breadcrumb/_spacer.html.erb +1 -0
- data/app/views/alchemy/elements/_editor_not_found.html.erb +1 -1
- data/app/views/alchemy/essences/_essence_file_editor.html.erb +16 -16
- data/app/views/alchemy/essences/_essence_file_view.html.erb +8 -9
- data/app/views/alchemy/essences/_essence_picture_editor.html.erb +3 -6
- data/app/views/alchemy/essences/_essence_picture_tools.html.erb +9 -8
- data/app/views/alchemy/essences/_essence_richtext_editor.html.erb +0 -5
- data/app/views/alchemy/essences/_linkable_essence_tools.html.erb +2 -2
- data/app/views/alchemy/navigation/_link.html.erb +7 -7
- data/app/views/alchemy/navigation/_renderer.html.erb +29 -36
- data/app/views/alchemy/notifications/admin_user_created.de.text.erb +5 -1
- data/app/views/alchemy/notifications/admin_user_created.en.text.erb +5 -1
- data/app/views/alchemy/notifications/registered_user_created.de.text.erb +13 -0
- data/app/views/alchemy/notifications/registered_user_created.en.text.erb +13 -0
- data/app/views/alchemy/search/_result.html.erb +4 -6
- data/app/views/alchemy/search/_results.html.erb +4 -5
- data/app/views/alchemy/user_sessions/leave.html.erb +1 -1
- data/app/views/alchemy/user_sessions/new.html.erb +2 -2
- data/app/views/kaminari/_first_page.html.erb +11 -0
- data/app/views/kaminari/_gap.html.erb +1 -1
- data/app/views/kaminari/_last_page.html.erb +11 -0
- data/app/views/kaminari/_next_page.html.erb +2 -2
- data/app/views/kaminari/_page.html.erb +1 -1
- data/app/views/kaminari/_paginator.html.erb +2 -0
- data/app/views/kaminari/_prev_page.html.erb +2 -2
- data/app/views/layouts/alchemy/admin.html.erb +4 -5
- data/config/alchemy/config.yml +8 -12
- data/config/authorization_rules.rb +4 -3
- data/config/initializers/dragonfly.rb +20 -12
- data/config/locales/alchemy.de.yml +20 -15
- data/config/locales/alchemy.en.yml +15 -10
- data/config/locales/devise.de.yml +1 -0
- data/config/routes.rb +3 -3
- data/{spec/dummy/db/migrate/20121118000000_alchemy_two_point_four.rb → db/migrate/20130214233001_alchemy_two_point_five.rb} +50 -36
- data/db/migrate/20130221200514_migrate_attachments_to_dragonfly.rb +21 -0
- data/db/migrate/20130312205327_change_alchemy_users_role_to_roles.rb +11 -0
- data/lib/alchemy/capistrano.rb +10 -8
- data/lib/alchemy/errors.rb +7 -0
- data/lib/alchemy/filetypes.rb +33 -0
- data/lib/alchemy/i18n.rb +9 -1
- data/lib/alchemy/name_conversions.rb +28 -0
- data/lib/alchemy/page_layout.rb +5 -3
- data/lib/alchemy/resource.rb +132 -29
- data/lib/alchemy/resources_helper.rb +81 -12
- data/lib/alchemy/upgrader.rb +14 -276
- data/lib/alchemy/version.rb +1 -1
- data/lib/alchemy_cms.rb +17 -2
- data/lib/rails/generators/alchemy/deploy_script/templates/deploy.rb.tt +1 -1
- data/lib/rails/generators/alchemy/scaffold/scaffold_generator.rb +1 -1
- data/lib/tasks/alchemy/convert.rake +39 -0
- data/lib/tasks/alchemy/install.rake +4 -6
- data/lib/tasks/alchemy/upgrade.rake +18 -1
- data/spec/controllers/admin/clipboard_controller_spec.rb +4 -4
- data/spec/controllers/admin/elements_controller_spec.rb +23 -23
- data/spec/controllers/admin/pages_controller_spec.rb +15 -0
- data/spec/controllers/admin/resources_controller_spec.rb +1 -11
- data/spec/controllers/admin/trash_controller_spec.rb +9 -9
- data/spec/controllers/attachments_controller_spec.rb +3 -3
- data/spec/controllers/elements_controller_spec.rb +2 -2
- data/spec/controllers/pages_controller_spec.rb +160 -129
- data/spec/controllers/pictures_controller_spec.rb +2 -2
- data/spec/controllers/user_sessions_controller_spec.rb +3 -3
- data/spec/controllers/users_controller_spec.rb +2 -2
- data/spec/dummy/app/models/event.rb +2 -2
- data/spec/dummy/app/models/location.rb +4 -0
- data/spec/dummy/app/views/layouts/application.html.erb +6 -42
- data/spec/dummy/config/routes.rb +1 -1
- data/spec/dummy/db/migrate/20121026104128_create_events.rb +0 -1
- data/{db/migrate/20121118000000_alchemy_two_point_four.rb → spec/dummy/db/migrate/20130214233001_alchemy_two_point_five.rb} +50 -36
- data/spec/dummy/db/migrate/20130221200514_migrate_attachments_to_dragonfly.rb +21 -0
- data/spec/dummy/db/migrate/20130312205327_change_alchemy_users_role_to_roles.rb +11 -0
- data/spec/dummy/db/migrate/20130328101418_create_locations.rb +9 -0
- data/spec/dummy/db/schema.rb +15 -6
- data/spec/factories.rb +4 -4
- data/spec/{integration → features}/admin/link_overlay_spec.rb +0 -0
- data/spec/{integration → features}/admin/modules_integration_spec.rb +1 -1
- data/spec/{integration → features}/admin/pages_controller_spec.rb +9 -4
- data/spec/{integration → features}/admin/picture_library_integration_spec.rb +5 -5
- data/spec/{integration → features}/admin/resources_integration_spec.rb +1 -1
- data/spec/{integration → features}/navigation_spec.rb +0 -0
- data/spec/{integration → features}/pages_controller_spec.rb +42 -112
- data/spec/{integration → features}/picture_security_spec.rb +2 -2
- data/spec/{integration → features}/security_spec.rb +7 -7
- data/spec/{integration → features}/translation_integration_spec.rb +0 -0
- data/spec/helpers/admin/base_helper_spec.rb +0 -50
- data/spec/helpers/admin/tags_helper_spec.rb +53 -0
- data/spec/helpers/base_helper_spec.rb +19 -3
- data/spec/helpers/pages_helper_spec.rb +92 -44
- data/spec/{url_helpers_spec.rb → helpers/picture_url_helpers_spec.rb} +7 -7
- data/spec/helpers/url_helper_spec.rb +92 -72
- data/spec/{config_spec.rb → libraries/config_spec.rb} +0 -0
- data/spec/libraries/resource_spec.rb +215 -76
- data/spec/libraries/resources_helper_spec.rb +70 -28
- data/spec/models/attachment_spec.rb +75 -9
- data/spec/models/clipboard_spec.rb +1 -1
- data/spec/models/element_spec.rb +7 -0
- data/spec/models/page_spec.rb +144 -25
- data/spec/models/picture_spec.rb +5 -5
- data/spec/models/resource_spec.rb +47 -10
- data/spec/models/user_spec.rb +115 -3
- data/spec/{routing_spec.rb → routing/routing_spec.rb} +8 -20
- data/spec/spec_helper.rb +5 -6
- data/spec/support/alchemy/specs_helpers.rb +1 -1
- data/spec/support/ci/install_phantomjs +1 -1
- data/spec/support/image with spaces.png +0 -0
- data/vendor/assets/javascripts/jquery_plugins/jquery.Jcrop.min.js +18 -18
- data/vendor/assets/javascripts/jquery_plugins/{jquery.dialogextend.1_0_1.js → jquery.dialogextend.js} +25 -17
- data/vendor/assets/javascripts/jquery_plugins/jquery.scrollTo.min.js +7 -0
- data/vendor/assets/javascripts/jquery_plugins/jquery.ui.tabspaging.js +7 -7
- data/vendor/assets/javascripts/keymage.min.js +6 -0
- data/vendor/assets/javascripts/spin.min.js +1 -0
- metadata +122 -124
- data/app/assets/images/alchemy/ajax_loader.gif +0 -0
- data/app/assets/images/alchemy/gui/toggle.png +0 -0
- data/app/assets/images/alchemy/image_loader.gif +0 -0
- data/app/assets/images/alchemy/shading.png +0 -0
- data/app/assets/images/alchemy/tabs.gif +0 -0
- data/app/assets/javascripts/alchemy/alchemy.base.js +0 -172
- data/app/assets/javascripts/alchemy/alchemy.datepicker.js +0 -47
- data/app/assets/javascripts/alchemy/alchemy.element_editor_selector.js +0 -91
- data/app/assets/javascripts/alchemy/alchemy.growler.js +0 -46
- data/app/assets/javascripts/alchemy/alchemy.image_cropper.js +0 -60
- data/app/assets/javascripts/alchemy/alchemy.js_extensions.js +0 -15
- data/app/assets/javascripts/alchemy/alchemy.preview_window.js +0 -97
- data/app/assets/javascripts/alchemy/alchemy.windows.js +0 -321
- data/app/models/alchemy/clipboard_spec.rb +0 -0
- data/app/views/alchemy/admin/pictures/show_in_window.html.erb +0 -8
- data/app/views/alchemy/notifications/registered_user_created.text.erb +0 -11
- data/db/migrate/20121121162313_switch_from_fleximage_to_dragonfly.rb +0 -21
- data/db/migrate/20121205155004_create_alchemy_sites.rb +0 -14
- data/db/migrate/20121211163003_add_public_to_alchemy_sites.rb +0 -6
- data/db/migrate/20121220102223_add_aliases_to_site.rb +0 -6
- data/db/migrate/20130110212411_create_alchemy_legacy_page_urls.rb +0 -11
- data/db/migrate/20130121092645_migrate_to_devise.rb +0 -24
- data/spec/alchemy_spec.rb +0 -7
- data/spec/dummy/db/migrate/20121121162313_switch_from_fleximage_to_dragonfly.rb +0 -21
- data/spec/dummy/db/migrate/20121205155004_create_alchemy_sites.rb +0 -14
- data/spec/dummy/db/migrate/20121211163003_add_public_to_alchemy_sites.rb +0 -6
- data/spec/dummy/db/migrate/20121220102223_add_aliases_to_site.rb +0 -6
- data/spec/dummy/db/migrate/20130110212411_create_alchemy_legacy_page_urls.rb +0 -11
- data/spec/dummy/db/migrate/20130121092645_migrate_to_devise.rb +0 -24
- data/vendor/assets/javascripts/jquery_plugins/jquery.scrollTo-1.4.2-min.js +0 -11
@@ -22,12 +22,6 @@ module Alchemy
|
|
22
22
|
show_error_notice(e)
|
23
23
|
end
|
24
24
|
|
25
|
-
# Logs the current exception to the error log.
|
26
|
-
def exception_logger(e)
|
27
|
-
Rails.logger.error("\n#{e.class} #{e.message} in #{e.backtrace.first}")
|
28
|
-
Rails.logger.error(e.backtrace[1..50].each { |l| l.gsub(/#{Rails.root.to_s}/, '') }.join("\n"))
|
29
|
-
end
|
30
|
-
|
31
25
|
# Displays an error notice in the Alchemy backend.
|
32
26
|
def show_error_notice(e)
|
33
27
|
# truncate the message, because very long error messages (i.e from mysql2) causes cookie oveflow errors
|
@@ -42,10 +36,10 @@ module Alchemy
|
|
42
36
|
end
|
43
37
|
|
44
38
|
def redirect_back_or_to_default(default_path = admin_dashboard_path)
|
45
|
-
if request.
|
46
|
-
redirect_to default_path
|
47
|
-
else
|
39
|
+
if request.referer.present?
|
48
40
|
redirect_to :back
|
41
|
+
else
|
42
|
+
redirect_to default_path
|
49
43
|
end
|
50
44
|
end
|
51
45
|
|
@@ -7,7 +7,7 @@ module Alchemy
|
|
7
7
|
@clipboard = get_clipboard
|
8
8
|
@clipboard_items = model_class.all_from_clipboard(@clipboard.all(params[:remarkable_type]))
|
9
9
|
respond_to do |format|
|
10
|
-
format.html { render :
|
10
|
+
format.html { render layout: !request.xhr? }
|
11
11
|
end
|
12
12
|
end
|
13
13
|
|
@@ -12,7 +12,7 @@ module Alchemy
|
|
12
12
|
else
|
13
13
|
@elements = @page.elements_grouped_by_cells
|
14
14
|
end
|
15
|
-
render :
|
15
|
+
render layout: !request.xhr?
|
16
16
|
end
|
17
17
|
|
18
18
|
def list
|
@@ -31,7 +31,7 @@ module Alchemy
|
|
31
31
|
unless clipboard_elements.blank?
|
32
32
|
@clipboard_items = Element.all_from_clipboard_for_page(clipboard_elements, @page)
|
33
33
|
end
|
34
|
-
render :
|
34
|
+
render layout: !request.xhr?
|
35
35
|
end
|
36
36
|
|
37
37
|
# Creates a element as discribed in config/alchemy/elements.yml on page via AJAX.
|
@@ -65,7 +65,7 @@ module Alchemy
|
|
65
65
|
# And then updates the element itself.
|
66
66
|
def update
|
67
67
|
@element = Element.find_by_id(params[:id])
|
68
|
-
if @element.save_contents(params)
|
68
|
+
if @element.save_contents(params[:contents])
|
69
69
|
@page = @element.page
|
70
70
|
@element_validated = @element.update_attributes!(params[:element])
|
71
71
|
else
|
@@ -10,7 +10,7 @@ module Alchemy
|
|
10
10
|
@essence_picture = EssencePicture.find(params[:id])
|
11
11
|
@content = Content.find(params[:content_id])
|
12
12
|
@options = params[:options] || {}
|
13
|
-
render :
|
13
|
+
render layout: !request.xhr?
|
14
14
|
end
|
15
15
|
|
16
16
|
def crop
|
@@ -44,7 +44,7 @@ module Alchemy
|
|
44
44
|
else
|
45
45
|
@no_image_notice = _t('No image found. Did you saved the element?')
|
46
46
|
end
|
47
|
-
render :
|
47
|
+
render layout: !request.xhr?
|
48
48
|
end
|
49
49
|
|
50
50
|
def update
|
@@ -55,8 +55,8 @@ module Alchemy
|
|
55
55
|
end
|
56
56
|
|
57
57
|
def assign
|
58
|
-
@content = Content.
|
59
|
-
@picture = Picture.
|
58
|
+
@content = Content.find_by_id(params[:id])
|
59
|
+
@picture = Picture.find_by_id(params[:picture_id])
|
60
60
|
@content.essence.picture = @picture
|
61
61
|
@options = params[:options] || {}
|
62
62
|
@element = @content.element
|
@@ -76,7 +76,7 @@ module Alchemy
|
|
76
76
|
@picture_essence.link = params[:link]
|
77
77
|
@picture_essence.link_title = params[:title]
|
78
78
|
@picture_essence.open_link_in_new_window = params[:blank]
|
79
|
-
@notice = _t(
|
79
|
+
@notice = _t(:saved_link)
|
80
80
|
@picture_essence.save
|
81
81
|
end
|
82
82
|
|
@@ -45,14 +45,15 @@ module Alchemy
|
|
45
45
|
@page = Page.new(:layoutpage => params[:layoutpage] == 'true', :parent_id => params[:parent_id])
|
46
46
|
@page_layouts = PageLayout.layouts_for_select(session[:language_id], @page.layoutpage?)
|
47
47
|
@clipboard_items = Page.all_from_clipboard_for_select(get_clipboard[:pages], session[:language_id], @page.layoutpage?)
|
48
|
-
render :
|
48
|
+
render layout: !request.xhr?
|
49
49
|
end
|
50
50
|
|
51
51
|
def create
|
52
52
|
parent = Page.find_by_id(params[:page][:parent_id]) || Page.root
|
53
53
|
params[:page][:language_id] ||= parent.language ? parent.language.id : Language.get_default.id
|
54
54
|
params[:page][:language_code] ||= parent.language ? parent.language.code : Language.get_default.code
|
55
|
-
|
55
|
+
# Copy the page
|
56
|
+
if params[:paste_from_clipboard].present?
|
56
57
|
source_page = Page.find(params[:paste_from_clipboard])
|
57
58
|
@page = Page.copy(source_page, {
|
58
59
|
:parent_id => params[:page][:parent_id],
|
@@ -64,14 +65,15 @@ module Alchemy
|
|
64
65
|
source_page.copy_children_to(@page)
|
65
66
|
end
|
66
67
|
else
|
67
|
-
|
68
|
+
# Create new page
|
69
|
+
@page = Page.new(params[:page])
|
70
|
+
end
|
71
|
+
if @page.save
|
72
|
+
redirect_path = params[:redirect_to] || edit_admin_page_path(@page)
|
73
|
+
else
|
74
|
+
# TODO: Make a rollback, because the page is already persisted here.
|
75
|
+
redirect_path = admin_pages_path
|
68
76
|
end
|
69
|
-
redirect_path =
|
70
|
-
if @page.valid?
|
71
|
-
params[:redirect_to] || edit_admin_page_path(@page)
|
72
|
-
else
|
73
|
-
admin_pages_path
|
74
|
-
end
|
75
77
|
render_errors_or_redirect(@page, redirect_path, _t("Page created", :name => @page.name))
|
76
78
|
end
|
77
79
|
|
@@ -79,7 +81,7 @@ module Alchemy
|
|
79
81
|
def edit
|
80
82
|
# fetching page via before filter
|
81
83
|
if @page.locked? && @page.locker && @page.locker.logged_in? && @page.locker != current_user
|
82
|
-
flash[:notice] = _t("This page is locked by %{name}", :name => (@page.locker.name rescue _t(
|
84
|
+
flash[:notice] = _t("This page is locked by %{name}", :name => (@page.locker.name rescue _t(:unknown)))
|
83
85
|
redirect_to admin_pages_path
|
84
86
|
else
|
85
87
|
@page.lock(current_user)
|
@@ -92,10 +94,10 @@ module Alchemy
|
|
92
94
|
def configure
|
93
95
|
# fetching page via before filter
|
94
96
|
if @page.redirects_to_external?
|
95
|
-
render :
|
97
|
+
render action: 'configure_external', layout: !request.xhr?
|
96
98
|
else
|
97
99
|
@page_layouts = PageLayout.layouts_with_own_for_select(@page.page_layout, session[:language_id], @page.layoutpage?)
|
98
|
-
render :
|
100
|
+
render layout: !request.xhr?
|
99
101
|
end
|
100
102
|
end
|
101
103
|
|
@@ -144,7 +146,7 @@ module Alchemy
|
|
144
146
|
if multi_language?
|
145
147
|
@url_prefix = "#{session[:language_code]}/"
|
146
148
|
end
|
147
|
-
render :
|
149
|
+
render layout: !request.xhr?
|
148
150
|
end
|
149
151
|
|
150
152
|
def fold
|
@@ -160,7 +162,7 @@ module Alchemy
|
|
160
162
|
def unlock
|
161
163
|
# fetching page via before filter
|
162
164
|
@page.unlock
|
163
|
-
flash[:notice] = _t(
|
165
|
+
flash[:notice] = _t(:unlocked_page, :name => @page.name)
|
164
166
|
@pages_locked_by_user = Page.from_current_site.all_locked_by(current_user)
|
165
167
|
respond_to do |format|
|
166
168
|
format.js
|
@@ -179,7 +181,7 @@ module Alchemy
|
|
179
181
|
def publish
|
180
182
|
# fetching page via before filter
|
181
183
|
@page.publish!
|
182
|
-
flash[:notice] = _t(
|
184
|
+
flash[:notice] = _t(:page_published, :name => @page.name)
|
183
185
|
redirect_back_or_to_default(admin_pages_path)
|
184
186
|
end
|
185
187
|
|
@@ -197,7 +199,7 @@ module Alchemy
|
|
197
199
|
)
|
198
200
|
new_language_root.move_to_child_of Page.root
|
199
201
|
original_language_root.copy_children_to(new_language_root)
|
200
|
-
flash[:notice] = _t(
|
202
|
+
flash[:notice] = _t(:language_pages_copied)
|
201
203
|
redirect_to params[:layoutpage] == "true" ? admin_layoutpages_path : :action => :index
|
202
204
|
end
|
203
205
|
|
@@ -2,6 +2,7 @@ module Alchemy
|
|
2
2
|
module Admin
|
3
3
|
class PicturesController < Alchemy::Admin::BaseController
|
4
4
|
protect_from_forgery :except => [:create]
|
5
|
+
helper 'alchemy/admin/tags'
|
5
6
|
|
6
7
|
cache_sweeper Alchemy::PicturesSweeper, :only => [:update, :destroy]
|
7
8
|
|
@@ -37,7 +38,7 @@ module Alchemy
|
|
37
38
|
@page = params[:page]
|
38
39
|
@per_page = params[:per_page]
|
39
40
|
end
|
40
|
-
render :
|
41
|
+
render layout: !request.xhr?
|
41
42
|
end
|
42
43
|
|
43
44
|
def create
|
@@ -68,6 +69,11 @@ module Alchemy
|
|
68
69
|
end
|
69
70
|
end
|
70
71
|
|
72
|
+
def show
|
73
|
+
@picture = Picture.find(params[:id])
|
74
|
+
render layout: !request.xhr?
|
75
|
+
end
|
76
|
+
|
71
77
|
def edit
|
72
78
|
@picture = Picture.find(params[:id])
|
73
79
|
render :layout => !request.xhr?
|
@@ -82,9 +88,9 @@ module Alchemy
|
|
82
88
|
@picture = Picture.find(params[:id])
|
83
89
|
|
84
90
|
if @picture.update_attributes(params[:picture])
|
85
|
-
flash[:notice] = _t(
|
91
|
+
flash[:notice] = _t(:picture_updated_successfully, :name => @picture.name)
|
86
92
|
else
|
87
|
-
flash[:error] = _t(
|
93
|
+
flash[:error] = _t(:picture_update_failed)
|
88
94
|
end
|
89
95
|
redirect_to_index
|
90
96
|
end
|
@@ -146,14 +152,9 @@ module Alchemy
|
|
146
152
|
@notice = _t('Picture cache flushed')
|
147
153
|
end
|
148
154
|
|
149
|
-
def show_in_window
|
150
|
-
@picture = Picture.find(params[:id])
|
151
|
-
render :layout => false
|
152
|
-
end
|
153
|
-
|
154
155
|
def info
|
155
156
|
@picture = Picture.find(params[:id])
|
156
|
-
render :
|
157
|
+
render layout: !request.xhr?
|
157
158
|
end
|
158
159
|
|
159
160
|
private
|
@@ -171,7 +172,7 @@ module Alchemy
|
|
171
172
|
end
|
172
173
|
|
173
174
|
def in_overlay?
|
174
|
-
|
175
|
+
params[:element_id].present?
|
175
176
|
end
|
176
177
|
|
177
178
|
def archive_overlay
|
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'csv'
|
2
|
+
|
1
3
|
module Alchemy
|
2
4
|
module Admin
|
3
5
|
class ResourcesController < Alchemy::Admin::BaseController
|
@@ -8,25 +10,40 @@ module Alchemy
|
|
8
10
|
|
9
11
|
before_filter :load_resource, :only => [:show, :edit, :update, :destroy]
|
10
12
|
|
13
|
+
handles_sortable_columns do |c|
|
14
|
+
c.default_sort_value = :name
|
15
|
+
c.link_class = 'sortable'
|
16
|
+
c.indicator_class = {:asc => "sorted asc", :desc => "sorted desc"}
|
17
|
+
c.indicator_text = {:asc => "<i> ↓ </i>", :desc => "<i> ↑ </i>"}
|
18
|
+
end
|
19
|
+
|
11
20
|
def index
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
21
|
+
items = resource_handler.model
|
22
|
+
if contains_relations?
|
23
|
+
items = items.includes(*resource_relations_names)
|
24
|
+
end
|
25
|
+
if params[:query].present?
|
26
|
+
items = query_items(items)
|
27
|
+
end
|
28
|
+
items = items.order(sort_order)
|
29
|
+
respond_to do |format|
|
30
|
+
format.html {
|
31
|
+
items = items.page(params[:page] || 1).per(per_page_value_for_screen_size)
|
32
|
+
instance_variable_set("@#{resource_handler.resources_name}", items)
|
33
|
+
}
|
34
|
+
format.csv {
|
35
|
+
instance_variable_set("@#{resource_handler.resources_name}", items)
|
36
|
+
}
|
19
37
|
end
|
20
|
-
instance_variable_set("@#{resource_handler.resources_name}", items.page(params[:page] || 1).per(per_page_value_for_screen_size))
|
21
38
|
end
|
22
39
|
|
23
40
|
def new
|
24
|
-
instance_variable_set("@#{resource_handler.
|
41
|
+
instance_variable_set("@#{resource_handler.resource_name}", resource_handler.model.new)
|
25
42
|
render :layout => !request.xhr?
|
26
43
|
end
|
27
44
|
|
28
45
|
def show
|
29
|
-
render :layout
|
46
|
+
render action: 'edit', layout: !request.xhr?
|
30
47
|
end
|
31
48
|
|
32
49
|
def edit
|
@@ -34,7 +51,7 @@ module Alchemy
|
|
34
51
|
end
|
35
52
|
|
36
53
|
def create
|
37
|
-
instance_variable_set("@#{resource_handler.
|
54
|
+
instance_variable_set("@#{resource_handler.resource_name}", resource_handler.model.new(params[resource_handler.namespaced_resource_name.to_sym]))
|
38
55
|
resource_instance_variable.save
|
39
56
|
render_errors_or_redirect(
|
40
57
|
resource_instance_variable,
|
@@ -44,7 +61,7 @@ module Alchemy
|
|
44
61
|
end
|
45
62
|
|
46
63
|
def update
|
47
|
-
resource_instance_variable.update_attributes(params[resource_handler.
|
64
|
+
resource_instance_variable.update_attributes(params[resource_handler.namespaced_resource_name.to_sym])
|
48
65
|
render_errors_or_redirect(
|
49
66
|
resource_instance_variable,
|
50
67
|
resources_path,
|
@@ -75,7 +92,7 @@ module Alchemy
|
|
75
92
|
when :destroy
|
76
93
|
verb = "removed"
|
77
94
|
end
|
78
|
-
flash[:notice] = _t("#{resource_handler.
|
95
|
+
flash[:notice] = _t("#{resource_handler.resource_name.classify} successfully #{verb}", :default => _t("Succesfully #{verb}"))
|
79
96
|
end
|
80
97
|
|
81
98
|
def is_alchemy_module?
|
@@ -87,8 +104,64 @@ module Alchemy
|
|
87
104
|
end
|
88
105
|
|
89
106
|
def load_resource
|
90
|
-
instance_variable_set("@#{resource_handler.
|
107
|
+
instance_variable_set("@#{resource_handler.resource_name}", resource_handler.model.find(params[:id]))
|
108
|
+
end
|
109
|
+
|
110
|
+
# Returns a sort order for AR#sort method
|
111
|
+
#
|
112
|
+
# Falls back to fallback_sort_order, if the requested column is not a column of model.
|
113
|
+
#
|
114
|
+
# If the column is a tablename and column combination that matches any resource relations, than this order will be taken.
|
115
|
+
#
|
116
|
+
def sort_order
|
117
|
+
sortable_column_order do |column, direction|
|
118
|
+
if resource_handler.model_associations.present? && column.match(/\./)
|
119
|
+
table, column = column.split('.')
|
120
|
+
if resource_handler.model_associations.detect { |a| a.table_name == table }
|
121
|
+
"#{table}.#{column} #{direction}"
|
122
|
+
else
|
123
|
+
fallback_sort_order(direction)
|
124
|
+
end
|
125
|
+
elsif resource_handler.model.column_names.include?(column.to_s)
|
126
|
+
"#{resource_handler.model.table_name}.#{column} #{direction}"
|
127
|
+
else
|
128
|
+
fallback_sort_order(direction)
|
129
|
+
end
|
130
|
+
end
|
131
|
+
end
|
132
|
+
|
133
|
+
# Default sort order fallback
|
134
|
+
#
|
135
|
+
# Overwrite this in your controller to define custom fallback
|
136
|
+
#
|
137
|
+
def fallback_sort_order(direction)
|
138
|
+
"#{resource_handler.model.table_name}.id #{direction}"
|
139
|
+
end
|
140
|
+
|
141
|
+
# Returns an activerecord object that contains items matching params[:query]
|
142
|
+
#
|
143
|
+
def query_items(items)
|
144
|
+
query = params[:query].downcase.split(' ').join('%')
|
145
|
+
query = ActiveRecord::Base.sanitize("%#{query}%")
|
146
|
+
items.where(search_query(query))
|
147
|
+
end
|
148
|
+
|
149
|
+
# Returns a search query string
|
150
|
+
#
|
151
|
+
# It queries all searchable attributes from resource model via LIKE and joins them via OR.
|
152
|
+
#
|
153
|
+
# If the attribute is a relation it builds the query for the associated table.
|
154
|
+
#
|
155
|
+
def search_query(search_terms)
|
156
|
+
resource_handler.searchable_attributes.map do |attribute|
|
157
|
+
if relation = attribute[:relation]
|
158
|
+
"#{relation[:model_association].klass.table_name}.#{relation[:attr_method]} LIKE #{search_terms}"
|
159
|
+
else
|
160
|
+
"#{resource_handler.model.table_name}.#{attribute[:name]} LIKE #{search_terms}"
|
161
|
+
end
|
162
|
+
end.join(" OR ")
|
91
163
|
end
|
164
|
+
|
92
165
|
end
|
93
166
|
end
|
94
167
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
module Alchemy
|
2
2
|
module Admin
|
3
|
-
class TagsController <
|
3
|
+
class TagsController < ResourcesController
|
4
4
|
|
5
5
|
before_filter :load_tag, :only => [:edit, :update, :destroy]
|
6
6
|
|
@@ -12,7 +12,7 @@ module Alchemy
|
|
12
12
|
|
13
13
|
def new
|
14
14
|
@tag = ActsAsTaggableOn::Tag.new
|
15
|
-
render :
|
15
|
+
render layout: !request.xhr?
|
16
16
|
end
|
17
17
|
|
18
18
|
def create
|
@@ -22,7 +22,7 @@ module Alchemy
|
|
22
22
|
|
23
23
|
def edit
|
24
24
|
@tags = ActsAsTaggableOn::Tag.order("name ASC").all - [@tag]
|
25
|
-
render :
|
25
|
+
render layout: !request.xhr?
|
26
26
|
end
|
27
27
|
|
28
28
|
def update
|