locomotive_cms 2.0.3 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -0
- data/Gemfile +3 -3
- data/README.textile +7 -7
- data/app/assets/images/locomotive/icons/flags/ja.png +0 -0
- data/app/assets/javascripts/locomotive/aloha.js.coffee +3 -0
- data/app/assets/javascripts/locomotive/models/page.js.coffee +1 -1
- data/app/assets/javascripts/locomotive/models/site.js.coffee +16 -6
- data/app/assets/javascripts/locomotive/utils/aloha_settings.js.coffee +1 -1
- data/app/assets/javascripts/locomotive/views/content_entries/_form_view.js.coffee +5 -0
- data/app/assets/javascripts/locomotive/views/my_account/edit_view.js.coffee +14 -0
- data/app/assets/javascripts/locomotive/views/pages/_form_view.js.coffee +1 -1
- data/app/assets/javascripts/locomotive/views/pages/edit_view.js.coffee +2 -1
- data/app/assets/javascripts/tinymce/plugins/locomotive_media/langs/de.js +1 -0
- data/app/assets/stylesheets/locomotive.css +1 -0
- data/app/assets/stylesheets/locomotive/backoffice/formtastic_changes.css.scss +18 -3
- data/app/assets/stylesheets/locomotive/backoffice/layout.css.scss +1 -1
- data/app/assets/stylesheets/locomotive/backoffice/menu/main.css.scss +7 -3
- data/app/assets/stylesheets/locomotive/backoffice/pagination.css.scss +37 -0
- data/app/assets/stylesheets/locomotive/backoffice/tagit_changes.css.scss +49 -0
- data/app/cells/locomotive/content_locale_picker/show.html.haml +1 -1
- data/app/cells/locomotive/global_actions_cell.rb +8 -8
- data/app/cells/locomotive/main_menu/show.html.haml +2 -2
- data/app/cells/locomotive/main_menu_cell.rb +2 -2
- data/app/cells/locomotive/menu_cell.rb +6 -6
- data/app/cells/locomotive/partials_cell.rb +21 -0
- data/app/cells/locomotive/settings_menu_cell.rb +4 -4
- data/app/cells/locomotive/sub_menu/show.html.haml +2 -2
- data/app/cells/locomotive/sub_menu_cell.rb +1 -1
- data/app/controllers/locomotive/accounts_controller.rb +4 -4
- data/app/controllers/locomotive/api/accounts_controller.rb +1 -0
- data/app/controllers/locomotive/api/content_assets_controller.rb +1 -1
- data/app/controllers/locomotive/api/content_entries_controller.rb +1 -1
- data/app/controllers/locomotive/api/content_types_controller.rb +2 -2
- data/app/controllers/locomotive/api/pages_controller.rb +1 -1
- data/app/controllers/locomotive/api/snippets_controller.rb +1 -1
- data/app/controllers/locomotive/api/theme_assets_controller.rb +47 -0
- data/app/controllers/locomotive/api/tokens_controller.rb +2 -2
- data/app/controllers/locomotive/base_controller.rb +5 -2
- data/app/controllers/locomotive/content_assets_controller.rb +1 -1
- data/app/controllers/locomotive/content_entries_controller.rb +22 -9
- data/app/controllers/locomotive/content_types_controller.rb +6 -6
- data/app/controllers/locomotive/current_site_controller.rb +6 -6
- data/app/controllers/locomotive/installation_controller.rb +11 -3
- data/app/controllers/locomotive/memberships_controller.rb +6 -6
- data/app/controllers/locomotive/my_account_controller.rb +9 -3
- data/app/controllers/locomotive/pages_controller.rb +10 -6
- data/app/controllers/locomotive/passwords_controller.rb +1 -1
- data/app/controllers/locomotive/public/content_entries_controller.rb +1 -1
- data/app/controllers/locomotive/public/pages_controller.rb +5 -5
- data/app/controllers/locomotive/public/robots_controller.rb +1 -1
- data/app/controllers/locomotive/public/sitemaps_controller.rb +1 -1
- data/app/controllers/locomotive/sessions_controller.rb +1 -1
- data/app/controllers/locomotive/sites_controller.rb +5 -5
- data/app/controllers/locomotive/snippets_controller.rb +6 -6
- data/app/controllers/locomotive/theme_assets_controller.rb +6 -6
- data/app/controllers/locomotive/translations_controller.rb +1 -1
- data/app/helpers/locomotive/accounts_helper.rb +1 -1
- data/app/helpers/locomotive/base_helper.rb +13 -21
- data/app/helpers/locomotive/content_types_helper.rb +3 -3
- data/app/helpers/locomotive/custom_fields_helper.rb +5 -5
- data/app/helpers/locomotive/installation_helper.rb +1 -1
- data/app/helpers/locomotive/pages_helper.rb +5 -5
- data/app/helpers/locomotive/snippets_helper.rb +1 -1
- data/app/helpers/locomotive/theme_assets_helper.rb +1 -1
- data/app/helpers/locomotive/translations_helper.rb +2 -2
- data/app/inputs/locomotive/api_key_input.rb +40 -0
- data/app/inputs/locomotive/code_input.rb +5 -5
- data/app/inputs/locomotive/file_input.rb +6 -6
- data/app/inputs/locomotive/locale_input.rb +5 -5
- data/app/inputs/locomotive/locales_input.rb +4 -4
- data/app/inputs/locomotive/rte_input.rb +1 -1
- data/app/inputs/locomotive/small_code_input.rb +1 -1
- data/app/inputs/locomotive/subdomain_input.rb +1 -1
- data/app/mailers/locomotive/devise_mailer.rb +1 -1
- data/app/mailers/locomotive/notifications.rb +3 -3
- data/app/models/locomotive/ability.rb +10 -11
- data/app/models/locomotive/account.rb +61 -26
- data/app/models/locomotive/content_asset.rb +8 -8
- data/app/models/locomotive/content_entry.rb +8 -7
- data/app/models/locomotive/content_type.rb +12 -7
- data/app/models/locomotive/editable_control.rb +2 -2
- data/app/models/locomotive/editable_element.rb +13 -8
- data/app/models/locomotive/editable_file.rb +5 -3
- data/app/models/locomotive/editable_short_text.rb +3 -3
- data/app/models/locomotive/extensions/asset/types.rb +2 -2
- data/app/models/locomotive/extensions/content_entry/csv.rb +78 -0
- data/app/models/locomotive/extensions/content_type/item_template.rb +3 -3
- data/app/models/locomotive/extensions/content_type/sync.rb +4 -4
- data/app/models/locomotive/extensions/page/editable_elements.rb +1 -1
- data/app/models/locomotive/extensions/page/parse.rb +2 -2
- data/app/models/locomotive/extensions/page/render.rb +7 -1
- data/app/models/locomotive/extensions/page/templatized.rb +20 -15
- data/app/models/locomotive/extensions/page/tree.rb +4 -4
- data/app/models/locomotive/extensions/shared/seo.rb +3 -3
- data/app/models/locomotive/extensions/site/first_installation.rb +5 -2
- data/app/models/locomotive/extensions/site/locales.rb +9 -6
- data/app/models/locomotive/extensions/site/subdomain_domains.rb +8 -8
- data/app/models/locomotive/membership.rb +6 -6
- data/app/models/locomotive/page.rb +30 -23
- data/app/models/locomotive/site.rb +19 -15
- data/app/models/locomotive/snippet.rb +5 -5
- data/app/models/locomotive/theme_asset.rb +17 -6
- data/app/models/locomotive/translation.rb +21 -16
- data/app/presenters/locomotive/account_presenter.rb +1 -1
- data/app/presenters/locomotive/content_entry_presenter.rb +2 -2
- data/app/presenters/locomotive/content_field_presenter.rb +2 -2
- data/app/presenters/locomotive/content_type_presenter.rb +6 -1
- data/app/presenters/locomotive/theme_asset_presenter.rb +2 -2
- data/app/uploaders/locomotive/editable_file_uploader.rb +1 -1
- data/app/uploaders/locomotive/theme_asset_uploader.rb +1 -1
- data/app/views/locomotive/accounts/new.html.haml +6 -6
- data/app/views/locomotive/content_assets/_asset.html.haml +3 -3
- data/app/views/locomotive/content_assets/_picker.html.haml +12 -12
- data/app/views/locomotive/content_entries/_form.html.haml +9 -8
- data/app/views/locomotive/content_entries/_list.html.haml +8 -5
- data/app/views/locomotive/content_entries/edit.html.haml +6 -6
- data/app/views/locomotive/content_entries/index.html.haml +8 -6
- data/app/views/locomotive/content_entries/new.html.haml +5 -5
- data/app/views/locomotive/content_types/_form.html.haml +16 -16
- data/app/views/locomotive/content_types/edit.html.haml +5 -5
- data/app/views/locomotive/content_types/new.html.haml +3 -3
- data/app/views/locomotive/current_site/_form.html.haml +12 -12
- data/app/views/locomotive/current_site/edit.html.haml +5 -5
- data/app/views/locomotive/custom_fields/_form.html.haml +23 -19
- data/app/views/locomotive/custom_fields/_select_templates.html.haml +5 -5
- data/app/views/locomotive/custom_fields/types/_belongs_to.html.haml +4 -4
- data/app/views/locomotive/custom_fields/types/_boolean.html.haml +3 -3
- data/app/views/locomotive/custom_fields/types/_date.html.haml +4 -4
- data/app/views/locomotive/custom_fields/types/_email.html.haml +4 -0
- data/app/views/locomotive/custom_fields/types/_file.html.haml +3 -3
- data/app/views/locomotive/custom_fields/types/_float.html.haml +6 -0
- data/app/views/locomotive/custom_fields/types/_has_many.html.haml +10 -10
- data/app/views/locomotive/custom_fields/types/_integer.html.haml +5 -0
- data/app/views/locomotive/custom_fields/types/_many_to_many.html.haml +10 -10
- data/app/views/locomotive/custom_fields/types/_select.html.haml +10 -10
- data/app/views/locomotive/custom_fields/types/_string.html.haml +3 -3
- data/app/views/locomotive/custom_fields/types/_tags.html.haml +4 -0
- data/app/views/locomotive/custom_fields/types/_text.html.haml +4 -4
- data/app/views/locomotive/devise_mailer/reset_password_instructions.html.haml +1 -1
- data/app/views/locomotive/installation/step_1.html.haml +5 -5
- data/app/views/locomotive/installation/step_2.html.haml +6 -6
- data/app/views/locomotive/kaminari/_first_page.html.haml +2 -0
- data/app/views/locomotive/kaminari/_gap.html.haml +2 -0
- data/app/views/locomotive/kaminari/_last_page.html.haml +2 -0
- data/app/views/locomotive/kaminari/_next_page.html.haml +2 -0
- data/app/views/locomotive/kaminari/_page.html.haml +2 -0
- data/app/views/locomotive/kaminari/_paginator.html.haml +11 -0
- data/app/views/locomotive/kaminari/_prev_page.html.haml +2 -0
- data/app/views/locomotive/layouts/application.html.haml +2 -2
- data/app/views/locomotive/layouts/not_logged_in.html.haml +3 -3
- data/app/views/locomotive/memberships/new.html.haml +4 -4
- data/app/views/locomotive/my_account/edit.html.haml +14 -13
- data/app/views/locomotive/notifications/new_content_entry.html.haml +2 -2
- data/app/views/locomotive/pages/_editable_elements.html.haml +20 -20
- data/app/views/locomotive/pages/_form.html.haml +23 -27
- data/app/views/locomotive/pages/_page.html.haml +6 -6
- data/app/views/locomotive/pages/edit.html.haml +5 -5
- data/app/views/locomotive/pages/index.html.haml +2 -2
- data/app/views/locomotive/pages/new.html.haml +4 -4
- data/app/views/locomotive/passwords/edit.html.haml +3 -3
- data/app/views/locomotive/passwords/new.html.haml +2 -2
- data/app/views/locomotive/public/pages/show_toolbar.html.haml +15 -15
- data/app/views/locomotive/sessions/new.html.haml +4 -4
- data/app/views/locomotive/shared/_footer.html.haml +1 -1
- data/app/views/locomotive/shared/_head.html.haml +7 -7
- data/app/views/locomotive/shared/_header.html.haml +2 -2
- data/app/views/locomotive/shared/_locale_picker_link.html.haml +1 -1
- data/app/views/locomotive/shared/_site_picker.html.haml +2 -2
- data/app/views/locomotive/shared/actions/_contents.html.haml +1 -1
- data/app/views/locomotive/shared/menu/_contents.html.haml +5 -5
- data/app/views/locomotive/sites/_domains.html.haml +7 -7
- data/app/views/locomotive/sites/_form.html.haml +6 -1
- data/app/views/locomotive/sites/_memberships.html.haml +3 -3
- data/app/views/locomotive/sites/new.html.haml +3 -3
- data/app/views/locomotive/snippets/_form.html.haml +6 -6
- data/app/views/locomotive/snippets/_snippet.html.haml +2 -2
- data/app/views/locomotive/snippets/edit.html.haml +5 -5
- data/app/views/locomotive/snippets/new.html.haml +3 -3
- data/app/views/locomotive/theme_assets/_asset.html.haml +2 -2
- data/app/views/locomotive/theme_assets/_form.html.haml +10 -10
- data/app/views/locomotive/theme_assets/_list.html.haml +3 -3
- data/app/views/locomotive/theme_assets/_picker.html.haml +8 -8
- data/app/views/locomotive/theme_assets/edit.html.haml +7 -7
- data/app/views/locomotive/theme_assets/index.html.haml +6 -6
- data/app/views/locomotive/theme_assets/new.html.haml +3 -3
- data/app/views/locomotive/translations/_form.html.haml +3 -3
- data/app/views/locomotive/translations/edit.html.haml +6 -6
- data/app/views/locomotive/translations/index.html.haml +2 -0
- data/app/views/locomotive/translations/new.html.haml +2 -2
- data/config/initializers/csv_renderer.rb +10 -0
- data/config/locales/admin_ui.de.yml +1 -0
- data/config/locales/admin_ui.en.yml +12 -0
- data/config/locales/admin_ui.es.yml +1 -0
- data/config/locales/admin_ui.et.yml +1 -0
- data/config/locales/admin_ui.fr.yml +12 -0
- data/config/locales/admin_ui.it.yml +1 -0
- data/config/locales/admin_ui.ja.yml +335 -0
- data/config/locales/admin_ui.nb.yml +1 -0
- data/config/locales/admin_ui.nl.yml +1 -0
- data/config/locales/admin_ui.pl.yml +1 -0
- data/config/locales/admin_ui.pt-BR.yml +8 -0
- data/config/locales/admin_ui.ru.yml +1 -0
- data/config/locales/carrierwave.ja.yml +4 -0
- data/config/locales/default.de.yml +1 -1
- data/config/locales/default.en.yml +1 -1
- data/config/locales/default.es.yml +3 -0
- data/config/locales/default.et.yml +2 -2
- data/config/locales/default.fr.yml +1 -1
- data/config/locales/default.it.yml +3 -0
- data/config/locales/default.ja.yml +94 -0
- data/config/locales/default.nb.yml +1 -1
- data/config/locales/default.nl.yml +5 -0
- data/config/locales/default.pl.yml +2 -2
- data/config/locales/default.pt-BR.yml +3 -2
- data/config/locales/default.ru.yml +19 -16
- data/config/locales/devise.ja.yml +63 -0
- data/config/locales/flash.ja.yml +115 -0
- data/config/locales/formtastic.en.yml +7 -0
- data/config/locales/formtastic.fr.yml +9 -0
- data/config/locales/formtastic.ja.yml +103 -0
- data/config/locales/formtastic.pt-BR.yml +1 -1
- data/config/routes.rb +5 -2
- data/features/api/authentication.feature +24 -2
- data/features/api/authorization/pages.feature +3 -1
- data/features/api/entries_custom_fields.feature +2 -2
- data/features/backoffice/authorization/pages.feature +7 -7
- data/features/backoffice/content_types/email.feature +26 -0
- data/features/backoffice/content_types/has_many.feature +20 -0
- data/features/backoffice/content_types/integer.feature +26 -0
- data/features/backoffice/content_types/many_to_many.feature +29 -1
- data/features/backoffice/content_types/tags.feature +22 -0
- data/features/backoffice/content_types/uniqueness.feature +29 -0
- data/features/backoffice/contents.feature +16 -0
- data/features/backoffice/installation.feature +33 -0
- data/features/backoffice/my_account.feature +21 -0
- data/features/backoffice/pages.feature +21 -1
- data/features/backoffice/site.feature +59 -40
- data/features/backoffice/snippets.feature +1 -1
- data/features/backoffice/translations.feature +7 -1
- data/features/public/basic.feature +1 -1
- data/features/public/pages.feature +92 -0
- data/features/public/session.feature +40 -0
- data/features/public/tags.feature +45 -0
- data/features/step_definitions/backoffice_steps.rb +4 -0
- data/features/step_definitions/content_types_steps.rb +16 -3
- data/features/step_definitions/more_web_steps.rb +35 -4
- data/features/step_definitions/page_steps.rb +52 -35
- data/features/step_definitions/pagination_steps.rb +4 -4
- data/features/step_definitions/site_steps.rb +22 -10
- data/features/step_definitions/snippet_steps.rb +1 -1
- data/features/step_definitions/theme_asset_steps.rb +2 -2
- data/features/step_definitions/translation_steps.rb +1 -1
- data/features/step_definitions/web_steps.rb +1 -1
- data/features/support/http.rb +1 -1
- data/features/support/locales.rb +5 -0
- data/lib/generators/locomotive/install/install_generator.rb +1 -6
- data/lib/generators/locomotive/install/templates/carrierwave.rb +4 -4
- data/lib/generators/locomotive/install/templates/locomotive.rb +12 -7
- data/lib/locomotive.rb +4 -4
- data/lib/locomotive/action_controller.rb +1 -0
- data/lib/locomotive/action_controller/responder.rb +9 -10
- data/lib/locomotive/action_controller/section_helpers.rb +1 -1
- data/lib/locomotive/action_controller/ssl.rb +11 -0
- data/lib/locomotive/action_controller/url_helpers.rb +9 -5
- data/lib/locomotive/carrierwave/asset.rb +6 -6
- data/lib/locomotive/configuration.rb +28 -26
- data/lib/locomotive/core_ext.rb +1 -2
- data/lib/locomotive/custom_fields.rb +12 -6
- data/lib/locomotive/dependencies.rb +1 -0
- data/lib/locomotive/dragonfly.rb +1 -1
- data/lib/locomotive/engine.rb +3 -3
- data/lib/locomotive/formtastic.rb +1 -1
- data/lib/locomotive/httparty/webservice.rb +1 -1
- data/lib/locomotive/kaminari.rb +28 -13
- data/lib/locomotive/liquid.rb +1 -0
- data/lib/locomotive/liquid/drops/content_entry.rb +1 -1
- data/lib/locomotive/liquid/drops/content_types.rb +27 -2
- data/lib/locomotive/liquid/drops/page.rb +14 -2
- data/lib/locomotive/liquid/drops/proxy_collection.rb +4 -0
- data/lib/locomotive/liquid/drops/session_proxy.rb +16 -0
- data/lib/locomotive/liquid/drops/site.rb +11 -3
- data/lib/locomotive/liquid/drops/uploader.rb +1 -1
- data/lib/locomotive/liquid/filters/base.rb +1 -1
- data/lib/locomotive/liquid/filters/date.rb +2 -2
- data/lib/locomotive/liquid/filters/html.rb +12 -12
- data/lib/locomotive/liquid/filters/translate.rb +21 -3
- data/lib/locomotive/liquid/tags/consume.rb +50 -19
- data/lib/locomotive/liquid/tags/editable/base.rb +9 -9
- data/lib/locomotive/liquid/tags/editable/control.rb +1 -1
- data/lib/locomotive/liquid/tags/editable/file.rb +1 -1
- data/lib/locomotive/liquid/tags/editable/short_text.rb +1 -1
- data/lib/locomotive/liquid/tags/fetch_page.rb +28 -0
- data/lib/locomotive/liquid/tags/hybrid.rb +25 -0
- data/lib/locomotive/liquid/tags/inherited_block.rb +2 -2
- data/lib/locomotive/liquid/tags/inline_editor.rb +4 -4
- data/lib/locomotive/liquid/tags/javascript.rb +16 -0
- data/lib/locomotive/liquid/tags/link_to.rb +42 -0
- data/lib/locomotive/liquid/tags/locale_switcher.rb +1 -1
- data/lib/locomotive/liquid/tags/nav.rb +2 -2
- data/lib/locomotive/liquid/tags/paginate.rb +2 -2
- data/lib/locomotive/liquid/tags/session_assign.rb +39 -0
- data/lib/locomotive/liquid/tags/snippet.rb +1 -1
- data/lib/locomotive/liquid/tags/with_scope.rb +6 -2
- data/lib/locomotive/logger.rb +1 -1
- data/lib/locomotive/middlewares/cache.rb +1 -1
- data/lib/locomotive/middlewares/fonts.rb +1 -1
- data/lib/locomotive/middlewares/inline_editor.rb +1 -1
- data/lib/locomotive/middlewares/permalink.rb +1 -1
- data/lib/locomotive/middlewares/seo_trailing_slash.rb +1 -1
- data/lib/locomotive/mongoid/patches.rb +21 -21
- data/lib/locomotive/rails/action_view.rb +20 -4
- data/lib/locomotive/regexps.rb +1 -1
- data/lib/locomotive/render.rb +4 -2
- data/lib/locomotive/routing/default_constraint.rb +1 -1
- data/lib/locomotive/routing/site_dispatcher.rb +1 -1
- data/lib/locomotive/session_store.rb +7 -7
- data/lib/locomotive/version.rb +1 -1
- data/lib/tasks/development.rake +11 -9
- data/lib/tasks/locomotive.rake +11 -11
- data/mongodb/migrate/20130204072721_make_editable_elements_consistent.rb +3 -1
- data/mongodb/migrate/20130326201349_rename_entry_to_content_entry.rb +6 -6
- data/mongodb/migrate/20130511121956_generate_checksum_for_theme_assets.rb +14 -0
- data/mongodb/migrate/20130530162559_api_key_for_all_accounts.rb +10 -0
- data/spec/cells/locomotive/global_actions_spec.rb +11 -11
- data/spec/cells/locomotive/main_menu_cell_spec.rb +9 -9
- data/spec/cells/locomotive/settings_menu_cell_spec.rb +11 -11
- data/spec/dummy/config/environments/development.rb +1 -1
- data/spec/dummy/config/initializers/locomotive.rb +16 -11
- data/spec/dummy/config/mongoid.yml +99 -18
- data/spec/lib/action_view_spec.rb +19 -0
- data/spec/lib/core_ext_spec.rb +2 -2
- data/spec/lib/locomotive/configuration_spec.rb +1 -1
- data/spec/lib/locomotive/httparty/webservice_spec.rb +6 -6
- data/spec/lib/locomotive/liquid/drops/content_entry_spec.rb +1 -1
- data/spec/lib/locomotive/liquid/drops/current_user.rb +3 -3
- data/spec/lib/locomotive/liquid/drops/page_spec.rb +63 -14
- data/spec/lib/locomotive/liquid/drops/site_spec.rb +3 -3
- data/spec/lib/locomotive/liquid/filters/html_spec.rb +22 -7
- data/spec/lib/locomotive/liquid/filters/resize_spec.rb +3 -3
- data/spec/lib/locomotive/liquid/filters/translate_spec.rb +26 -12
- data/spec/lib/locomotive/liquid/tags/consume_spec.rb +26 -2
- data/spec/lib/locomotive/liquid/tags/csrf_spec.rb +3 -3
- data/spec/lib/locomotive/liquid/tags/editable/short_text_spec.rb +1 -1
- data/spec/lib/locomotive/liquid/tags/extends_spec.rb +5 -5
- data/spec/lib/locomotive/liquid/tags/javascript_spec.rb +18 -0
- data/spec/lib/locomotive/liquid/tags/locale_switcher_spec.rb +23 -13
- data/spec/lib/locomotive/liquid/tags/nav_spec.rb +11 -11
- data/spec/lib/locomotive/liquid/tags/paginate_spec.rb +13 -13
- data/spec/lib/locomotive/liquid/tags/seo_spec.rb +8 -8
- data/spec/lib/locomotive/liquid/tags/with_scope_spec.rb +8 -2
- data/spec/lib/locomotive/presentable_spec.rb +10 -10
- data/spec/lib/locomotive/render_spec.rb +14 -14
- data/spec/mailers/locomotive/notifications_spec.rb +3 -3
- data/spec/models/locomotive/ability_spec.rb +23 -9
- data/spec/models/locomotive/account_spec.rb +30 -8
- data/spec/models/locomotive/content_asset_spec.rb +1 -1
- data/spec/models/locomotive/content_entry_spec.rb +57 -2
- data/spec/models/locomotive/content_type_spec.rb +42 -41
- data/spec/models/locomotive/editable_control_spec.rb +5 -5
- data/spec/models/locomotive/editable_file_spec.rb +21 -5
- data/spec/models/locomotive/editable_long_text_spec.rb +3 -3
- data/spec/models/locomotive/editable_short_text_spec.rb +8 -8
- data/spec/models/locomotive/extensions/page/editable_elements_spec.rb +9 -9
- data/spec/models/locomotive/extensions/page/redirect_spec.rb +1 -1
- data/spec/models/locomotive/extensions/page/render_spec.rb +4 -8
- data/spec/models/locomotive/extensions/site/locales_spec.rb +2 -2
- data/spec/models/locomotive/membership_spec.rb +5 -5
- data/spec/models/locomotive/page_spec.rb +10 -1
- data/spec/models/locomotive/site_spec.rb +19 -19
- data/spec/models/locomotive/snippet_spec.rb +9 -9
- data/spec/models/locomotive/theme_asset_spec.rb +91 -57
- data/spec/requests/admin_ssl_spec.rb +25 -0
- data/spec/support/factories.rb +32 -27
- data/spec/support/locomotive.rb +2 -0
- data/vendor/assets/javascripts/locomotive/backbone.sync.js +1 -1
- data/vendor/assets/javascripts/locomotive/tag-it.min.js +16 -0
- data/vendor/assets/stylesheets/locomotive/jquery.tagit.css +67 -0
- metadata +108 -138
@@ -24,7 +24,7 @@ end
|
|
24
24
|
|
25
25
|
Given /^a javascript asset named "([^"]*)" with id "([^"]*)"$/ do |name, id|
|
26
26
|
@asset = new_plain_text_asset(name, 'javascript')
|
27
|
-
@asset.id = BSON::ObjectId(id)
|
27
|
+
@asset.id = Moped::BSON::ObjectId(id)
|
28
28
|
@asset.save!
|
29
29
|
end
|
30
30
|
|
@@ -34,7 +34,7 @@ end
|
|
34
34
|
|
35
35
|
Given /^a stylesheet asset named "([^"]*)" with id "([^"]*)"$/ do |name, id|
|
36
36
|
@asset = new_plain_text_asset(name, 'stylesheet')
|
37
|
-
@asset.id = BSON::ObjectId(id)
|
37
|
+
@asset.id = Moped::BSON::ObjectId(id)
|
38
38
|
@asset.save!
|
39
39
|
end
|
40
40
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Given /^a translation with key "(.*?)" and id "(.*?)" with values:$/ do |key, id, table|
|
2
2
|
translation = @site.translations.build
|
3
|
-
translation.id = BSON::ObjectId(id)
|
3
|
+
translation.id = Moped::BSON::ObjectId(id)
|
4
4
|
translation.key = key
|
5
5
|
translation.values = table.raw.inject({}) { |memo,values| memo.merge(values.first => values.last) }
|
6
6
|
translation.save!
|
data/features/support/http.rb
CHANGED
@@ -8,7 +8,7 @@ module HTTPHelpers
|
|
8
8
|
|
9
9
|
def do_request(type, base_url, url, params)
|
10
10
|
request_method = type.downcase.to_sym
|
11
|
-
send(request_method,
|
11
|
+
send(request_method, URI.join(base_url, url).to_s, default_params.merge(params))
|
12
12
|
end
|
13
13
|
|
14
14
|
protected
|
@@ -16,15 +16,10 @@ module Locomotive
|
|
16
16
|
|
17
17
|
template 'mongoid.yml', 'config/mongoid.yml'
|
18
18
|
end
|
19
|
-
|
20
|
-
def copy_migrations
|
21
|
-
rake("db:mongoid:migration:install")
|
22
|
-
rake("db:mongoid:migrate")
|
23
|
-
end
|
24
19
|
|
25
20
|
def insert_engine_routes
|
26
21
|
route %(
|
27
|
-
mount Locomotive::Engine => '/locomotive', :
|
22
|
+
mount Locomotive::Engine => '/locomotive', as: 'locomotive' # you can change the value of the path, by default set to "/locomotive"
|
28
23
|
)
|
29
24
|
end
|
30
25
|
|
@@ -12,10 +12,10 @@ CarrierWave.configure do |config|
|
|
12
12
|
# the following configuration works for Amazon S3
|
13
13
|
config.storage = :fog
|
14
14
|
config.fog_credentials = {
|
15
|
-
:
|
16
|
-
:
|
17
|
-
:
|
18
|
-
:
|
15
|
+
provider: 'AWS',
|
16
|
+
aws_access_key_id: ENV['S3_KEY_ID'],
|
17
|
+
aws_secret_access_key: ENV['S3_SECRET_KEY'],
|
18
|
+
region: ENV['S3_BUCKET_REGION']
|
19
19
|
}
|
20
20
|
config.fog_directory = ENV['S3_BUCKET']
|
21
21
|
|
@@ -18,19 +18,24 @@ Locomotive.configure do |config|
|
|
18
18
|
|
19
19
|
# configure how many items we display in sub menu in the "Contents" section.
|
20
20
|
# config.ui = {
|
21
|
-
# :
|
22
|
-
# :
|
21
|
+
# latest_entries_nb: 5,
|
22
|
+
# max_content_types: 4,
|
23
|
+
# per_page: 10
|
23
24
|
# }
|
24
25
|
|
25
|
-
# default locale (for now, only en, de, fr, pl, pt-BR, it and
|
26
|
+
# default locale (for now, only en, de, fr, pl, pt-BR, it, nb and ja are supported)
|
26
27
|
config.default_locale = :en
|
27
28
|
|
28
29
|
# available locales suggested to "localize" a site. You will have to pick up at least one among that list.
|
29
|
-
# config.site_locales = %w{en de fr pl pt-BR it nl nb es ru}
|
30
|
+
# config.site_locales = %w{en de fr pl pt-BR it nl nb es ru ja}
|
30
31
|
|
31
32
|
# tell if logs are enabled. Useful for debug purpose.
|
32
33
|
config.enable_logs = true
|
33
34
|
|
35
|
+
# Uncomment this line to force LocomotiveCMS to redirect all requests in the
|
36
|
+
# back-office to https in production.
|
37
|
+
# config.enable_admin_ssl = Rails.env.production?
|
38
|
+
|
34
39
|
# configure the e-mail address which will be shown in the DeviseMailer, NotificationMailer, ...etc
|
35
40
|
# if you do not put the domain name in the email, LocomotiveCMS will take the default domain name depending
|
36
41
|
# on your deployment target (server, Heroku, Bushido, ...etc)
|
@@ -57,9 +62,9 @@ Locomotive.configure do |config|
|
|
57
62
|
|
58
63
|
# Rack-cache settings, mainly used for the inline resizing image module. Default options:
|
59
64
|
# config.rack_cache = {
|
60
|
-
# :
|
61
|
-
# :
|
62
|
-
# :
|
65
|
+
# verbose: true,
|
66
|
+
# metastore: URI.encode("file:#{Rails.root}/tmp/dragonfly/cache/meta"), # URI encoded in case of spaces
|
67
|
+
# entitystore: URI.encode("file:#{Rails.root}/tmp/dragonfly/cache/body")
|
63
68
|
# }
|
64
69
|
# If you do want to disable it for good, just use the following syntax
|
65
70
|
# config.rack_cache = false
|
data/lib/locomotive.rb
CHANGED
@@ -54,8 +54,8 @@ module Locomotive
|
|
54
54
|
|
55
55
|
# cookies stored in mongodb (mongoid_store)
|
56
56
|
Rails.application.config.session_store :mongoid_store, {
|
57
|
-
:
|
58
|
-
:
|
57
|
+
key: self.config.cookie_key,
|
58
|
+
domain: :all
|
59
59
|
}
|
60
60
|
|
61
61
|
# add middlewares (dragonfly, font, seo, ...etc)
|
@@ -87,7 +87,7 @@ module Locomotive
|
|
87
87
|
self.app_middleware.insert_before 'Dragonfly::Middleware', '::Locomotive::Middlewares::Cache', self.config.rack_cache
|
88
88
|
end
|
89
89
|
|
90
|
-
self.app_middleware.insert_after 'Dragonfly::Middleware', '::Locomotive::Middlewares::Fonts', :
|
90
|
+
self.app_middleware.insert_after 'Dragonfly::Middleware', '::Locomotive::Middlewares::Fonts', path: %r{^/fonts}
|
91
91
|
|
92
92
|
self.app_middleware.use '::Locomotive::Middlewares::SeoTrailingSlash'
|
93
93
|
|
@@ -143,4 +143,4 @@ module Locomotive
|
|
143
143
|
Rails.application.middleware
|
144
144
|
end
|
145
145
|
|
146
|
-
end
|
146
|
+
end
|
@@ -1,5 +1,6 @@
|
|
1
1
|
require 'locomotive/action_controller/locale_helpers'
|
2
2
|
require 'locomotive/action_controller/section_helpers'
|
3
3
|
require 'locomotive/action_controller/url_helpers'
|
4
|
+
require 'locomotive/action_controller/ssl'
|
4
5
|
require 'locomotive/action_controller/responder'
|
5
6
|
require 'locomotive/action_controller/public_responder'
|
@@ -15,9 +15,9 @@ module Locomotive
|
|
15
15
|
ability = current_site.nil? || current_account.nil? ? nil : self.controller.send(:current_ability)
|
16
16
|
|
17
17
|
super.merge({
|
18
|
-
:
|
19
|
-
:
|
20
|
-
:
|
18
|
+
current_site: current_site,
|
19
|
+
current_account: current_account,
|
20
|
+
ability: ability
|
21
21
|
})
|
22
22
|
end
|
23
23
|
|
@@ -26,23 +26,23 @@ module Locomotive
|
|
26
26
|
display resource
|
27
27
|
elsif has_errors?
|
28
28
|
with_flash_message(:alert) do
|
29
|
-
display resource.errors, :
|
29
|
+
display resource.errors, status: :unprocessable_entity
|
30
30
|
end
|
31
31
|
elsif post?
|
32
32
|
in_header = controller.request.headers['X-Flash'] == 'true'
|
33
33
|
with_flash_message(:notice, in_header) do
|
34
|
-
display resource, :
|
34
|
+
display resource, location: api_location
|
35
35
|
end
|
36
36
|
elsif put?
|
37
37
|
with_flash_message do |message|
|
38
|
-
display resource, :
|
38
|
+
display resource, status: :ok, location: api_location
|
39
39
|
end
|
40
40
|
elsif delete?
|
41
41
|
with_flash_message do |message|
|
42
|
-
display resource, :
|
42
|
+
display resource, status: :ok, location: api_location
|
43
43
|
end
|
44
44
|
elsif has_empty_resource_definition?
|
45
|
-
display empty_resource, :
|
45
|
+
display empty_resource, status: :ok
|
46
46
|
else
|
47
47
|
with_flash_message do
|
48
48
|
head :ok
|
@@ -55,10 +55,9 @@ module Locomotive
|
|
55
55
|
def with_flash_message(type = :notice, in_header = true)
|
56
56
|
if in_header
|
57
57
|
set_flash_message!
|
58
|
-
message = controller.flash[type]
|
58
|
+
message = URI::escape(controller.flash[type].to_str) if controller.flash[type]
|
59
59
|
|
60
60
|
unless message.blank?
|
61
|
-
# controller.headers['X-Message'] = message
|
62
61
|
controller.headers['X-Message'] = ActiveSupport::JSON::Encoding.escape(message)
|
63
62
|
controller.headers['X-Message-Type'] = type.to_s
|
64
63
|
end
|
@@ -17,7 +17,7 @@ module Locomotive
|
|
17
17
|
def sections(main, sub = nil)
|
18
18
|
before_filter do |c|
|
19
19
|
sub = sub.call(c) if sub.respond_to?(:call)
|
20
|
-
sections = { :
|
20
|
+
sections = { main: main, sub: sub }
|
21
21
|
c.instance_variable_set(:@locomotive_sections, sections)
|
22
22
|
end
|
23
23
|
end
|
@@ -13,7 +13,7 @@ module Locomotive
|
|
13
13
|
end
|
14
14
|
|
15
15
|
def switch_to_site_url(site, options = {})
|
16
|
-
options = { :
|
16
|
+
options = { fullpath: true, protocol: true }.merge(options)
|
17
17
|
|
18
18
|
url = "#{site.subdomain}.#{Locomotive.config.domain}"
|
19
19
|
url += ":#{request.port}" if request.port != 80
|
@@ -24,12 +24,16 @@ module Locomotive
|
|
24
24
|
end
|
25
25
|
|
26
26
|
def public_page_url(page, options = {})
|
27
|
-
# Rails.logger.debug "[public_page_url] =====> #{page.attributes.inspect} / #{page.fullpath.inspect}\n\n"
|
27
|
+
# Rails.logger.debug "[public_page_url] =====> #{page.attributes.inspect} / #{page.fullpath.inspect} / #{current_site_public_url}\n\n"
|
28
|
+
|
29
|
+
locale = options[:locale]
|
30
|
+
fullpath = current_site.localized_page_fullpath(page, locale)
|
31
|
+
|
28
32
|
if content = options.delete(:content)
|
29
|
-
File.join(
|
30
|
-
else
|
31
|
-
File.join(current_site_public_url, page.fullpath)
|
33
|
+
fullpath = File.join(fullpath.gsub('content_type_template', ''), content._slug)
|
32
34
|
end
|
35
|
+
|
36
|
+
File.join(current_site_public_url, fullpath)
|
33
37
|
end
|
34
38
|
|
35
39
|
end
|
@@ -20,12 +20,12 @@ module Locomotive
|
|
20
20
|
|
21
21
|
def content_types
|
22
22
|
{
|
23
|
-
:
|
24
|
-
:
|
25
|
-
:
|
26
|
-
:
|
27
|
-
:
|
28
|
-
:
|
23
|
+
image: ['image/jpeg', 'image/pjpeg', 'image/gif', 'image/png', 'image/x-png', 'image/jpg', 'image/x-icon'],
|
24
|
+
media: [/^video/, 'application/x-shockwave-flash', 'application/x-flash-video', 'application/x-swf', /^audio/, 'application/ogg', 'application/x-mp3'],
|
25
|
+
pdf: ['application/pdf', 'application/x-pdf'],
|
26
|
+
stylesheet: ['text/css'],
|
27
|
+
javascript: ['text/javascript', 'text/js', 'application/x-javascript', 'application/javascript', 'text/x-component'],
|
28
|
+
font: [/^application\/.*font/, 'application/x-font-ttf', 'application/vnd.ms-fontobject', 'image/svg+xml', 'application/x-woff', 'application/x-font-truetype', 'application/x-font-woff']
|
29
29
|
}
|
30
30
|
end
|
31
31
|
|
@@ -2,33 +2,35 @@ module Locomotive
|
|
2
2
|
class Configuration
|
3
3
|
|
4
4
|
@@defaults = {
|
5
|
-
:
|
6
|
-
:
|
7
|
-
:
|
8
|
-
# :
|
9
|
-
:
|
10
|
-
:
|
11
|
-
:
|
12
|
-
:
|
13
|
-
:
|
14
|
-
:
|
15
|
-
:
|
16
|
-
:
|
17
|
-
:
|
18
|
-
:
|
19
|
-
:
|
20
|
-
|
21
|
-
:
|
5
|
+
name: 'LocomotiveApp',
|
6
|
+
domain: 'example.com',
|
7
|
+
reserved_subdomains: %w{www admin email blog webmail mail support help site sites},
|
8
|
+
# forbidden_paths: %w{layouts snippets stylesheets javascripts assets admin system api},
|
9
|
+
reserved_slugs: %w{stylesheets javascripts assets admin locomotive images api pages edit},
|
10
|
+
locales: %w{en de fr pl pt-BR it nl nb es ru et ja},
|
11
|
+
site_locales: %w{en de fr pl pt-BR it nl nb es ru et ja},
|
12
|
+
cookie_key: '_locomotive_session',
|
13
|
+
enable_logs: false,
|
14
|
+
enable_admin_ssl: false,
|
15
|
+
delayed_job: false,
|
16
|
+
default_locale: :en,
|
17
|
+
mailer_sender: 'support@example.com',
|
18
|
+
manage_subdomain: false,
|
19
|
+
manage_manage_domains: false,
|
20
|
+
ui: {
|
21
|
+
latest_entries_nb: 5,
|
22
|
+
max_content_types: 2,
|
23
|
+
per_page: 10
|
22
24
|
},
|
23
|
-
:
|
24
|
-
:
|
25
|
-
:
|
26
|
-
:
|
25
|
+
rack_cache: {
|
26
|
+
verbose: true,
|
27
|
+
metastore: URI.encode("file:#{Rails.root}/tmp/dragonfly/cache/meta"), # URI encoded in case of spaces
|
28
|
+
entitystore: URI.encode("file:#{Rails.root}/tmp/dragonfly/cache/body")
|
27
29
|
},
|
28
|
-
:
|
29
|
-
:
|
30
|
-
:
|
31
|
-
:
|
30
|
+
devise_modules: [:rememberable, :database_authenticatable, :token_authenticatable, :recoverable, :trackable, :validatable, :encryptable, { encryptor: :sha1 }],
|
31
|
+
context_assign_extensions: { },
|
32
|
+
models_for_templatization: [],
|
33
|
+
csrf_protection: false
|
32
34
|
}
|
33
35
|
|
34
36
|
cattr_accessor :settings
|
@@ -123,4 +125,4 @@ module Locomotive
|
|
123
125
|
end
|
124
126
|
end
|
125
127
|
end
|
126
|
-
end
|
128
|
+
end
|
data/lib/locomotive/core_ext.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Custom options for CustomFields
|
2
2
|
CustomFields.options = {
|
3
|
-
:
|
3
|
+
reserved_names: Mongoid.destructive_fields + %w(created_at updated_at)
|
4
4
|
}
|
5
5
|
|
6
6
|
module CustomFields
|
@@ -9,7 +9,7 @@ module CustomFields
|
|
9
9
|
|
10
10
|
include Locomotive::Mongoid::Presenter
|
11
11
|
|
12
|
-
field :ui_enabled, :
|
12
|
+
field :ui_enabled, type: Boolean, default: true
|
13
13
|
|
14
14
|
def class_name_to_content_type
|
15
15
|
self._parent.send :class_name_to_content_type, self.class_name
|
@@ -45,12 +45,19 @@ module CustomFields
|
|
45
45
|
# we need to know the url of the file without breaking the upload process.
|
46
46
|
# Actually, the uploaded file will be written on the filesystem after the email is sent.
|
47
47
|
#
|
48
|
+
# @param [ String ] host Required to build the full url in the Filesystem is used (optional)
|
49
|
+
#
|
48
50
|
# @return [ String ] The url to the soon uploaded file
|
49
51
|
#
|
50
|
-
def guess_url
|
52
|
+
def guess_url(host = nil)
|
51
53
|
this = self.class.new(model, mounted_as)
|
52
54
|
this.retrieve_from_store!(model.read_uploader(mounted_as))
|
53
|
-
|
55
|
+
|
56
|
+
if this.url =~ /^http/ || host.blank?
|
57
|
+
this.url
|
58
|
+
else
|
59
|
+
URI.join("http://#{host}", this.url).to_s
|
60
|
+
end
|
54
61
|
end
|
55
62
|
|
56
63
|
def cache_dir
|
@@ -62,5 +69,4 @@ module CustomFields
|
|
62
69
|
end
|
63
70
|
|
64
71
|
end
|
65
|
-
end
|
66
|
-
|
72
|
+
end
|
data/lib/locomotive/dragonfly.rb
CHANGED
data/lib/locomotive/engine.rb
CHANGED
@@ -16,14 +16,14 @@ module Locomotive
|
|
16
16
|
end
|
17
17
|
|
18
18
|
initializer 'locomotive.action_controller' do |app|
|
19
|
-
::ActionController::Base.wrap_parameters :
|
19
|
+
::ActionController::Base.wrap_parameters format: [:json]
|
20
20
|
end
|
21
21
|
|
22
22
|
initializer 'locomotive.devise' do |app|
|
23
23
|
::DeviseController.respond_to :html, :json
|
24
24
|
end
|
25
25
|
|
26
|
-
initializer "locomotive.precompile.hook", :
|
26
|
+
initializer "locomotive.precompile.hook", group: :all do |app|
|
27
27
|
app.config.assets.precompile += %w(
|
28
28
|
locomotive.js
|
29
29
|
locomotive.css
|
@@ -50,4 +50,4 @@ module Locomotive
|
|
50
50
|
end
|
51
51
|
|
52
52
|
end
|
53
|
-
end
|
53
|
+
end
|