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
@@ -6,15 +6,15 @@ module Alchemy
|
|
6
6
|
|
7
7
|
def index
|
8
8
|
@elements = Element.trashed
|
9
|
-
@page = Page.
|
9
|
+
@page = Page.find(params[:page_id])
|
10
10
|
@allowed_elements = Element.all_for_page(@page)
|
11
11
|
@draggable_trash_items = {}
|
12
12
|
@elements.each { |e| @draggable_trash_items["element_#{e.id}"] = e.belonging_cellnames(@page) }
|
13
|
-
render :
|
13
|
+
render layout: !request.xhr?
|
14
14
|
end
|
15
15
|
|
16
16
|
def clear
|
17
|
-
@page = Page.
|
17
|
+
@page = Page.find(params[:page_id])
|
18
18
|
@elements = Element.trashed
|
19
19
|
@elements.map(&:destroy)
|
20
20
|
end
|
@@ -1,12 +1,16 @@
|
|
1
1
|
module Alchemy
|
2
2
|
module Admin
|
3
|
-
class UsersController <
|
3
|
+
class UsersController < ResourcesController
|
4
4
|
|
5
5
|
filter_access_to [:edit, :update, :destroy], :attribute_check => true, :load_method => :load_user, :model => Alchemy::User
|
6
6
|
filter_access_to [:index, :new, :create], :attribute_check => false
|
7
7
|
|
8
8
|
before_filter :set_roles_and_genders, :except => [:index, :destroy]
|
9
9
|
|
10
|
+
handles_sortable_columns do |c|
|
11
|
+
c.default_sort_value = :login
|
12
|
+
end
|
13
|
+
|
10
14
|
def index
|
11
15
|
if !params[:query].blank?
|
12
16
|
users = User.where([
|
@@ -19,12 +23,7 @@ module Alchemy
|
|
19
23
|
else
|
20
24
|
users = User.scoped
|
21
25
|
end
|
22
|
-
@users = users.page(params[:page] || 1).per(per_page_value_for_screen_size).order(
|
23
|
-
end
|
24
|
-
|
25
|
-
def new
|
26
|
-
@user = User.new
|
27
|
-
render :layout => false
|
26
|
+
@users = users.page(params[:page] || 1).per(per_page_value_for_screen_size).order(sort_order)
|
28
27
|
end
|
29
28
|
|
30
29
|
def create
|
@@ -43,10 +42,6 @@ module Alchemy
|
|
43
42
|
)
|
44
43
|
end
|
45
44
|
|
46
|
-
def edit
|
47
|
-
render :layout => false
|
48
|
-
end
|
49
|
-
|
50
45
|
def update
|
51
46
|
# User is fetched via before filter
|
52
47
|
params[:user].delete(:role) unless permitted_to?(:update_role)
|
@@ -5,11 +5,11 @@ module Alchemy
|
|
5
5
|
|
6
6
|
# sends file inline. i.e. for viewing pdfs/movies in browser
|
7
7
|
def show
|
8
|
-
|
9
|
-
@attachment.
|
8
|
+
send_data(
|
9
|
+
@attachment.file.data,
|
10
10
|
{
|
11
|
-
:
|
12
|
-
:type => @attachment.
|
11
|
+
:filename => @attachment.file_name,
|
12
|
+
:type => @attachment.file_mime_type,
|
13
13
|
:disposition => 'inline'
|
14
14
|
}
|
15
15
|
)
|
@@ -17,11 +17,10 @@ module Alchemy
|
|
17
17
|
|
18
18
|
# sends file as attachment. aka download
|
19
19
|
def download
|
20
|
-
|
21
|
-
@attachment.
|
22
|
-
:
|
23
|
-
:type => @attachment.
|
24
|
-
:disposition => 'attachment'
|
20
|
+
send_data(
|
21
|
+
@attachment.file.data, {
|
22
|
+
:filename => @attachment.file_name,
|
23
|
+
:type => @attachment.file_mime_type
|
25
24
|
}
|
26
25
|
)
|
27
26
|
end
|
@@ -10,18 +10,13 @@ module Alchemy
|
|
10
10
|
before_filter :set_language
|
11
11
|
before_filter :mailer_set_url_options
|
12
12
|
before_filter :store_user_request_time
|
13
|
+
before_filter :set_authorization_user
|
13
14
|
|
14
15
|
helper_method :current_server, :current_site, :multi_site?
|
15
16
|
|
16
17
|
# Returns a host string with the domain the app is running on.
|
17
18
|
def current_server
|
18
|
-
|
19
|
-
if request.port != 80
|
20
|
-
"#{request.protocol}#{request.host}:#{request.port}"
|
21
|
-
# For remote production server
|
22
|
-
else
|
23
|
-
"#{request.protocol}#{request.host}"
|
24
|
-
end
|
19
|
+
"#{request.protocol}#{request.host_with_port}"
|
25
20
|
end
|
26
21
|
|
27
22
|
# Returns the configuratin value of given key.
|
@@ -64,6 +59,12 @@ module Alchemy
|
|
64
59
|
Site.current = current_site
|
65
60
|
end
|
66
61
|
|
62
|
+
# Stores the current_user for declarative_authorization
|
63
|
+
#
|
64
|
+
def set_authorization_user
|
65
|
+
Authorization.current_user = current_user
|
66
|
+
end
|
67
|
+
|
67
68
|
# Sets Alchemy's GUI translation to users preffered language and stores it in the session.
|
68
69
|
#
|
69
70
|
# Guesses the language from browser locale. If not successful it takes the default.
|
@@ -203,9 +204,7 @@ module Alchemy
|
|
203
204
|
|
204
205
|
def permission_denied
|
205
206
|
if current_user
|
206
|
-
if
|
207
|
-
redirect_to alchemy.root_path
|
208
|
-
else
|
207
|
+
if permitted_to? :index_alchemy_admin_dashboard
|
209
208
|
if request.referer == alchemy.login_url
|
210
209
|
render :file => Rails.root.join('public/422'), :status => 422
|
211
210
|
elsif request.xhr?
|
@@ -221,6 +220,8 @@ module Alchemy
|
|
221
220
|
flash[:error] = _t('You are not authorized')
|
222
221
|
redirect_to alchemy.admin_dashboard_path
|
223
222
|
end
|
223
|
+
else
|
224
|
+
redirect_to alchemy.root_path
|
224
225
|
end
|
225
226
|
else
|
226
227
|
flash[:info] = _t('Please log in')
|
@@ -233,5 +234,11 @@ module Alchemy
|
|
233
234
|
end
|
234
235
|
end
|
235
236
|
|
237
|
+
# Logs the current exception to the error log.
|
238
|
+
def exception_logger(e)
|
239
|
+
Rails.logger.error("\n#{e.class} #{e.message} in #{e.backtrace.first}")
|
240
|
+
Rails.logger.error(e.backtrace[1..50].each { |l| l.gsub(/#{Rails.root.to_s}/, '') }.join("\n"))
|
241
|
+
end
|
242
|
+
|
236
243
|
end
|
237
244
|
end
|
@@ -98,8 +98,8 @@ module Alchemy
|
|
98
98
|
@page ||= load_page
|
99
99
|
if User.admins.count == 0 && @page.nil?
|
100
100
|
redirect_to signup_path
|
101
|
-
elsif @page.nil? &&
|
102
|
-
@page =
|
101
|
+
elsif @page.nil? && last_legacy_url
|
102
|
+
@page = last_legacy_url.page
|
103
103
|
redirect_page
|
104
104
|
elsif @page.blank?
|
105
105
|
raise_not_found_error
|
@@ -113,12 +113,6 @@ module Alchemy
|
|
113
113
|
redirect_page
|
114
114
|
elsif !multi_language? && !params[:lang].blank?
|
115
115
|
redirect_page
|
116
|
-
elsif configuration(:url_nesting) && url_levels.any? && !levels_are_in_page_branch?
|
117
|
-
raise_not_found_error
|
118
|
-
elsif configuration(:url_nesting) && should_be_nested? && !url_levels.any?
|
119
|
-
redirect_page(params_for_nested_url)
|
120
|
-
elsif !configuration(:url_nesting) && url_levels.any?
|
121
|
-
redirect_page
|
122
116
|
elsif @page.has_controller?
|
123
117
|
redirect_to main_app.url_for(@page.controller_and_action)
|
124
118
|
else
|
@@ -152,22 +146,16 @@ module Alchemy
|
|
152
146
|
|
153
147
|
def additional_params
|
154
148
|
params.each do |key, value|
|
155
|
-
params[key] = nil if ["action", "controller", "urlname", "lang"
|
149
|
+
params[key] = nil if ["action", "controller", "urlname", "lang"].include?(key)
|
156
150
|
end
|
157
151
|
end
|
158
152
|
|
159
|
-
def
|
160
|
-
|
161
|
-
end
|
162
|
-
|
163
|
-
def levels_are_in_page_branch?
|
164
|
-
nested_urlnames = breadcrumb(@page).collect(&:urlname)
|
165
|
-
level_names = params.select { |k, v| url_levels.include?(k) }.map(&:second)
|
166
|
-
level_names & nested_urlnames == level_names
|
153
|
+
def legacy_urls
|
154
|
+
LegacyPageUrl.joins(:page).where(urlname: params[:urlname], alchemy_pages: {language_id: session[:language_id]})
|
167
155
|
end
|
168
156
|
|
169
|
-
def
|
170
|
-
|
157
|
+
def last_legacy_url
|
158
|
+
legacy_urls.last
|
171
159
|
end
|
172
160
|
|
173
161
|
end
|
@@ -1,12 +1,16 @@
|
|
1
1
|
module Alchemy
|
2
2
|
class PasswordsController < Devise::PasswordsController
|
3
|
+
include Alchemy::FerretSearch
|
4
|
+
helper 'Alchemy::Admin::Base', 'Alchemy::Pages'
|
3
5
|
|
4
6
|
before_filter { enforce_ssl if ssl_required? && !request.ssl? }
|
5
7
|
before_filter :set_translation
|
6
8
|
|
7
|
-
layout 'alchemy/
|
9
|
+
layout 'alchemy/login'
|
8
10
|
|
9
|
-
|
11
|
+
def new
|
12
|
+
build_resource(email: params[:email])
|
13
|
+
end
|
10
14
|
|
11
15
|
private
|
12
16
|
|
@@ -19,5 +23,13 @@ module Alchemy
|
|
19
23
|
alchemy.edit_password_url(options)
|
20
24
|
end
|
21
25
|
|
26
|
+
def after_sign_in_path_for(resource_or_scope)
|
27
|
+
if permitted_to?(:index, :alchemy_admin_dashboard)
|
28
|
+
alchemy.admin_dashboard_path
|
29
|
+
else
|
30
|
+
alchemy.root_path
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
22
34
|
end
|
23
|
-
end
|
35
|
+
end
|
@@ -1,13 +1,14 @@
|
|
1
1
|
module Alchemy
|
2
2
|
class UserSessionsController < Devise::SessionsController
|
3
|
+
# Necessary because this controller is also used for general login.
|
4
|
+
include Alchemy::FerretSearch
|
5
|
+
helper 'Alchemy::Admin::Base', 'Alchemy::Pages'
|
3
6
|
|
4
7
|
before_filter { enforce_ssl if ssl_required? && !request.ssl? }
|
5
8
|
before_filter :set_translation
|
6
9
|
before_filter :check_user_count, :only => :new
|
7
10
|
|
8
|
-
layout 'alchemy/
|
9
|
-
|
10
|
-
helper 'Alchemy::Admin::Base'
|
11
|
+
layout 'alchemy/login'
|
11
12
|
|
12
13
|
def new
|
13
14
|
super
|
@@ -30,7 +31,7 @@ module Alchemy
|
|
30
31
|
end
|
31
32
|
|
32
33
|
def leave
|
33
|
-
render :
|
34
|
+
render layout: !request.xhr?
|
34
35
|
end
|
35
36
|
|
36
37
|
def destroy
|
@@ -11,6 +11,7 @@ module Alchemy
|
|
11
11
|
# * link_to_confirmation_window
|
12
12
|
#
|
13
13
|
module BaseHelper
|
14
|
+
include Alchemy::BaseHelper
|
14
15
|
|
15
16
|
# This helper renders the link for an overlay window.
|
16
17
|
#
|
@@ -32,17 +33,13 @@ module Alchemy
|
|
32
33
|
:resizable => false
|
33
34
|
}
|
34
35
|
options = default_options.merge(options)
|
35
|
-
size = options
|
36
|
+
size = options.delete(:size).to_s.split('x')
|
36
37
|
link_to(content, url,
|
37
38
|
html_options.merge(
|
38
|
-
'data-alchemy-overlay' =>
|
39
|
-
:
|
40
|
-
:
|
41
|
-
|
42
|
-
:modal => options[:modal],
|
43
|
-
:overflow => options[:overflow],
|
44
|
-
:title => options[:title]
|
45
|
-
}.to_json
|
39
|
+
'data-alchemy-overlay' => options.update(
|
40
|
+
:width => size && size[0] ? size[0] : 'auto',
|
41
|
+
:height => size && size[1] ? size[1] : 'auto',
|
42
|
+
).to_json
|
46
43
|
)
|
47
44
|
)
|
48
45
|
end
|
@@ -82,30 +79,25 @@ module Alchemy
|
|
82
79
|
end
|
83
80
|
end
|
84
81
|
|
85
|
-
# Used by Alchemy to display a javascript driven filter for lists
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
:
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
filter_field << '</div>'
|
105
|
-
filter_field.html_safe
|
106
|
-
end
|
107
|
-
|
108
|
-
# Returns a link that opens a modal confirmation window.
|
82
|
+
# Used by Alchemy to display a javascript driven filter for lists.
|
83
|
+
#
|
84
|
+
# @param [String] a jquery compatible selector string that represents the items to filter
|
85
|
+
# @param [Hash] html options passed to the input field
|
86
|
+
#
|
87
|
+
def js_filter_field(items, options = {})
|
88
|
+
options = {
|
89
|
+
class: 'js_filter_field',
|
90
|
+
data: {'alchemy-list-filter' => items}
|
91
|
+
}.merge(options)
|
92
|
+
content_tag(:div, class: 'js_filter_field_box') do
|
93
|
+
concat text_field_tag(nil, nil, options)
|
94
|
+
concat content_tag('span', '', class: 'icon search')
|
95
|
+
concat link_to('', '', class: 'js_filter_field_clear', title: _t(:click_to_show_all))
|
96
|
+
concat content_tag(:label, _t(:search), for: options[:id])
|
97
|
+
end
|
98
|
+
end
|
99
|
+
|
100
|
+
# Returns a link that opens a modal confirmation to delete window.
|
109
101
|
#
|
110
102
|
# === Parameters:
|
111
103
|
#
|
@@ -122,7 +114,7 @@ module Alchemy
|
|
122
114
|
link_to(link_string, url,
|
123
115
|
html_options.merge(
|
124
116
|
'data-alchemy-confirm-delete' => {
|
125
|
-
:title => _t(
|
117
|
+
:title => _t(:please_confirm),
|
126
118
|
:message => message,
|
127
119
|
:ok_label => _t("Yes"),
|
128
120
|
:cancel_label => _t("No")
|
@@ -131,6 +123,35 @@ module Alchemy
|
|
131
123
|
)
|
132
124
|
end
|
133
125
|
|
126
|
+
# Returns a form and a button that opens a modal confirm window.
|
127
|
+
#
|
128
|
+
# After confirmation it proceeds to send the form's action.
|
129
|
+
#
|
130
|
+
# === Parameters:
|
131
|
+
#
|
132
|
+
# 1. The content inside the <a> tag
|
133
|
+
# 2. The url that gets opened after confirmation
|
134
|
+
# 3. Options for the Alchemy confirm overlay (See: app/assets/javascripts/alchemy/alchemy.window.js#openConfirmWindow)
|
135
|
+
# 4. HTML options that get passed to the button_tag helper.
|
136
|
+
#
|
137
|
+
# NOTE: The method option in the html_options hash gets passed to the form_tag helper!
|
138
|
+
#
|
139
|
+
# === Example:
|
140
|
+
#
|
141
|
+
# <%= button_with_confirm('pay', '/admin/orders/1/pay', message: 'Do you really want to mark this order as payed?') %>
|
142
|
+
#
|
143
|
+
def button_with_confirm(value = "", url = "", options = {}, html_options = {})
|
144
|
+
options = {
|
145
|
+
message: _t(:confirm_to_proceed),
|
146
|
+
ok_label: _t("Yes"),
|
147
|
+
title: _t(:please_confirm),
|
148
|
+
cancel_label: _t("No")
|
149
|
+
}.merge(options)
|
150
|
+
form_tag url, {method: html_options.delete(:method)} do
|
151
|
+
button_tag value, html_options.merge('data-alchemy-confirm' => options.to_json)
|
152
|
+
end
|
153
|
+
end
|
154
|
+
|
134
155
|
# Returns an Array build for passing it to the options_for_select helper inside an essence editor partial.
|
135
156
|
# Usefull for the select_values options from the render_essence_editor helpers.
|
136
157
|
#
|
@@ -192,7 +213,7 @@ module Alchemy
|
|
192
213
|
content = element.contents[content - 1]
|
193
214
|
end
|
194
215
|
if content.essence.nil?
|
195
|
-
return warning('Element', _t(
|
216
|
+
return warning('Element', _t(:content_essence_not_found))
|
196
217
|
end
|
197
218
|
select_options = options_for_select(select_options, content.essence.content)
|
198
219
|
select_tag(
|
@@ -336,6 +357,7 @@ module Alchemy
|
|
336
357
|
# :label [String] # Text for button label.
|
337
358
|
# :url [String] # Url for link.
|
338
359
|
# :title [String] # Text for title tag.
|
360
|
+
# :hotkey [String] # Keyboard shortcut for this button. I.E 'alt-n'
|
339
361
|
# :overlay [Boolean] # Pass true to open the link in a modal overlay window.
|
340
362
|
# :overlay_options [Hash] # Overlay options. See link_to_overlay_window helper.
|
341
363
|
# :if_permitted_to [Array] # Check permission for button. [:action, :controller]. Exactly how you defined the permission in your +authorization_rules.rb+. Defaults to controller and action from button url.
|
@@ -361,11 +383,12 @@ module Alchemy
|
|
361
383
|
options[:overlay_options],
|
362
384
|
{
|
363
385
|
:class => 'icon_button',
|
364
|
-
:title => options[:title]
|
365
|
-
|
386
|
+
:title => options[:title],
|
387
|
+
'data-alchemy-hotkey' => options[:hotkey]
|
388
|
+
}.merge(options[:link_options])
|
366
389
|
)
|
367
390
|
else
|
368
|
-
link_to options[:url], {:class => "icon_button#{options[:loading_indicator] ? ' please_wait' : nil}", :title => options[:title]}.merge(options[:link_options]) do
|
391
|
+
link_to options[:url], {:class => ("icon_button#{options[:loading_indicator] ? ' please_wait' : nil}"), :title => options[:title], 'data-alchemy-hotkey' => options[:hotkey]}.merge(options[:link_options]) do
|
369
392
|
render_icon(options[:icon])
|
370
393
|
end
|
371
394
|
end
|
@@ -427,7 +450,7 @@ module Alchemy
|
|
427
450
|
# NOTE: Alchemy gives you a local variable named like your resource
|
428
451
|
#
|
429
452
|
def render_resources
|
430
|
-
render :partial =>
|
453
|
+
render :partial => resource_name, :collection => resources_instance_variable
|
431
454
|
rescue ActionView::MissingTemplate
|
432
455
|
render :partial => 'resource', :collection => resources_instance_variable
|
433
456
|
end
|
@@ -488,57 +511,6 @@ module Alchemy
|
|
488
511
|
current_params.merge(p).delete_if { |k, v| v.blank? }
|
489
512
|
end
|
490
513
|
|
491
|
-
# Checks if the pictures tag-filter contains the given tag
|
492
|
-
def pictures_filtered_by_tag?(tag)
|
493
|
-
if params[:tagged_with].present?
|
494
|
-
tags = params[:tagged_with].split(',')
|
495
|
-
tags.include?(tag.name)
|
496
|
-
else
|
497
|
-
false
|
498
|
-
end
|
499
|
-
end
|
500
|
-
|
501
|
-
# Adds the given tag to the pictures tag-filter
|
502
|
-
def add_to_picture_tag_filter(tag)
|
503
|
-
if params[:tagged_with].present?
|
504
|
-
tags = params[:tagged_with].split(',')
|
505
|
-
tags << tag.name
|
506
|
-
else
|
507
|
-
[tag.name]
|
508
|
-
end
|
509
|
-
end
|
510
|
-
|
511
|
-
# Removes the given tag from the pictures tag-filter
|
512
|
-
def remove_from_picture_tag_filter(tag)
|
513
|
-
if params[:tagged_with].present?
|
514
|
-
tags = params[:tagged_with].split(',')
|
515
|
-
tags.delete_if { |t| t == tag.name }
|
516
|
-
else
|
517
|
-
[]
|
518
|
-
end
|
519
|
-
end
|
520
|
-
|
521
|
-
# Returns the picture tag-filter from params.
|
522
|
-
# A tag can be added to the filter.
|
523
|
-
# A tag can also be removed.
|
524
|
-
#
|
525
|
-
# Options are:
|
526
|
-
# * options (Hash):
|
527
|
-
# ** :add (ActsAsTaggableOn::Tag) - The tag that should be added to the tag-filter
|
528
|
-
# ** :remove (ActsAsTaggableOn::Tag) - The tag that should be removed from the tag-filter
|
529
|
-
def picture_tag_filter(options={})
|
530
|
-
case
|
531
|
-
when options[:add]
|
532
|
-
taglist = add_to_picture_tag_filter(options[:add]) if options[:add]
|
533
|
-
when options[:remove]
|
534
|
-
taglist = remove_from_picture_tag_filter(options[:remove]) if options[:remove]
|
535
|
-
else
|
536
|
-
return params[:tagged_with]
|
537
|
-
end
|
538
|
-
return nil if taglist.blank?
|
539
|
-
taglist.uniq.join(',')
|
540
|
-
end
|
541
|
-
|
542
514
|
def render_hint_for(element)
|
543
515
|
return unless element.has_hint?
|
544
516
|
link_to '#', :class => 'hint' do
|