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
@@ -0,0 +1,40 @@
|
|
1
|
+
Feature: Session
|
2
|
+
As a designer
|
3
|
+
I want to record objects in the session and reach them later
|
4
|
+
|
5
|
+
Background:
|
6
|
+
Given I have the site: "test site" set up
|
7
|
+
And a page named "store" with the template:
|
8
|
+
"""
|
9
|
+
Store a string in the session. {% session_assign foo = 'monkey' %}
|
10
|
+
"""
|
11
|
+
And a page named "retrieve" with the template:
|
12
|
+
"""
|
13
|
+
Retrieve a string from the session: {{ session.foo }}.
|
14
|
+
"""
|
15
|
+
And a page named "release" with the template:
|
16
|
+
"""
|
17
|
+
Remove a string from the session. {% session_assign foo = null %}
|
18
|
+
"""
|
19
|
+
|
20
|
+
Scenario: Store and retrieve a string in session
|
21
|
+
When I view the rendered page at "/retrieve"
|
22
|
+
Then the rendered output should look like:
|
23
|
+
"""
|
24
|
+
Retrieve a string from the session: .
|
25
|
+
"""
|
26
|
+
When I view the rendered page at "/store"
|
27
|
+
And I view the rendered page at "/retrieve"
|
28
|
+
Then the rendered output should look like:
|
29
|
+
"""
|
30
|
+
Retrieve a string from the session: monkey.
|
31
|
+
"""
|
32
|
+
|
33
|
+
Scenario: Remove a object from the session
|
34
|
+
When I view the rendered page at "/store"
|
35
|
+
And I view the rendered page at "/release"
|
36
|
+
And I view the rendered page at "/retrieve"
|
37
|
+
Then the rendered output should look like:
|
38
|
+
"""
|
39
|
+
Retrieve a string from the session: .
|
40
|
+
"""
|
@@ -0,0 +1,45 @@
|
|
1
|
+
Feature: Tagged content
|
2
|
+
As a designer
|
3
|
+
In order to organize my content
|
4
|
+
I want to be able to tag it
|
5
|
+
|
6
|
+
Background:
|
7
|
+
Given I have the site: "test site" set up
|
8
|
+
And I have a custom model named "Posts" with
|
9
|
+
| label | type | required |
|
10
|
+
| Title | string | true |
|
11
|
+
| Body | string | false |
|
12
|
+
| Tags | tags | false |
|
13
|
+
And I have entries for "Posts" with
|
14
|
+
| title | body | tags |
|
15
|
+
| Fashion post | Fashion body | blogging, fashion |
|
16
|
+
| Diet post | Diet body | blogging, diet |
|
17
|
+
|
18
|
+
Scenario: Navigate by tags
|
19
|
+
Given a page named "my-posts" with the template:
|
20
|
+
"""
|
21
|
+
{% if params.tag %}
|
22
|
+
{% with_scope tags: params.tag %}
|
23
|
+
{% assign posts = contents.posts.all %}
|
24
|
+
{% endwith_scope %}
|
25
|
+
{% else %}
|
26
|
+
{% assign posts = contents.posts.all %}
|
27
|
+
{% endif %}
|
28
|
+
|
29
|
+
{% for post in posts %}
|
30
|
+
{{ post.title }}<br>
|
31
|
+
{% for tag in post.tags %}
|
32
|
+
<a href="/my-posts?tag={{ tag }}">{{ tag }}</a>
|
33
|
+
{% endfor %}
|
34
|
+
<hr>
|
35
|
+
{% endfor %}
|
36
|
+
"""
|
37
|
+
When I view the rendered page at "/my-posts"
|
38
|
+
Then I should see "Fashion post"
|
39
|
+
And I should see "Diet post"
|
40
|
+
When I follow "blogging"
|
41
|
+
Then I should see "Fashion post"
|
42
|
+
And I should see "Diet post"
|
43
|
+
When I follow "fashion"
|
44
|
+
Then I should see "Fashion"
|
45
|
+
And I should not see "Diet"
|
@@ -19,7 +19,7 @@ end
|
|
19
19
|
|
20
20
|
Given %r{^I have a custom model named "([^"]*)" with id "([^"]*)" and$} do |name, id, fields|
|
21
21
|
content_type = build_content_type(name)
|
22
|
-
content_type.id = BSON::ObjectId(id)
|
22
|
+
content_type.id = Moped::BSON::ObjectId(id)
|
23
23
|
set_custom_fields_from_table(content_type, fields)
|
24
24
|
content_type.valid?
|
25
25
|
content_type.save.should be_true
|
@@ -55,12 +55,25 @@ end
|
|
55
55
|
|
56
56
|
Given %r{^I have entries for "([^"]*)" with$} do |name, entries|
|
57
57
|
content_type = Locomotive::ContentType.where(name: name).first
|
58
|
-
entries.hashes.each do |
|
59
|
-
|
58
|
+
entries.hashes.each do |attributes|
|
59
|
+
entry_id = attributes.delete('id')
|
60
|
+
entry = content_type.entries.build(attributes)
|
61
|
+
entry.id = entry_id if entry_id
|
62
|
+
entry.save!
|
60
63
|
end
|
61
64
|
content_type.save.should be_true
|
62
65
|
end
|
63
66
|
|
67
|
+
#the "client" "Alpha, Inc" has "Fun project" as one of its "projects"
|
68
|
+
Given(/^the "(.*?)" "(.*?)" has "(.*?)" as one of its "(.*?)"$/) do |source, source_label, target_label, target|
|
69
|
+
source_model = Locomotive::ContentType.where(name: source.classify.pluralize).first
|
70
|
+
source_entry = source_model.entries.where(source_model.label_field_name => source_label).first
|
71
|
+
target_model = Locomotive::ContentType.where(name: target.classify.pluralize).first
|
72
|
+
target_entry = target_model.entries.where(target_model.label_field_name => target_label).first
|
73
|
+
|
74
|
+
source_entry.send("#{target}").send("<<", target_entry)
|
75
|
+
end
|
76
|
+
|
64
77
|
When(/^I choose "(.*?)" in the list$/) do |name|
|
65
78
|
within('#content') do
|
66
79
|
click_link(name)
|
@@ -2,22 +2,34 @@ When /^I follow image link "([^"]*)"$/ do |img_alt|
|
|
2
2
|
find(:xpath, "//img[@alt = '#{img_alt}']/parent::a").click()
|
3
3
|
end
|
4
4
|
|
5
|
+
When /^I click on the "([^"]*)" folder$/ do |name|
|
6
|
+
find('fieldset.foldable legend span', text: name).click
|
7
|
+
end
|
8
|
+
|
5
9
|
Then /^I should get a download with the filename "([^\"]*)"$/ do |filename|
|
6
|
-
page.response_headers['Content-Disposition'].should include("filename
|
10
|
+
page.response_headers['Content-Disposition'].should include("filename=#{filename}")
|
7
11
|
end
|
8
12
|
|
9
13
|
When /^I wait until "([^"]*)" is visible$/ do |selector|
|
10
|
-
page.has_css?("#{selector}", :
|
14
|
+
page.has_css?("#{selector}", visible: true)
|
11
15
|
end
|
12
16
|
|
13
17
|
When /^I wait until ([^"]*) is visible$/ do |locator|
|
14
|
-
page.has_css?(selector_for(locator), :
|
18
|
+
page.has_css?(selector_for(locator), visible: true)
|
15
19
|
end
|
16
20
|
|
17
21
|
When /^I sync my form with my backbone model because of Firefox$/ do
|
18
22
|
page.execute_script("$(':input').trigger('change')")
|
19
23
|
end
|
20
24
|
|
25
|
+
When /^I fill in "(.*?)" with the tags "(.*?)"$/ do |field, tags|
|
26
|
+
input = field_labeled(field)
|
27
|
+
tags.split(',').each do |tag|
|
28
|
+
_tag = tag.strip
|
29
|
+
page.execute_script("$('input[name=\"#{input[:name]}\"]').tagit('createTag', '#{_tag}')")
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
21
33
|
Then /^"([^"]*)" should not be visible$/ do |text|
|
22
34
|
begin
|
23
35
|
assert page.find(text).visible? != true
|
@@ -48,6 +60,17 @@ When /^I reload the page$/ do
|
|
48
60
|
visit current_path
|
49
61
|
end
|
50
62
|
|
63
|
+
When(/^I switch the locale to "(.*?)"$/) do |locale|
|
64
|
+
click_on 'content-locale-picker-link'
|
65
|
+
within '#content-locale-picker' do
|
66
|
+
find("[data-locale='#{locale}']").click
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
Then(/^I should see a "(.*?)" link to "(.*?)"$/) do |text, path|
|
71
|
+
page.should have_link(text, href: path)
|
72
|
+
end
|
73
|
+
|
51
74
|
Given /^I enable the CSRF protection for public submission requests$/ do
|
52
75
|
Locomotive.config.csrf_protection = true
|
53
76
|
Locomotive::Public::ContentEntriesController.any_instance.stubs(:protect_against_forgery?).returns(true)
|
@@ -67,12 +90,16 @@ Then /^it returns a (\d+) error page$/ do |code|
|
|
67
90
|
end
|
68
91
|
|
69
92
|
Then /^I should see the following xml output:$/ do |xml_output|
|
70
|
-
xml_output.gsub!(':now',
|
93
|
+
xml_output.gsub!(':now', Time.now.utc.to_date.to_s)
|
71
94
|
response = Hash.from_xml(page.source)
|
72
95
|
expected = Hash.from_xml(xml_output)
|
73
96
|
expected.diff(response).should == {}
|
74
97
|
end
|
75
98
|
|
99
|
+
When /^I take a screenshot$/ do
|
100
|
+
page.save_screenshot('/Users/didier/Desktop/cucumber.png', full: true)
|
101
|
+
end
|
102
|
+
|
76
103
|
def wait_for_ajax(&block)
|
77
104
|
start_time = Time.now
|
78
105
|
while Time.now < start_time + Capybara.default_wait_time
|
@@ -94,3 +121,7 @@ Then /^after the AJAX finishes, (.*)$/ do |*args|
|
|
94
121
|
step(step_str, step_arg)
|
95
122
|
end
|
96
123
|
end
|
124
|
+
|
125
|
+
When(/^I wait (\d+)ms$/) do |delay|
|
126
|
+
sleep(delay.to_i / 1000.0)
|
127
|
+
end
|
@@ -1,44 +1,61 @@
|
|
1
1
|
### Pages
|
2
2
|
|
3
|
-
# helps create a simple content page (parent: "index") with a slug
|
4
|
-
def create_content_page(
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
page
|
3
|
+
# helps create a simple content page (parent: "index") with a slug and template
|
4
|
+
def create_content_page(slug, template = nil)
|
5
|
+
new_content_page(slug, template).tap do |page|
|
6
|
+
page.save!.should be_true
|
7
|
+
end
|
8
|
+
# page = new_content_page(slug, page_contents, template)
|
9
|
+
# raise "Invalid page: #{page.errors.full_messages}" unless page.valid?
|
10
|
+
# page.should be_valid
|
11
|
+
# page.save!
|
12
|
+
# page
|
9
13
|
end
|
10
14
|
|
11
15
|
# build page without saving
|
12
|
-
def new_content_page(
|
13
|
-
@home = @site.pages.where(:
|
14
|
-
|
15
|
-
|
16
|
+
def new_content_page(slug, template = nil)
|
17
|
+
@home = @site.pages.where(slug: 'index').first || FactoryGirl.create(:page)
|
18
|
+
title = slug.gsub(/-/, '_').humanize
|
19
|
+
@site.pages.new(title: title, slug: slug, parent: @home, published: true, raw_template: template)
|
16
20
|
end
|
17
21
|
|
18
22
|
# creates a page
|
19
|
-
Given /^a simple page named "([^"]*)" with the body:$/ do |page_slug, page_contents|
|
20
|
-
|
21
|
-
end
|
23
|
+
# Given /^a simple page named "([^"]*)" with the body:$/ do |page_slug, page_contents|
|
24
|
+
# @page = create_content_page(page_slug, page_contents)
|
25
|
+
# end
|
22
26
|
|
23
|
-
Given /^a page named "([^"]*)" with the template:$/ do |
|
24
|
-
@page = create_content_page(
|
27
|
+
Given /^a page named "([^"]*)" with the template:$/ do |slug, template|
|
28
|
+
@page = create_content_page(slug, template)
|
25
29
|
end
|
26
30
|
|
27
|
-
Given /^a page named "([^"]*)" with id "([^"]*)"$/ do |
|
28
|
-
@page = new_content_page(
|
29
|
-
@page.id = BSON::ObjectId(id)
|
31
|
+
Given /^a page named "([^"]*)" with id "([^"]*)"$/ do |slug, id|
|
32
|
+
@page = new_content_page(slug, '')
|
33
|
+
@page.id = Moped::BSON::ObjectId(id)
|
30
34
|
@page.save!
|
31
35
|
end
|
32
36
|
|
33
|
-
Given /^a page named "([^"]*)" with id "([^"]*)" and template:$/ do |
|
34
|
-
@page = new_content_page(
|
35
|
-
@page.id = BSON::ObjectId(id)
|
37
|
+
Given /^a page named "([^"]*)" with id "([^"]*)" and template:$/ do |slug, id, template|
|
38
|
+
@page = new_content_page(slug, template)
|
39
|
+
@page.id = Moped::BSON::ObjectId(id)
|
36
40
|
@page.save!
|
37
41
|
end
|
38
42
|
|
43
|
+
Given(/^a page named "(.*?)" with the handle "(.*?)"$/) do |slug, handle|
|
44
|
+
page = new_content_page(slug, '')
|
45
|
+
page.handle = handle
|
46
|
+
page.save!
|
47
|
+
end
|
48
|
+
|
49
|
+
Given(/^the page named "(.*?)" has the title "(.*?)" in the "(.*?)" locale$/) do |slug, title, locale|
|
50
|
+
page = @site.pages.where(slug: slug).first
|
51
|
+
::Mongoid::Fields::I18n.with_locale(locale) do
|
52
|
+
page.update_attributes!(title: title, slug: title.permalink)
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
39
56
|
Given /^a templatized page for the "(.*?)" model and with the template:$/ do |model_name, template|
|
40
57
|
content_type = Locomotive::ContentType.where(name: model_name).first
|
41
|
-
parent = create_content_page(content_type.slug, ''
|
58
|
+
parent = create_content_page(content_type.slug, '')
|
42
59
|
@page = @site.pages.new(parent: parent, title: "Template for #{model_name}", published: true,
|
43
60
|
templatized: true, target_klass_name: content_type.entries_class_name,
|
44
61
|
raw_template: template)
|
@@ -46,31 +63,31 @@ Given /^a templatized page for the "(.*?)" model and with the template:$/ do |mo
|
|
46
63
|
end
|
47
64
|
|
48
65
|
# change the title
|
49
|
-
When /^I change the page title to "([^"]*)"$/ do |
|
50
|
-
page.evaluate_script "window.prompt = function() { return '#{
|
66
|
+
When /^I change the page title to "([^"]*)"$/ do |title|
|
67
|
+
page.evaluate_script "window.prompt = function() { return '#{title}'; }"
|
51
68
|
page.find('h2 a.editable').click
|
52
69
|
end
|
53
70
|
|
54
71
|
# change the template
|
55
|
-
When /^I change the page template to "([^"]*)"$/ do |
|
56
|
-
page.evaluate_script "window.application_view.view.model.set({ 'raw_template': '#{
|
72
|
+
When /^I change the page template to "([^"]*)"$/ do |template|
|
73
|
+
page.evaluate_script "window.application_view.view.model.set({ 'raw_template': '#{template}' })"
|
57
74
|
end
|
58
75
|
|
59
76
|
# update a page
|
60
|
-
When /^I update the "([^"]*)" page with the template:$/ do |
|
61
|
-
page = @site.pages.where(:slug
|
77
|
+
When /^I update the "([^"]*)" page with the template:$/ do |slug, template|
|
78
|
+
page = @site.pages.where(slug: slug).first
|
62
79
|
page.raw_template = template
|
63
80
|
page.save!
|
64
81
|
end
|
65
82
|
|
66
|
-
Given /^I delete the following code "([^"]*)" from the "([^"]*)" page$/ do |code,
|
67
|
-
page = @site.pages.where(:slug
|
83
|
+
Given /^I delete the following code "([^"]*)" from the "([^"]*)" page$/ do |code, slug|
|
84
|
+
page = @site.pages.where(slug: slug).first
|
68
85
|
page.raw_template = page.raw_template.gsub(code, '')
|
69
86
|
page.save!
|
70
87
|
end
|
71
88
|
|
72
|
-
Given(/^
|
73
|
-
page = @site.pages.where(:
|
89
|
+
Given(/^the page "(.*?)" is unpublished$/) do |slug|
|
90
|
+
page = @site.pages.where(slug: slug).first
|
74
91
|
page.published = false
|
75
92
|
page.save!
|
76
93
|
end
|
@@ -87,9 +104,9 @@ When /^I view the rendered page at "([^"]*)"$/ do |path|
|
|
87
104
|
end
|
88
105
|
|
89
106
|
# checks to see if a string is in the slug
|
90
|
-
Then /^I should have "(.*)" in the (.*) page$/ do |content,
|
91
|
-
page = @site.pages.where(:slug
|
92
|
-
raise "Could not find page: #{
|
107
|
+
Then /^I should have "(.*)" in the (.*) page$/ do |content, slug|
|
108
|
+
page = @site.pages.where(slug: slug).first
|
109
|
+
raise "Could not find page: #{slug}" unless page
|
93
110
|
page.raw_template.should == content
|
94
111
|
end
|
95
112
|
|
@@ -1,12 +1,12 @@
|
|
1
1
|
Then /^I should be able to display paginated models$/ do
|
2
2
|
# Create our article model and three articles
|
3
|
-
@article_model = FactoryGirl.build(:content_type, :
|
4
|
-
ct.entries_custom_fields.build :
|
3
|
+
@article_model = FactoryGirl.build(:content_type, site: @site, name: 'Articles', order_by: '_position').tap do |ct|
|
4
|
+
ct.entries_custom_fields.build label: 'Body', type: 'string', required: false
|
5
5
|
ct.save!
|
6
6
|
end
|
7
7
|
|
8
8
|
%w(First Second Third).each do |body|
|
9
|
-
@article_model.entries.create!(:
|
9
|
+
@article_model.entries.create!(body: body)
|
10
10
|
end
|
11
11
|
|
12
12
|
# Create a page with template
|
@@ -18,7 +18,7 @@ Then /^I should be able to display paginated models$/ do
|
|
18
18
|
{{ paginate | default_pagination }}
|
19
19
|
{% endpaginate %}
|
20
20
|
}
|
21
|
-
FactoryGirl.create(:page, :
|
21
|
+
FactoryGirl.create(:page, site: @site, slug: 'hello', parent: @site.pages.root.first, raw_template: raw_template)
|
22
22
|
|
23
23
|
# The page should have the first two articles
|
24
24
|
visit '/hello'
|
@@ -6,11 +6,18 @@
|
|
6
6
|
#
|
7
7
|
Given /^I have the site: "([^"]*)" set up(?: with #{capture_fields})?$/ do |site_factory, fields|
|
8
8
|
Thread.current[:site] = nil
|
9
|
-
|
9
|
+
attributes = parse_fields(fields)
|
10
|
+
id = attributes.delete('id')
|
11
|
+
@site = FactoryGirl.build(site_factory, attributes)
|
12
|
+
@site.id = id if id
|
13
|
+
@site.save & @site.reload
|
10
14
|
@site.should_not be_nil
|
11
15
|
|
12
16
|
@admin = @site.memberships.first.account
|
13
17
|
@admin.should_not be_nil
|
18
|
+
# same api key for all the tests
|
19
|
+
@admin.api_key = 'd49cd50f6f0d2b163f48fc73cb249f0244c37074'
|
20
|
+
@admin.save
|
14
21
|
end
|
15
22
|
|
16
23
|
Given /^I have a site set up$/ do
|
@@ -18,14 +25,19 @@ Given /^I have a site set up$/ do
|
|
18
25
|
end
|
19
26
|
|
20
27
|
Given /^I have a designer and an author$/ do
|
21
|
-
|
22
|
-
FactoryGirl.create(:
|
28
|
+
site = Locomotive::Site.first
|
29
|
+
FactoryGirl.create(:designer, site: site)
|
30
|
+
FactoryGirl.create(:author, site: site)
|
23
31
|
end
|
24
32
|
|
25
33
|
Given /^the site "(.*?)" has locales "(.*?)"$/ do |name, locales|
|
26
|
-
site = Locomotive::Site.where(:
|
27
|
-
site.locales
|
28
|
-
|
34
|
+
site = Locomotive::Site.where(name: name).first
|
35
|
+
site.update_attribute :locales, locales.split(',').map(&:strip)
|
36
|
+
|
37
|
+
# very important to set the locale fallbacks
|
38
|
+
site.locales.each do |locale|
|
39
|
+
::Mongoid::Fields::I18n.fallbacks_for(locale, site.locale_fallbacks(locale))
|
40
|
+
end
|
29
41
|
end
|
30
42
|
|
31
43
|
Given /^multi_sites is disabled$/ do
|
@@ -34,7 +46,7 @@ Given /^multi_sites is disabled$/ do
|
|
34
46
|
end
|
35
47
|
|
36
48
|
Then /^I should be a administrator of the "([^"]*)" site$/ do |name|
|
37
|
-
site = Locomotive::Site.where(:
|
49
|
+
site = Locomotive::Site.where(name: name).first
|
38
50
|
m = site.memberships.detect { |m| m.account_id == @admin._id && m.admin? }
|
39
51
|
m.should_not be_nil
|
40
52
|
end
|
@@ -42,14 +54,14 @@ end
|
|
42
54
|
# sets the robot_txt for a site
|
43
55
|
|
44
56
|
Given /^a robot_txt set to "([^"]*)"$/ do |value|
|
45
|
-
@site.update_attributes(:
|
57
|
+
@site.update_attributes(robots_txt: value)
|
46
58
|
end
|
47
59
|
|
48
60
|
Then /^I should be able to add a domain to my site$/ do
|
49
61
|
visit edit_current_site_path
|
50
62
|
|
51
63
|
within('#site_domains_input') do
|
52
|
-
fill_in 'domain', :
|
64
|
+
fill_in 'domain', with: 'monkeys.com'
|
53
65
|
end
|
54
66
|
click_link '+ add'
|
55
67
|
click_button 'Save'
|
@@ -72,7 +84,7 @@ Then /^I should be able to remove a domain from my site$/ do
|
|
72
84
|
end
|
73
85
|
|
74
86
|
Then /^I should be able to remove a membership from my site$/ do
|
75
|
-
@new_account = FactoryGirl.create(:author, :
|
87
|
+
@new_account = FactoryGirl.create(:author, site: @site)
|
76
88
|
@site.save!
|
77
89
|
|
78
90
|
visit edit_current_site_path
|