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
@@ -1,10 +1,10 @@
|
|
1
1
|
%ul#menu
|
2
2
|
- @list.each_with_index do |entry, index|
|
3
|
-
%li{ :
|
3
|
+
%li{ class: "entry entry-#{index} #{entry[:class]}" }
|
4
4
|
%div.left
|
5
5
|
%span
|
6
6
|
= link_to entry[:url] do
|
7
|
-
%i{ :
|
7
|
+
%i{ class: entry[:icon] }
|
8
8
|
%span= entry[:label]
|
9
9
|
%div.right
|
10
10
|
%span
|
@@ -4,8 +4,8 @@ module Locomotive
|
|
4
4
|
protected
|
5
5
|
|
6
6
|
def build_list
|
7
|
-
add :contents, :
|
8
|
-
add :settings, :
|
7
|
+
add :contents, url: pages_url, icon: 'icon-folder-open'
|
8
|
+
add :settings, url: edit_current_site_url, icon: 'icon-cog'
|
9
9
|
end
|
10
10
|
|
11
11
|
end
|
@@ -3,7 +3,7 @@ module Locomotive
|
|
3
3
|
|
4
4
|
include ::Locomotive::Engine.routes.url_helpers
|
5
5
|
|
6
|
-
delegate :main_app, :sections, :
|
6
|
+
delegate :main_app, :sections, to: :parent_controller
|
7
7
|
|
8
8
|
attr_accessor :list
|
9
9
|
|
@@ -19,10 +19,10 @@ module Locomotive
|
|
19
19
|
|
20
20
|
def url_options
|
21
21
|
super.reverse_merge(
|
22
|
-
:
|
23
|
-
:
|
24
|
-
:
|
25
|
-
).merge(:
|
22
|
+
host: request.host_with_port,
|
23
|
+
protocol: request.protocol,
|
24
|
+
_path_segments: request.symbolized_path_parameters
|
25
|
+
).merge(script_name: request.script_name)
|
26
26
|
end
|
27
27
|
|
28
28
|
class MenuProxy
|
@@ -65,7 +65,7 @@ module Locomotive
|
|
65
65
|
attributes[:label] = localize_label(name)
|
66
66
|
end
|
67
67
|
|
68
|
-
attributes.merge!(:
|
68
|
+
attributes.merge!(name: name, class: name.to_s.dasherize.downcase)
|
69
69
|
end
|
70
70
|
|
71
71
|
def add(name, attributes)
|
@@ -0,0 +1,21 @@
|
|
1
|
+
module Locomotive
|
2
|
+
class PartialsCell < Cell::Rails
|
3
|
+
cattr_accessor :templates
|
4
|
+
|
5
|
+
def self.add_template(namespace, name)
|
6
|
+
self.templates ||= {}
|
7
|
+
self.templates[namespace] ||= []
|
8
|
+
self.templates[namespace] << name
|
9
|
+
end
|
10
|
+
|
11
|
+
def display(namespace, locals = {})
|
12
|
+
return unless self.class.templates && self.class.templates[namespace].present?
|
13
|
+
|
14
|
+
locals.each_pair do |k,v|
|
15
|
+
instance_variable_set("@#{k}", v)
|
16
|
+
end
|
17
|
+
|
18
|
+
self.class.templates[namespace].map { |template| render view: template }.join.html_safe
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -4,10 +4,10 @@ module Locomotive
|
|
4
4
|
protected
|
5
5
|
|
6
6
|
def build_list
|
7
|
-
add :site, :
|
8
|
-
add :theme_assets, :
|
9
|
-
add :translations, :
|
10
|
-
add :account, :
|
7
|
+
add :site, url: edit_current_site_url
|
8
|
+
add :theme_assets, url: theme_assets_url
|
9
|
+
add :translations, url: translations_url
|
10
|
+
add :account, url: edit_my_account_url
|
11
11
|
end
|
12
12
|
|
13
13
|
end
|
@@ -4,15 +4,15 @@ module Locomotive
|
|
4
4
|
sections 'settings'
|
5
5
|
|
6
6
|
def new
|
7
|
-
@account = Account.new(:
|
7
|
+
@account = Account.new(email: params[:email])
|
8
8
|
respond_with @account
|
9
9
|
end
|
10
10
|
|
11
11
|
def create
|
12
12
|
@account = Account.create(params[:account])
|
13
|
-
current_site.memberships.create(:
|
14
|
-
respond_with @account, :
|
13
|
+
current_site.memberships.create(account: @account) if @account.errors.empty?
|
14
|
+
respond_with @account, location: edit_current_site_url
|
15
15
|
end
|
16
16
|
|
17
17
|
end
|
18
|
-
end
|
18
|
+
end
|
@@ -5,7 +5,7 @@ module Locomotive
|
|
5
5
|
load_and_authorize_resource class: Locomotive::ContentType, through: :current_site
|
6
6
|
|
7
7
|
def index
|
8
|
-
@content_types = @content_types.order_by(
|
8
|
+
@content_types = @content_types.order_by(:name.asc)
|
9
9
|
respond_with(@content_types)
|
10
10
|
end
|
11
11
|
|
@@ -80,4 +80,4 @@ module Locomotive
|
|
80
80
|
|
81
81
|
end
|
82
82
|
end
|
83
|
-
end
|
83
|
+
end
|
@@ -29,6 +29,53 @@ module Locomotive
|
|
29
29
|
respond_with @theme_asset
|
30
30
|
end
|
31
31
|
|
32
|
+
def self.description
|
33
|
+
{
|
34
|
+
overall: %{Manage the assets (stylesheets, javascripts, images, fonts) used by a site},
|
35
|
+
actions: {
|
36
|
+
index: {
|
37
|
+
description: %{Return all the theme assets},
|
38
|
+
example: {
|
39
|
+
command: %{curl 'http://mysite.com/locomotive/api/theme_assets.json?auth_token=dtsjkqs1TJrWiSiJt2gg'},
|
40
|
+
response: %(TODO)
|
41
|
+
}
|
42
|
+
},
|
43
|
+
show: {
|
44
|
+
description: %{Return the attributes of a theme asset},
|
45
|
+
response: Locomotive::ThemeAssetPresenter.getters_to_hash,
|
46
|
+
example: {
|
47
|
+
command: %{curl 'http://mysite.com/locomotive/api/theme_assets/4244af4ef0000002.json?auth_token=dtsjkqs1TJrWiSiJt2gg'},
|
48
|
+
response: %(TODO)
|
49
|
+
}
|
50
|
+
},
|
51
|
+
create: {
|
52
|
+
description: %{Create a theme asset},
|
53
|
+
params: Locomotive::ThemeAssetPresenter.setters_to_hash,
|
54
|
+
example: {
|
55
|
+
command: %{curl -d '...' 'http://mysite.com/locomotive/api/theme_assets.json?auth_token=dtsjkqs1TJrWiSiJt2gg'},
|
56
|
+
response: %(TODO)
|
57
|
+
}
|
58
|
+
},
|
59
|
+
update: {
|
60
|
+
description: %{Update a theme asset},
|
61
|
+
params: Locomotive::ThemeAssetPresenter.setters_to_hash,
|
62
|
+
example: {
|
63
|
+
command: %{curl -d '...' -X UPDATE 'http://mysite.com/locomotive/api/theme_assets/4244af4ef0000002.json?auth_token=dtsjkqs1TJrWiSiJt2gg'},
|
64
|
+
response: %(TODO)
|
65
|
+
}
|
66
|
+
},
|
67
|
+
destroy: {
|
68
|
+
description: %{Delete a theme asset},
|
69
|
+
example: {
|
70
|
+
command: %{curl -X DELETE 'http://mysite.com/locomotive/api/theme_assets/4244af4ef0000002.json?auth_token=dtsjkqs1TJrWiSiJt2gg'},
|
71
|
+
response: %(TODO)
|
72
|
+
}
|
73
|
+
}
|
74
|
+
}
|
75
|
+
}
|
76
|
+
end
|
77
|
+
|
78
|
+
|
32
79
|
end
|
33
80
|
end
|
34
81
|
end
|
@@ -6,7 +6,7 @@ module Locomotive
|
|
6
6
|
|
7
7
|
def create
|
8
8
|
begin
|
9
|
-
token = Account.create_api_token(current_site, params[:email], params[:password])
|
9
|
+
token = Account.create_api_token(current_site, params[:email], params[:password], params[:api_key])
|
10
10
|
respond_with({ token: token }, location: root_url)
|
11
11
|
rescue Exception => e
|
12
12
|
respond_with({ message: e.message }, status: 401, location: root_url)
|
@@ -29,7 +29,7 @@ module Locomotive
|
|
29
29
|
overall: %{Manage a session token which will be passed to all the other REST calls},
|
30
30
|
actions: {
|
31
31
|
create: {
|
32
|
-
description: %{Generate a session token from an email and a password},
|
32
|
+
description: %{Generate a session token from either an email and a password OR an api key},
|
33
33
|
params: { email: 'String', password: 'String' },
|
34
34
|
response: { token: 'String' },
|
35
35
|
example: {
|
@@ -5,9 +5,12 @@ module Locomotive
|
|
5
5
|
include Locomotive::ActionController::LocaleHelpers
|
6
6
|
include Locomotive::ActionController::SectionHelpers
|
7
7
|
include Locomotive::ActionController::UrlHelpers
|
8
|
+
include Locomotive::ActionController::Ssl
|
8
9
|
|
9
10
|
layout '/locomotive/layouts/application'
|
10
11
|
|
12
|
+
before_filter :require_ssl
|
13
|
+
|
11
14
|
before_filter :require_account
|
12
15
|
|
13
16
|
before_filter :require_site
|
@@ -34,7 +37,7 @@ module Locomotive
|
|
34
37
|
::Locomotive.log "[CanCan::AccessDenied] #{exception.inspect}"
|
35
38
|
|
36
39
|
if request.xhr?
|
37
|
-
render :
|
40
|
+
render json: { error: exception.message }
|
38
41
|
else
|
39
42
|
flash[:alert] = exception.message
|
40
43
|
|
@@ -58,4 +61,4 @@ module Locomotive
|
|
58
61
|
end
|
59
62
|
|
60
63
|
end
|
61
|
-
end
|
64
|
+
end
|
@@ -5,21 +5,34 @@ module Locomotive
|
|
5
5
|
|
6
6
|
localized
|
7
7
|
|
8
|
-
before_filter :back_to_default_site_locale, :
|
8
|
+
before_filter :back_to_default_site_locale, only: %w(new create)
|
9
9
|
|
10
10
|
before_filter :set_content_type
|
11
11
|
|
12
|
-
respond_to :json, :only => [:show, :edit, :create, :update, :sort]
|
13
|
-
|
14
12
|
skip_load_and_authorize_resource
|
15
13
|
|
16
14
|
before_filter :authorize_content
|
17
15
|
|
16
|
+
respond_to :json, only: [:show, :edit, :create, :update, :sort]
|
17
|
+
|
18
|
+
respond_to :csv, only: [:export]
|
19
|
+
|
18
20
|
def index
|
19
|
-
|
21
|
+
options = { page: params[:page] || 1, per_page: Locomotive.config.ui[:per_page] }
|
22
|
+
@content_entries = @content_type.list_or_group_entries(options)
|
20
23
|
respond_with @content_entries
|
21
24
|
end
|
22
25
|
|
26
|
+
def export
|
27
|
+
@content_entries = @content_type.ordered_entries
|
28
|
+
respond_with @content_entries, {
|
29
|
+
filename: @content_type.slug,
|
30
|
+
col_sep: ';',
|
31
|
+
content_type: @content_type,
|
32
|
+
host: request.host_with_port
|
33
|
+
}
|
34
|
+
end
|
35
|
+
|
23
36
|
def show
|
24
37
|
@content_entry = @content_type.entries.find(params[:id])
|
25
38
|
respond_with @content_entry
|
@@ -32,7 +45,7 @@ module Locomotive
|
|
32
45
|
|
33
46
|
def create
|
34
47
|
@content_entry = @content_type.entries.create(params[:content_entry])
|
35
|
-
respond_with @content_entry, :
|
48
|
+
respond_with @content_entry, location: edit_content_entry_url(@content_type.slug, @content_entry._id)
|
36
49
|
end
|
37
50
|
|
38
51
|
def edit
|
@@ -43,7 +56,7 @@ module Locomotive
|
|
43
56
|
def update
|
44
57
|
@content_entry = @content_type.entries.find(params[:id])
|
45
58
|
@content_entry.update_attributes(params[:content_entry])
|
46
|
-
respond_with @content_entry, :
|
59
|
+
respond_with @content_entry, location: edit_content_entry_url(@content_type.slug, @content_entry._id)
|
47
60
|
end
|
48
61
|
|
49
62
|
def sort
|
@@ -54,13 +67,13 @@ module Locomotive
|
|
54
67
|
def destroy
|
55
68
|
@content_entry = @content_type.entries.find(params[:id])
|
56
69
|
@content_entry.destroy
|
57
|
-
respond_with @content_entry, :
|
70
|
+
respond_with @content_entry, location: content_entries_url(@content_type.slug)
|
58
71
|
end
|
59
72
|
|
60
73
|
protected
|
61
74
|
|
62
75
|
def set_content_type
|
63
|
-
@content_type ||= current_site.content_types.where(:
|
76
|
+
@content_type ||= current_site.content_types.where(slug: params[:slug]).first
|
64
77
|
end
|
65
78
|
|
66
79
|
def authorize_content
|
@@ -68,4 +81,4 @@ module Locomotive
|
|
68
81
|
end
|
69
82
|
|
70
83
|
end
|
71
|
-
end
|
84
|
+
end
|
@@ -3,9 +3,9 @@ module Locomotive
|
|
3
3
|
|
4
4
|
sections 'contents'
|
5
5
|
|
6
|
-
before_filter :back_to_default_site_locale, :
|
6
|
+
before_filter :back_to_default_site_locale, only: %w(new create)
|
7
7
|
|
8
|
-
respond_to :json, :
|
8
|
+
respond_to :json, only: [:create, :update, :destroy]
|
9
9
|
|
10
10
|
helper 'Locomotive::Accounts', 'Locomotive::CustomFields'
|
11
11
|
|
@@ -16,7 +16,7 @@ module Locomotive
|
|
16
16
|
|
17
17
|
def create
|
18
18
|
@content_type = current_site.content_types.create(params[:content_type])
|
19
|
-
respond_with @content_type, :
|
19
|
+
respond_with @content_type, location: edit_content_type_url(@content_type._id)
|
20
20
|
end
|
21
21
|
|
22
22
|
def edit
|
@@ -27,14 +27,14 @@ module Locomotive
|
|
27
27
|
def update
|
28
28
|
@content_type = current_site.content_types.find(params[:id])
|
29
29
|
@content_type.update_attributes(params[:content_type])
|
30
|
-
respond_with @content_type, :
|
30
|
+
respond_with @content_type, location: edit_content_type_url(@content_type._id)
|
31
31
|
end
|
32
32
|
|
33
33
|
def destroy
|
34
34
|
@content_type = current_site.content_types.find(params[:id])
|
35
35
|
@content_type.destroy
|
36
|
-
respond_with @content_type, :
|
36
|
+
respond_with @content_type, location: pages_url
|
37
37
|
end
|
38
38
|
|
39
39
|
end
|
40
|
-
end
|
40
|
+
end
|
@@ -7,15 +7,15 @@ module Locomotive
|
|
7
7
|
|
8
8
|
skip_load_and_authorize_resource
|
9
9
|
|
10
|
-
load_and_authorize_resource :
|
10
|
+
load_and_authorize_resource class: 'Site'
|
11
11
|
|
12
12
|
helper 'Locomotive::Sites'
|
13
13
|
|
14
14
|
before_filter :filter_attributes
|
15
15
|
|
16
|
-
before_filter :ensure_domains_list, :
|
16
|
+
before_filter :ensure_domains_list, only: :update
|
17
17
|
|
18
|
-
respond_to :json, :
|
18
|
+
respond_to :json, only: :update
|
19
19
|
|
20
20
|
def edit
|
21
21
|
@site = current_site
|
@@ -25,7 +25,7 @@ module Locomotive
|
|
25
25
|
def update
|
26
26
|
@site = current_site
|
27
27
|
@site.update_attributes(params[:site])
|
28
|
-
respond_with @site, :
|
28
|
+
respond_with @site, location: edit_current_site_url(new_host_if_subdomain_changed)
|
29
29
|
end
|
30
30
|
|
31
31
|
protected
|
@@ -40,7 +40,7 @@ module Locomotive
|
|
40
40
|
if !Locomotive.config.manage_subdomain? || @site.domains.include?(request.host)
|
41
41
|
{}
|
42
42
|
else
|
43
|
-
{ :
|
43
|
+
{ host: site_url(@site, { fullpath: false, protocol: false }) }
|
44
44
|
end
|
45
45
|
end
|
46
46
|
|
@@ -49,4 +49,4 @@ module Locomotive
|
|
49
49
|
end
|
50
50
|
|
51
51
|
end
|
52
|
-
end
|
52
|
+
end
|