alchemy_cms 2.5.3.1 → 2.6.0.rc5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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
|
@@ -120,12 +120,7 @@ en:
|
|
|
120
120
|
mailer:
|
|
121
121
|
# The mail the user gets after registering for alchemy
|
|
122
122
|
new_user_mail:
|
|
123
|
-
subject: 'Your credentials
|
|
124
|
-
welcome: 'Welcome to my site'
|
|
125
|
-
login_url_explanation: 'To login just click this link'
|
|
126
|
-
username: 'Your username is'
|
|
127
|
-
password_notice: "(For security reasons we do not show your password here. If you forgot your password or this is your first login, please goto: %{url})"
|
|
128
|
-
greeting: 'Have a nice day'
|
|
123
|
+
subject: 'Your user credentials'
|
|
129
124
|
|
|
130
125
|
# == Translated language names for translation select
|
|
131
126
|
translations:
|
|
@@ -231,6 +226,7 @@ en:
|
|
|
231
226
|
delete_user: "Delete this user"
|
|
232
227
|
document: "File"
|
|
233
228
|
documents: "Files"
|
|
229
|
+
download_csv: "Download CSV"
|
|
234
230
|
download_file: "Download file '%{filename}'"
|
|
235
231
|
"Drag an element over to the element window to restore it": "Drag an element over to the element window to restore it."
|
|
236
232
|
drag_to_sort: "Drag'n'Drop to sort images"
|
|
@@ -345,10 +341,6 @@ en:
|
|
|
345
341
|
pages:
|
|
346
342
|
update:
|
|
347
343
|
comma_seperated: "Separate by comma"
|
|
348
|
-
pagination:
|
|
349
|
-
next_page: "next page »"
|
|
350
|
-
previous_page: "« previous page"
|
|
351
|
-
truncate: '...'
|
|
352
344
|
password: "Password"
|
|
353
345
|
picture_gallery_editor: 'Pictures'
|
|
354
346
|
"Picture uploaded succesfully": "Picture %{name} uploaded succesfully"
|
|
@@ -375,6 +367,9 @@ en:
|
|
|
375
367
|
'1024': '1024px (iPad - Landscape)'
|
|
376
368
|
'1280': '1280px (Desktop)'
|
|
377
369
|
rename_file: "Rename this file."
|
|
370
|
+
resources:
|
|
371
|
+
relation_select:
|
|
372
|
+
blank: '- none -'
|
|
378
373
|
robot_follow: "robot may follow links."
|
|
379
374
|
robot_index: "allow robot to index."
|
|
380
375
|
saved_link: "Link saved."
|
|
@@ -608,6 +603,9 @@ en:
|
|
|
608
603
|
activerecord:
|
|
609
604
|
|
|
610
605
|
models:
|
|
606
|
+
acts_as_taggable_on/tag:
|
|
607
|
+
one: Tag
|
|
608
|
+
other: Tags
|
|
611
609
|
|
|
612
610
|
alchemy/attachment:
|
|
613
611
|
one: File
|
|
@@ -683,3 +681,10 @@ en:
|
|
|
683
681
|
|
|
684
682
|
errors:
|
|
685
683
|
<<: *errors
|
|
684
|
+
|
|
685
|
+
views:
|
|
686
|
+
pagination:
|
|
687
|
+
first: "First Page"
|
|
688
|
+
previous_page: "Previous Page"
|
|
689
|
+
next_page: "Next Page"
|
|
690
|
+
last: "Last Page"
|
|
@@ -29,6 +29,7 @@ de:
|
|
|
29
29
|
updated: 'Ihr Passwort wurde geändert. Sie sind jetzt angemeldet.'
|
|
30
30
|
updated_not_active: 'Ihr Passwort wurde geändert.'
|
|
31
31
|
send_paranoid_instructions: "Falls Ihre E-Mail-Adresse in unserer Datenbank existiert erhalten Sie in wenigen Minuten eine E-Mail mit der Anleitung, wie Sie Ihr Passwort zurücksetzen können."
|
|
32
|
+
no_token: "Es wurde nicht alle benötigten Parameter übergeben. Bitte überprüfen Sie, ob die komplette URL aus der E-Mail benutzt wurde."
|
|
32
33
|
confirmations:
|
|
33
34
|
send_instructions: 'Sie erhalten in wenigen Minuten eine E-Mail, mit der Sie Ihre Registrierung bestätigen können.'
|
|
34
35
|
send_paranoid_instructions: 'Falls Ihre E-Mail-Adresse in unserer Datenbank existiert erhalten Sie in wenigen Minuten eine E-Mail mit der die Sie Ihre Registrierung bestätigen können.'
|
data/config/routes.rb
CHANGED
|
@@ -20,7 +20,7 @@ Alchemy::Engine.routes.draw do
|
|
|
20
20
|
get '/admin/dashboard' => 'admin/dashboard#index', :as => :user_root
|
|
21
21
|
get '/admin/leave' => 'user_sessions#leave', :as => :leave_admin
|
|
22
22
|
get '/admin/passwords' => 'passwords#new', :as => :new_password
|
|
23
|
-
get '/admin/passwords/:id/edit' => 'passwords#edit', :as => :edit_password
|
|
23
|
+
get '/admin/passwords/:id/edit/:reset_password_token' => 'passwords#edit', :as => :edit_password
|
|
24
24
|
post '/admin/passwords' => 'passwords#create', :as => :password
|
|
25
25
|
put '/admin/passwords' => 'passwords#update', :as => :password
|
|
26
26
|
end
|
|
@@ -110,7 +110,7 @@ Alchemy::Engine.routes.draw do
|
|
|
110
110
|
get :edit_multiple
|
|
111
111
|
end
|
|
112
112
|
member do
|
|
113
|
-
get :
|
|
113
|
+
get :info
|
|
114
114
|
delete :remove
|
|
115
115
|
end
|
|
116
116
|
end
|
|
@@ -169,7 +169,7 @@ Alchemy::Engine.routes.draw do
|
|
|
169
169
|
:as => :show_language_root
|
|
170
170
|
|
|
171
171
|
# The page show action has to be last route
|
|
172
|
-
match '(/:lang)
|
|
172
|
+
match '(/:lang)/*urlname(.:format)' => 'pages#show',
|
|
173
173
|
:constraints => {:lang => /[a-z]{2}(-[a-z]{2})?/},
|
|
174
174
|
:as => :show_page
|
|
175
175
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
# This is a compressed migration for creating all Alchemy 2.
|
|
1
|
+
# This is a compressed migration for creating all Alchemy 2.5 tables at once.
|
|
2
2
|
#
|
|
3
3
|
# === Notice
|
|
4
4
|
#
|
|
5
5
|
# In order to upgrade from an old version of Alchemy, you have to run all migrations from
|
|
6
6
|
# each version you missed up to the version you want to upgrade to, before running this migration.
|
|
7
7
|
#
|
|
8
|
-
class
|
|
8
|
+
class AlchemyTwoPointFive < ActiveRecord::Migration
|
|
9
9
|
def up
|
|
10
10
|
# Do not run if Alchemy tables are already present
|
|
11
11
|
return if table_exists?(:alchemy_pages)
|
|
@@ -184,10 +184,21 @@ class AlchemyTwoPointFour < ActiveRecord::Migration
|
|
|
184
184
|
t.integer "updater_id"
|
|
185
185
|
t.boolean "default", :default => false
|
|
186
186
|
t.string "country_code", :default => "", :null => false
|
|
187
|
+
t.integer "site_id"
|
|
187
188
|
end
|
|
188
189
|
|
|
189
190
|
add_index "alchemy_languages", ["language_code", "country_code"], :name => "index_alchemy_languages_on_language_code_and_country_code"
|
|
190
191
|
add_index "alchemy_languages", ["language_code"], :name => "index_alchemy_languages_on_language_code"
|
|
192
|
+
add_index "alchemy_languages", ["site_id"], :name => "index_alchemy_languages_on_site_id"
|
|
193
|
+
|
|
194
|
+
create_table "alchemy_legacy_page_urls", :force => true do |t|
|
|
195
|
+
t.string "urlname", :null => false
|
|
196
|
+
t.integer "page_id", :null => false
|
|
197
|
+
t.datetime "created_at", :null => false
|
|
198
|
+
t.datetime "updated_at", :null => false
|
|
199
|
+
end
|
|
200
|
+
|
|
201
|
+
add_index "alchemy_legacy_page_urls", ["urlname"], :name => "index_alchemy_legacy_page_urls_on_urlname"
|
|
191
202
|
|
|
192
203
|
create_table "alchemy_pages", :force => true do |t|
|
|
193
204
|
t.string "name"
|
|
@@ -225,59 +236,61 @@ class AlchemyTwoPointFour < ActiveRecord::Migration
|
|
|
225
236
|
|
|
226
237
|
create_table "alchemy_pictures", :force => true do |t|
|
|
227
238
|
t.string "name"
|
|
228
|
-
t.string "
|
|
229
|
-
t.integer "
|
|
230
|
-
t.integer "
|
|
231
|
-
t.datetime "created_at",
|
|
232
|
-
t.datetime "updated_at",
|
|
239
|
+
t.string "image_file_name"
|
|
240
|
+
t.integer "image_file_width"
|
|
241
|
+
t.integer "image_file_height"
|
|
242
|
+
t.datetime "created_at", :null => false
|
|
243
|
+
t.datetime "updated_at", :null => false
|
|
233
244
|
t.integer "creator_id"
|
|
234
245
|
t.integer "updater_id"
|
|
235
246
|
t.string "upload_hash"
|
|
236
247
|
t.text "cached_tag_list"
|
|
248
|
+
t.string "image_file_uid"
|
|
249
|
+
t.integer "image_file_size"
|
|
237
250
|
end
|
|
238
251
|
|
|
252
|
+
create_table "alchemy_sites", :force => true do |t|
|
|
253
|
+
t.string "host"
|
|
254
|
+
t.string "name"
|
|
255
|
+
t.datetime "created_at", :null => false
|
|
256
|
+
t.datetime "updated_at", :null => false
|
|
257
|
+
t.boolean "public", :default => false
|
|
258
|
+
t.text "aliases"
|
|
259
|
+
t.boolean "redirect_to_primary_host"
|
|
260
|
+
end
|
|
261
|
+
|
|
262
|
+
add_index "alchemy_sites", ["host", "public"], :name => "alchemy_sites_public_hosts_idx"
|
|
263
|
+
add_index "alchemy_sites", ["host"], :name => "index_alchemy_sites_on_host"
|
|
264
|
+
|
|
239
265
|
create_table "alchemy_users", :force => true do |t|
|
|
240
266
|
t.string "firstname"
|
|
241
267
|
t.string "lastname"
|
|
242
268
|
t.string "login"
|
|
243
269
|
t.string "email"
|
|
244
270
|
t.string "gender"
|
|
245
|
-
t.string "role",
|
|
271
|
+
t.string "role", :default => "registered"
|
|
246
272
|
t.string "language"
|
|
247
|
-
t.string "
|
|
248
|
-
t.string "password_salt",
|
|
249
|
-
t.integer "
|
|
250
|
-
t.integer "
|
|
273
|
+
t.string "encrypted_password", :limit => 128, :default => "", :null => false
|
|
274
|
+
t.string "password_salt", :limit => 128, :default => "", :null => false
|
|
275
|
+
t.integer "sign_in_count", :default => 0, :null => false
|
|
276
|
+
t.integer "failed_attempts", :default => 0, :null => false
|
|
251
277
|
t.datetime "last_request_at"
|
|
252
|
-
t.datetime "
|
|
253
|
-
t.datetime "
|
|
254
|
-
t.string "
|
|
255
|
-
t.string "
|
|
256
|
-
t.
|
|
257
|
-
t.
|
|
258
|
-
t.string "perishable_token", :null => false
|
|
259
|
-
t.datetime "created_at", :null => false
|
|
260
|
-
t.datetime "updated_at", :null => false
|
|
278
|
+
t.datetime "current_sign_in_at"
|
|
279
|
+
t.datetime "last_sign_in_at"
|
|
280
|
+
t.string "current_sign_in_ip"
|
|
281
|
+
t.string "last_sign_in_ip"
|
|
282
|
+
t.datetime "created_at", :null => false
|
|
283
|
+
t.datetime "updated_at", :null => false
|
|
261
284
|
t.integer "creator_id"
|
|
262
285
|
t.integer "updater_id"
|
|
263
286
|
t.text "cached_tag_list"
|
|
287
|
+
t.string "reset_password_token"
|
|
288
|
+
t.datetime "reset_password_sent_at"
|
|
264
289
|
end
|
|
265
290
|
|
|
266
|
-
add_index "alchemy_users", ["
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
t.string "name"
|
|
270
|
-
t.string "hidden_name"
|
|
271
|
-
t.datetime "starts_at"
|
|
272
|
-
t.datetime "ends_at"
|
|
273
|
-
t.text "description"
|
|
274
|
-
t.decimal "entrance_fee", :precision => 6, :scale => 2
|
|
275
|
-
t.boolean "published"
|
|
276
|
-
t.integer "location_id"
|
|
277
|
-
t.integer "organizer_id"
|
|
278
|
-
t.datetime "created_at", :null => false
|
|
279
|
-
t.datetime "updated_at", :null => false
|
|
280
|
-
end
|
|
291
|
+
add_index "alchemy_users", ["email"], :name => "index_alchemy_users_on_email", :unique => true
|
|
292
|
+
add_index "alchemy_users", ["login"], :name => "index_alchemy_users_on_login", :unique => true
|
|
293
|
+
add_index "alchemy_users", ["reset_password_token"], :name => "index_alchemy_users_on_reset_password_token", :unique => true
|
|
281
294
|
|
|
282
295
|
create_table "taggings", :force => true do |t|
|
|
283
296
|
t.integer "tag_id"
|
|
@@ -295,5 +308,6 @@ class AlchemyTwoPointFour < ActiveRecord::Migration
|
|
|
295
308
|
create_table "tags", :force => true do |t|
|
|
296
309
|
t.string "name"
|
|
297
310
|
end
|
|
311
|
+
|
|
298
312
|
end
|
|
299
313
|
end
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
class MigrateAttachmentsToDragonfly < ActiveRecord::Migration
|
|
2
|
+
def up
|
|
3
|
+
change_table :alchemy_attachments do |t|
|
|
4
|
+
t.string :file_uid
|
|
5
|
+
t.index :file_uid
|
|
6
|
+
t.rename :filename, :file_name
|
|
7
|
+
t.rename :content_type, :file_mime_type
|
|
8
|
+
t.rename :size, :file_size
|
|
9
|
+
end
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
def down
|
|
13
|
+
change_table :alchemy_attachments do |t|
|
|
14
|
+
t.remove :file_uid
|
|
15
|
+
t.rename :file_name, :filename
|
|
16
|
+
t.rename :file_mime_type, :content_type
|
|
17
|
+
t.rename :file_size, :size
|
|
18
|
+
t.remove_index :file_uid
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
class ChangeAlchemyUsersRoleToRoles < ActiveRecord::Migration
|
|
2
|
+
def up
|
|
3
|
+
rename_column :alchemy_users, :role, :roles
|
|
4
|
+
add_index :alchemy_users, :roles
|
|
5
|
+
end
|
|
6
|
+
|
|
7
|
+
def down
|
|
8
|
+
remove_index :alchemy_users, :roles
|
|
9
|
+
rename_column :alchemy_users, :roles, :role
|
|
10
|
+
end
|
|
11
|
+
end
|
data/lib/alchemy/capistrano.rb
CHANGED
|
@@ -37,23 +37,25 @@ require 'fileutils'
|
|
|
37
37
|
|
|
38
38
|
desc "Upgrades production database to current Alchemy CMS version"
|
|
39
39
|
task :upgrade do
|
|
40
|
-
run "cd #{current_path} && RAILS_ENV=#{fetch(:rails_env, 'production')}
|
|
40
|
+
run "cd #{current_path} && #{rake} RAILS_ENV=#{fetch(:rails_env, 'production')} alchemy:upgrade"
|
|
41
41
|
end
|
|
42
42
|
|
|
43
43
|
namespace :database_yml do
|
|
44
44
|
|
|
45
45
|
desc "Creates the database.yml file"
|
|
46
46
|
task :create do
|
|
47
|
-
|
|
47
|
+
environment = Capistrano::CLI.ui.ask("\nPlease enter the environment (Default: #{fetch(:rails_env, 'production')})")
|
|
48
|
+
environment = fetch(:rails_env, 'production') if environment.empty?
|
|
49
|
+
db_adapter = Capistrano::CLI.ui.ask("Please enter database adapter (Options: mysql2, or postgresql. Default mysql2): ")
|
|
48
50
|
db_adapter = db_adapter.empty? ? 'mysql2' : db_adapter.gsub(/^mysql$/, 'mysql2')
|
|
49
51
|
db_name = Capistrano::CLI.ui.ask("Please enter database name: ")
|
|
50
52
|
db_username = Capistrano::CLI.ui.ask("Please enter database username: ")
|
|
51
|
-
db_password = Capistrano::CLI.
|
|
53
|
+
db_password = Capistrano::CLI.password_prompt("Please enter database password: ")
|
|
52
54
|
default_db_host = db_adapter == 'mysql2' ? 'localhost' : '127.0.0.1'
|
|
53
55
|
db_host = Capistrano::CLI.ui.ask("Please enter database host (Default: #{default_db_host}): ")
|
|
54
56
|
db_host = db_host.empty? ? default_db_host : db_host
|
|
55
57
|
db_config = ERB.new <<-EOF
|
|
56
|
-
|
|
58
|
+
#{environment}:
|
|
57
59
|
adapter: #{ db_adapter }
|
|
58
60
|
encoding: utf8
|
|
59
61
|
reconnect: false
|
|
@@ -78,12 +80,12 @@ EOF
|
|
|
78
80
|
|
|
79
81
|
desc "Seeds the database with essential data."
|
|
80
82
|
task :seed, :roles => :db do
|
|
81
|
-
run "cd #{current_path} && RAILS_ENV=#{fetch(:rails_env, 'production')}
|
|
83
|
+
run "cd #{current_path} && #{rake} RAILS_ENV=#{fetch(:rails_env, 'production')} alchemy:db:seed"
|
|
82
84
|
end
|
|
83
85
|
|
|
84
86
|
desc "Dumps the database into 'db/dumps'"
|
|
85
87
|
task :dump, :roles => :db do
|
|
86
|
-
run "cd #{current_path} && RAILS_ENV=#{fetch(:rails_env, 'production')}
|
|
88
|
+
run "cd #{current_path} && #{rake} RAILS_ENV=#{fetch(:rails_env, 'production')} alchemy:db:dump"
|
|
87
89
|
end
|
|
88
90
|
|
|
89
91
|
end
|
|
@@ -100,7 +102,7 @@ EOF
|
|
|
100
102
|
desc "Imports the database into your local development machine."
|
|
101
103
|
task :database, :roles => [:db], :only => {:primary => true} do
|
|
102
104
|
server = find_servers_for_task(current_task).first
|
|
103
|
-
dump_cmd = "cd #{current_path} && RAILS_ENV=#{fetch(:rails_env, 'production')}
|
|
105
|
+
dump_cmd = "cd #{current_path} && #{rake} RAILS_ENV=#{fetch(:rails_env, 'production')} alchemy:db:dump"
|
|
104
106
|
sql_stream = "ssh -p #{fetch(:port, 22)} #{user}@#{server} '#{dump_cmd}'"
|
|
105
107
|
mysql_credentials = ["--user='#{database_config['username']}'"]
|
|
106
108
|
if database_config['password']
|
|
@@ -148,7 +150,7 @@ EOF
|
|
|
148
150
|
# It uses the +alchemy:rebuild_index+ rake task found in +vendor/plugins/alchemy/lib/tasks+.
|
|
149
151
|
desc "Rebuild the ferret index. Call before deploy:restart"
|
|
150
152
|
task :rebuild_index, :roles => :app do
|
|
151
|
-
run "cd #{current_path} && RAILS_ENV=#{fetch(:rails_env, 'production')}
|
|
153
|
+
run "cd #{current_path} && #{rake} RAILS_ENV=#{fetch(:rails_env, 'production')} ferret:rebuild_index"
|
|
152
154
|
end
|
|
153
155
|
|
|
154
156
|
end
|
data/lib/alchemy/errors.rb
CHANGED
|
@@ -49,4 +49,11 @@ module Alchemy
|
|
|
49
49
|
end
|
|
50
50
|
end
|
|
51
51
|
|
|
52
|
+
class MissingActiveRecordAssociation < StandardError
|
|
53
|
+
# Raised if a resource_relation is defined without proper ActiveRecord association
|
|
54
|
+
def message
|
|
55
|
+
"You need to define proper ActiveRecord associations, if you want to use resource_relations."
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
|
|
52
59
|
end
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
module Alchemy
|
|
2
|
+
module Filetypes
|
|
3
|
+
|
|
4
|
+
ARCHIVE_FILE_TYPES = ["application/zip", "application/x-rar"]
|
|
5
|
+
|
|
6
|
+
AUDIO_FILE_TYPES = [
|
|
7
|
+
"audio/mpeg",
|
|
8
|
+
"audio/mp4",
|
|
9
|
+
"audio/wav",
|
|
10
|
+
"audio/x-wav"
|
|
11
|
+
]
|
|
12
|
+
|
|
13
|
+
IMAGE_FILE_TYPES = [
|
|
14
|
+
"image/gif",
|
|
15
|
+
"image/jpeg",
|
|
16
|
+
"image/png",
|
|
17
|
+
"image/tiff"
|
|
18
|
+
]
|
|
19
|
+
|
|
20
|
+
VCARD_FILE_TYPES = ["text/x-vcard", "application/vcard"]
|
|
21
|
+
|
|
22
|
+
VIDEO_FILE_TYPES = [
|
|
23
|
+
"application/x-flash-video",
|
|
24
|
+
"video/x-flv",
|
|
25
|
+
"video/mp4",
|
|
26
|
+
"video/mpeg",
|
|
27
|
+
"video/quicktime",
|
|
28
|
+
"video/x-msvideo",
|
|
29
|
+
"video/x-ms-wmv"
|
|
30
|
+
]
|
|
31
|
+
|
|
32
|
+
end
|
|
33
|
+
end
|
data/lib/alchemy/i18n.rb
CHANGED
|
@@ -31,7 +31,7 @@ module Alchemy
|
|
|
31
31
|
#
|
|
32
32
|
def self.t(msg, *args)
|
|
33
33
|
options = args.extract_options!
|
|
34
|
-
|
|
34
|
+
humanize_default_string!(msg, options)
|
|
35
35
|
scope = ['alchemy']
|
|
36
36
|
case options[:scope].class.name
|
|
37
37
|
when "Array"
|
|
@@ -52,5 +52,13 @@ module Alchemy
|
|
|
52
52
|
Dir.glob(File.join(File.dirname(__FILE__), '../../config/locales/alchemy.*.yml'))
|
|
53
53
|
end
|
|
54
54
|
|
|
55
|
+
private
|
|
56
|
+
|
|
57
|
+
def self.humanize_default_string!(msg, options)
|
|
58
|
+
if options[:default].blank?
|
|
59
|
+
options[:default] = msg.is_a?(Symbol) ? msg.to_s.humanize : msg
|
|
60
|
+
end
|
|
61
|
+
end
|
|
62
|
+
|
|
55
63
|
end
|
|
56
64
|
end
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# encoding: utf-8
|
|
2
|
+
|
|
3
|
+
module Alchemy
|
|
4
|
+
# Provides methods for converting names into urlnames and vice versa.
|
|
5
|
+
#
|
|
6
|
+
module NameConversions
|
|
7
|
+
|
|
8
|
+
# Converts a given name into url save and readable urlanme.
|
|
9
|
+
# Uses rails parameterize, but converts german umlauts before.
|
|
10
|
+
#
|
|
11
|
+
# @returns String
|
|
12
|
+
def convert_to_urlname(name)
|
|
13
|
+
name
|
|
14
|
+
.gsub(/[äÄ]/, 'ae')
|
|
15
|
+
.gsub(/[üÜ]/, 'ue')
|
|
16
|
+
.gsub(/[öÖ]/, 'oe')
|
|
17
|
+
.gsub(/[ß]/, 'ss')
|
|
18
|
+
.parameterize
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
# Converts a filename and suffix into a human readable name.
|
|
22
|
+
#
|
|
23
|
+
def convert_to_humanized_name(name, suffix)
|
|
24
|
+
name.gsub(/\.#{::Regexp.quote(suffix)}$/i, '').gsub(/_/, ' ').strip
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
end
|
|
28
|
+
end
|
data/lib/alchemy/page_layout.rb
CHANGED
|
@@ -54,13 +54,15 @@ module Alchemy
|
|
|
54
54
|
|
|
55
55
|
# Returns page layouts ready for Rails' select form helper.
|
|
56
56
|
def layouts_for_select(language_id, layoutpage = false)
|
|
57
|
-
map_layouts(selectable_layouts(language_id, layoutpage), [[I18n.t(
|
|
57
|
+
map_layouts(selectable_layouts(language_id, layoutpage), [[I18n.t('Please choose'), '']])
|
|
58
58
|
end
|
|
59
59
|
|
|
60
60
|
def layouts_with_own_for_select(own_layout, language_id, layoutpage)
|
|
61
61
|
layouts = selectable_layouts(language_id, layoutpage)
|
|
62
62
|
if layouts.detect { |l| l['name'] == own_layout } == nil
|
|
63
|
-
map_array = [
|
|
63
|
+
map_array = [
|
|
64
|
+
[I18n.t(own_layout, scope: 'page_layout_names', default: own_layout.to_s.humanize), own_layout]
|
|
65
|
+
]
|
|
64
66
|
else
|
|
65
67
|
map_array = []
|
|
66
68
|
end
|
|
@@ -71,7 +73,7 @@ module Alchemy
|
|
|
71
73
|
def map_layouts(layouts, map_array = [])
|
|
72
74
|
layouts.each do |layout|
|
|
73
75
|
map_array << [
|
|
74
|
-
I18n.t(layout['name'], :
|
|
76
|
+
I18n.t(layout['name'], scope: 'page_layout_names', default: layout['name'].to_s.humanize),
|
|
75
77
|
layout["name"]
|
|
76
78
|
]
|
|
77
79
|
end
|