locomotive_cms 2.0.0.rc12 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +35 -28
- data/LICENSE +1 -1
- data/README.textile +9 -4
- data/app/assets/images/locomotive/icons/flags/de.png +0 -0
- data/app/assets/images/locomotive/icons/flags/en.png +0 -0
- data/app/assets/images/locomotive/icons/flags/es.png +0 -0
- data/app/assets/images/locomotive/icons/flags/et.png +0 -0
- data/app/assets/images/locomotive/icons/flags/fr.png +0 -0
- data/app/assets/images/locomotive/icons/flags/it.png +0 -0
- data/app/assets/images/locomotive/icons/flags/nb.png +0 -0
- data/app/assets/images/locomotive/icons/flags/nl.png +0 -0
- data/app/assets/images/locomotive/icons/flags/pl.png +0 -0
- data/app/assets/images/locomotive/icons/flags/pt-BR.png +0 -0
- data/app/assets/images/locomotive/icons/flags/ru.png +0 -0
- data/app/assets/javascripts/aloha/plugins/custom/locomotive_media/css/image.css +1 -1
- data/app/assets/javascripts/aloha/plugins/custom/locomotive_media/lib/locomotive_media-plugin.js +10 -21
- data/app/assets/javascripts/locomotive/models/content_entry.js.coffee +1 -1
- data/app/assets/javascripts/locomotive/models/content_type.js.coffee +6 -0
- data/app/assets/javascripts/locomotive/models/translation.js.coffee +5 -0
- data/app/assets/javascripts/locomotive/utils/aloha_settings.js.coffee +20 -2
- data/app/assets/javascripts/locomotive/utils/tinymce_settings.js.coffee +6 -6
- data/app/assets/javascripts/locomotive/views/application_view.js.coffee +4 -4
- data/app/assets/javascripts/locomotive/views/content_assets/picker_item_view.js.coffee +1 -1
- data/app/assets/javascripts/locomotive/views/content_entries/_form_view.js.coffee +10 -3
- data/app/assets/javascripts/locomotive/views/content_entries/_popup_form_view.js.coffee +7 -6
- data/app/assets/javascripts/locomotive/views/content_entries/index_view.js.coffee +1 -1
- data/app/assets/javascripts/locomotive/views/content_types/_form_view.js.coffee +4 -1
- data/app/assets/javascripts/locomotive/views/content_types/custom_field_entry_view.js.coffee +2 -2
- data/app/assets/javascripts/locomotive/views/content_types/custom_fields_view.coffee +5 -0
- data/app/assets/javascripts/locomotive/views/content_types/edit_view.coffee +1 -1
- data/app/assets/javascripts/locomotive/views/content_types/select_options_view.js.coffee +6 -6
- data/app/assets/javascripts/locomotive/views/current_site/edit_view.js.coffee +2 -1
- data/app/assets/javascripts/locomotive/views/editable_elements/edit_all_view.js.coffee +1 -1
- data/app/assets/javascripts/locomotive/views/editable_elements/file_view.js.coffee +2 -2
- data/app/assets/javascripts/locomotive/views/inline_editor/application_view.js.coffee +36 -15
- data/app/assets/javascripts/locomotive/views/inline_editor/toolbar_view.js.coffee +30 -14
- data/app/assets/javascripts/locomotive/views/pages/_form_view.js.coffee +24 -11
- data/app/assets/javascripts/locomotive/views/pages/edit_view.js.coffee +1 -1
- data/app/assets/javascripts/locomotive/views/pages/list_view.js.coffee +2 -2
- data/app/assets/javascripts/locomotive/views/shared/fields/file_view.js.coffee +5 -4
- data/app/assets/javascripts/locomotive/views/shared/fields/has_many_view.js.coffee +2 -1
- data/app/assets/javascripts/locomotive/views/shared/fields/many_to_many_view.js.coffee +1 -1
- data/app/assets/javascripts/locomotive/views/shared/fields/select_view.js.coffee +6 -2
- data/app/assets/javascripts/locomotive/views/shared/form_view.js.coffee +17 -12
- data/app/assets/javascripts/locomotive/views/shared/list_item_view.js.coffee +1 -1
- data/app/assets/javascripts/locomotive/views/sites/membership_entry_view.js.coffee +2 -1
- data/app/assets/javascripts/locomotive/views/snippets/_form_view.js.coffee +19 -3
- data/app/assets/javascripts/locomotive/views/theme_assets/index_view.js.coffee +8 -1
- data/app/assets/javascripts/locomotive/views/translations/_form_view.js.coffee +20 -0
- data/app/assets/javascripts/locomotive/views/translations/edit_view.js.coffee +6 -0
- data/app/assets/javascripts/locomotive/views/translations/new_view.js.coffee +8 -0
- data/app/assets/javascripts/tinymce/plugins/jqueryinlinepopups/editor_plugin.js +2 -2
- data/app/assets/javascripts/tinymce/plugins/locomotive_media/editor_plugin.js +1 -0
- data/app/assets/javascripts/tinymce/plugins/locomotive_media/langs/en.js +1 -0
- data/app/assets/javascripts/tinymce/plugins/locomotive_media/langs/fr.js +1 -0
- data/app/assets/javascripts/tinymce/plugins/locomotive_media/langs/ru.js +1 -0
- data/app/assets/stylesheets/locomotive.css +2 -1
- data/app/assets/stylesheets/locomotive/backoffice/_box.css.scss +3 -13
- data/app/assets/stylesheets/locomotive/backoffice/_buttons.css.scss +39 -16
- data/app/assets/stylesheets/locomotive/backoffice/application.css.scss +45 -56
- data/app/assets/stylesheets/locomotive/backoffice/codemirror_changes.css.scss +2 -0
- data/app/assets/stylesheets/locomotive/backoffice/content_assets.css.scss +5 -8
- data/app/assets/stylesheets/locomotive/backoffice/datepicker.css.scss +23 -9
- data/app/assets/stylesheets/locomotive/backoffice/formtastic_changes.css.scss +36 -32
- data/app/assets/stylesheets/locomotive/backoffice/layout.css.scss +2 -1
- data/app/assets/stylesheets/locomotive/backoffice/menu/_colors.css.scss +2 -1
- data/app/assets/stylesheets/locomotive/backoffice/menu/default.css.scss +4 -39
- data/app/assets/stylesheets/locomotive/backoffice/menu/main.css.scss +1 -1
- data/app/assets/stylesheets/locomotive/backoffice/menu/sub.css.scss +28 -36
- data/app/assets/stylesheets/locomotive/inline_editor.css +2 -1
- data/app/assets/stylesheets/locomotive/inline_editor/_buttons.css.scss +1 -11
- data/app/assets/stylesheets/locomotive/inline_editor/toolbar.css.scss +3 -4
- data/app/assets/stylesheets/locomotive/not_logged_in.css +1 -0
- data/app/assets/stylesheets/locomotive/not_logged_in/layout.css.scss +17 -8
- data/app/assets/stylesheets/locomotive/shared/_helpers.css.scss +21 -41
- data/app/assets/stylesheets/locomotive/shared/common.css.scss +2 -1
- data/app/assets/stylesheets/locomotive/shared/content_locale_picker.css.scss +11 -13
- data/app/cells/locomotive/content_locale_picker/show.html.haml +2 -2
- data/app/cells/locomotive/content_locale_picker_cell.rb +6 -2
- data/app/cells/locomotive/global_actions_cell.rb +1 -1
- data/app/cells/locomotive/main_menu/show.html.haml +1 -1
- data/app/cells/locomotive/main_menu_cell.rb +2 -2
- data/app/cells/locomotive/settings_menu_cell.rb +1 -0
- data/app/controllers/locomotive/api/accounts_controller.rb +70 -0
- data/app/controllers/locomotive/api/base_controller.rb +8 -0
- data/app/controllers/locomotive/api/content_assets_controller.rb +7 -9
- data/app/controllers/locomotive/api/content_entries_controller.rb +18 -14
- data/app/controllers/locomotive/api/content_types_controller.rb +56 -9
- data/app/controllers/locomotive/api/current_site_controller.rb +47 -1
- data/app/controllers/locomotive/api/documentation_controller.rb +15 -0
- data/app/controllers/locomotive/api/memberships_controller.rb +49 -14
- data/app/controllers/locomotive/api/my_account_controller.rb +19 -2
- data/app/controllers/locomotive/api/pages_controller.rb +56 -9
- data/app/controllers/locomotive/api/sites_controller.rb +62 -14
- data/app/controllers/locomotive/api/snippets_controller.rb +56 -9
- data/app/controllers/locomotive/api/theme_assets_controller.rb +7 -9
- data/app/controllers/locomotive/api/tokens_controller.rb +32 -5
- data/app/controllers/locomotive/api/translations_controller.rb +33 -0
- data/app/controllers/locomotive/public/base_controller.rb +1 -1
- data/app/controllers/locomotive/public/content_entries_controller.rb +13 -12
- data/app/controllers/locomotive/public/pages_controller.rb +3 -1
- data/app/controllers/locomotive/public/robots_controller.rb +2 -2
- data/app/controllers/locomotive/public/sitemaps_controller.rb +2 -2
- data/app/controllers/locomotive/sites_controller.rb +2 -2
- data/app/controllers/locomotive/snippets_controller.rb +6 -1
- data/app/controllers/locomotive/translations_controller.rb +39 -0
- data/app/helpers/locomotive/accounts_helper.rb +1 -1
- data/app/helpers/locomotive/base_helper.rb +68 -2
- data/app/helpers/locomotive/content_entries_helper.rb +27 -1
- data/app/helpers/locomotive/custom_fields_helper.rb +2 -2
- data/app/helpers/locomotive/pages_helper.rb +30 -2
- data/app/helpers/locomotive/snippets_helper.rb +20 -0
- data/app/helpers/locomotive/translations_helper.rb +19 -0
- data/app/inputs/locomotive/code_input.rb +29 -7
- data/app/inputs/locomotive/file_input.rb +5 -1
- data/app/inputs/locomotive/locale_input.rb +3 -2
- data/app/inputs/locomotive/locales_input.rb +3 -2
- data/app/mailers/locomotive/notifications.rb +7 -1
- data/app/models/locomotive/ability.rb +9 -3
- data/app/models/locomotive/account.rb +11 -5
- data/app/models/locomotive/content_asset.rb +2 -7
- data/app/models/locomotive/content_entry.rb +26 -20
- data/app/models/locomotive/content_type.rb +56 -28
- data/app/models/locomotive/editable_control.rb +0 -4
- data/app/models/locomotive/editable_element.rb +15 -4
- data/app/models/locomotive/editable_file.rb +11 -5
- data/app/models/locomotive/editable_long_text.rb +1 -7
- data/app/models/locomotive/editable_short_text.rb +12 -3
- data/app/models/locomotive/extensions/content_type/default_values.rb +2 -4
- data/app/models/locomotive/extensions/page/editable_elements.rb +22 -3
- data/app/models/locomotive/extensions/page/listed.rb +1 -1
- data/app/models/locomotive/extensions/page/parse.rb +18 -12
- data/app/models/locomotive/extensions/page/redirect.rb +6 -4
- data/app/models/locomotive/extensions/page/render.rb +1 -1
- data/app/models/locomotive/extensions/page/templatized.rb +48 -19
- data/app/models/locomotive/extensions/page/tree.rb +14 -2
- data/app/models/locomotive/extensions/site/locales.rb +11 -3
- data/app/models/locomotive/extensions/site/subdomain_domains.rb +7 -2
- data/app/models/locomotive/membership.rb +0 -4
- data/app/models/locomotive/page.rb +5 -13
- data/app/models/locomotive/site.rb +16 -23
- data/app/models/locomotive/snippet.rb +1 -9
- data/app/models/locomotive/theme_asset.rb +24 -28
- data/app/models/locomotive/translation.rb +35 -0
- data/app/presenters/locomotive/account_presenter.rb +12 -4
- data/app/presenters/locomotive/base_presenter.rb +122 -20
- data/app/presenters/locomotive/content_asset_presenter.rb +22 -11
- data/app/presenters/locomotive/content_entry_presenter.rb +151 -36
- data/app/presenters/locomotive/content_field_presenter.rb +76 -0
- data/app/presenters/locomotive/content_type_presenter.rb +66 -8
- data/app/presenters/locomotive/editable_control_presenter.rb +9 -8
- data/app/presenters/locomotive/editable_element_presenter.rb +26 -7
- data/app/presenters/locomotive/editable_file_presenter.rb +26 -5
- data/app/presenters/locomotive/editable_short_text_presenter.rb +21 -4
- data/app/presenters/locomotive/membership_presenter.rb +14 -16
- data/app/presenters/locomotive/page_presenter.rb +60 -14
- data/app/presenters/locomotive/site_presenter.rb +23 -8
- data/app/presenters/locomotive/snippet_presenter.rb +10 -8
- data/app/presenters/locomotive/theme_asset_presenter.rb +32 -15
- data/app/presenters/locomotive/translation_presenter.rb +9 -0
- data/app/uploaders/locomotive/editable_file_uploader.rb +4 -0
- data/app/views/locomotive/content_assets/_asset.html.haml +1 -1
- data/app/views/locomotive/content_assets/_picker.html.haml +1 -1
- data/app/views/locomotive/content_entries/_form.html.haml +2 -2
- data/app/views/locomotive/content_entries/_list.html.haml +1 -2
- data/app/views/locomotive/content_entries/edit.html.haml +6 -3
- data/app/views/locomotive/content_entries/index.html.haml +2 -2
- data/app/views/locomotive/content_entries/new.html.haml +5 -2
- data/app/views/locomotive/content_types/edit.html.haml +2 -2
- data/app/views/locomotive/current_site/edit.html.haml +1 -1
- data/app/views/locomotive/custom_fields/_form.html.haml +4 -4
- data/app/views/locomotive/custom_fields/_select_templates.html.haml +2 -2
- data/app/views/locomotive/custom_fields/types/_has_many.html.haml +6 -34
- data/app/views/locomotive/custom_fields/types/_has_many_form.html.haml +31 -0
- data/app/views/locomotive/custom_fields/types/_many_to_many.html.haml +2 -3
- data/app/views/locomotive/layouts/not_logged_in.html.haml +1 -1
- data/app/views/locomotive/my_account/edit.html.haml +2 -2
- data/app/views/locomotive/pages/_form.html.haml +8 -4
- data/app/views/locomotive/pages/_page.html.haml +7 -1
- data/app/views/locomotive/pages/edit.html.haml +1 -1
- data/app/views/locomotive/pages/index.html.haml +1 -1
- data/app/views/locomotive/public/pages/show_toolbar.html.haml +2 -3
- data/app/views/locomotive/public/sitemaps/show.xml.builder +4 -4
- data/app/views/locomotive/shared/_head.html.haml +3 -2
- data/app/views/locomotive/shared/_locale_picker_link.html.haml +3 -4
- data/app/views/locomotive/shared/actions/_contents.html.haml +3 -1
- data/app/views/locomotive/shared/menu/_contents.html.haml +14 -3
- data/app/views/locomotive/sites/_domains.html.haml +1 -1
- data/app/views/locomotive/sites/_form.html.haml +5 -5
- data/app/views/locomotive/sites/_memberships.html.haml +4 -2
- data/app/views/locomotive/snippets/_form.html.haml +2 -2
- data/app/views/locomotive/snippets/_snippet.html.haml +1 -1
- data/app/views/locomotive/snippets/edit.html.haml +1 -1
- data/app/views/locomotive/theme_assets/_asset.html.haml +1 -1
- data/app/views/locomotive/theme_assets/_form.html.haml +6 -2
- data/app/views/locomotive/theme_assets/edit.html.haml +1 -1
- data/app/views/locomotive/theme_assets/index.html.haml +15 -11
- data/app/views/locomotive/translations/_form.html.haml +12 -0
- data/app/views/locomotive/translations/edit.html.haml +15 -0
- data/app/views/locomotive/translations/index.html.haml +28 -0
- data/app/views/locomotive/translations/new.html.haml +12 -0
- data/config/initializers/deny_phantomjs_ttf.rb +29 -0
- data/config/locales/admin_ui.de.yml +1 -0
- data/config/locales/admin_ui.en.yml +22 -2
- data/config/locales/admin_ui.es.yml +1 -0
- data/config/locales/admin_ui.et.yml +14 -0
- data/config/locales/admin_ui.fr.yml +36 -14
- data/config/locales/admin_ui.it.yml +1 -0
- data/config/locales/admin_ui.nb.yml +1 -0
- data/config/locales/admin_ui.pl.yml +319 -0
- data/config/locales/admin_ui.pt-BR.yml +38 -6
- data/config/locales/admin_ui.ru.yml +1 -0
- data/config/locales/carrierwave.pl.yml +4 -0
- data/config/locales/default.fr.yml +3 -1
- data/config/locales/default.pl.yml +317 -0
- data/config/locales/devise.de.yml +1 -0
- data/config/locales/devise.en.yml +1 -0
- data/config/locales/devise.es.yml +1 -0
- data/config/locales/devise.et.yml +1 -0
- data/config/locales/devise.fr.yml +3 -2
- data/config/locales/devise.it.yml +1 -0
- data/config/locales/devise.nb.yml +1 -0
- data/config/locales/devise.nl.yml +1 -0
- data/config/locales/devise.pl.yml +64 -0
- data/config/locales/devise.pt-BR.yml +1 -0
- data/config/locales/devise.ru.yml +1 -0
- data/config/locales/flash.en.yml +9 -0
- data/config/locales/flash.pl.yml +106 -0
- data/config/locales/formtastic.en.yml +2 -0
- data/config/locales/formtastic.fr.yml +3 -1
- data/config/locales/formtastic.pl.yml +105 -0
- data/config/routes.rb +46 -38
- data/features/api/accounts.feature +25 -0
- data/features/api/authentication.feature +19 -0
- data/features/api/authorization/accounts.feature +125 -0
- data/features/api/authorization/content_assets.feature +147 -0
- data/features/api/authorization/content_entries.feature +202 -0
- data/features/api/authorization/content_types.feature +237 -0
- data/features/api/authorization/current_site.feature +30 -0
- data/features/api/authorization/memberships.feature +225 -0
- data/features/api/authorization/pages.feature +187 -0
- data/features/api/authorization/sites.feature +213 -0
- data/features/api/authorization/snippets.feature +179 -0
- data/features/api/authorization/theme_assets.feature +185 -0
- data/features/api/authorization/translations.feature +253 -0
- data/features/api/content_entries.feature +169 -0
- data/features/api/content_types.feature +156 -0
- data/features/api/editable_elements.feature +190 -0
- data/features/api/entries_custom_fields.feature +150 -0
- data/features/api/pages.feature +72 -0
- data/features/backoffice/authorization/account_settings.feature +28 -0
- data/features/backoffice/authorization/content_type.feature +35 -0
- data/features/backoffice/authorization/current_site.feature +53 -0
- data/features/backoffice/authorization/inline_front_end_editing.feature +46 -0
- data/features/backoffice/authorization/pages.feature +95 -0
- data/features/backoffice/authorization/theme_assets.feature +50 -0
- data/features/backoffice/content_types/edit.feature +20 -0
- data/features/backoffice/content_types/has_many.feature +60 -0
- data/features/backoffice/content_types/many_to_many.feature +42 -0
- data/features/backoffice/contents.feature +70 -0
- data/features/backoffice/editable_elements.feature +22 -0
- data/features/backoffice/login.feature +33 -0
- data/features/backoffice/mounting.feature +13 -0
- data/features/backoffice/pages.feature +35 -0
- data/features/backoffice/site.feature +45 -0
- data/features/backoffice/snippets.feature +39 -0
- data/features/backoffice/theme_assets.feature +72 -0
- data/features/backoffice/translations.feature +44 -0
- data/features/public/basic.feature +30 -0
- data/features/public/contact_form.feature +78 -0
- data/features/public/content_entries.feature +56 -0
- data/features/public/editable_elements.feature +138 -0
- data/features/public/has_many.feature +8 -0
- data/features/public/inheritance.feature +157 -0
- data/features/public/inline_front_end_editing.feature +26 -0
- data/features/public/many_to_many.feature +64 -0
- data/features/public/pagination.feature +8 -0
- data/features/public/robots.feature +22 -0
- data/features/public/sitemap.feature +74 -0
- data/features/public/snippets.feature +21 -0
- data/features/public/tablerow.feature +42 -0
- data/features/step_definitions/api_steps.rb +176 -0
- data/features/step_definitions/backoffice/mounting_steps.rb +22 -0
- data/features/step_definitions/backoffice_steps.rb +43 -0
- data/features/step_definitions/content_assets_steps.rb +12 -0
- data/features/step_definitions/content_types_steps.rb +106 -0
- data/features/step_definitions/current_site_steps.rb +43 -0
- data/features/step_definitions/editable_elements_steps.rb +24 -0
- data/features/step_definitions/membership_steps.rb +19 -0
- data/features/step_definitions/more_web_steps.rb +96 -0
- data/features/step_definitions/page_steps.rb +110 -0
- data/features/step_definitions/pagination_steps.rb +35 -0
- data/features/step_definitions/pickle_steps.rb +100 -0
- data/features/step_definitions/relationships_steps.rb +107 -0
- data/features/step_definitions/site_steps.rb +100 -0
- data/features/step_definitions/snippet_steps.rb +37 -0
- data/features/step_definitions/theme_asset_steps.rb +64 -0
- data/features/step_definitions/translation_steps.rb +7 -0
- data/features/step_definitions/web_steps.rb +197 -0
- data/features/step_definitions/within_steps.rb +14 -0
- data/features/support/cleaner.rb +4 -0
- data/features/support/env.rb +82 -0
- data/features/support/factory_girl.rb +2 -0
- data/features/support/http.rb +22 -0
- data/features/support/paths.rb +62 -0
- data/features/support/pickle.rb +24 -0
- data/features/support/selectors.rb +57 -0
- data/lib/generators/locomotive/install/install_generator.rb +5 -0
- data/lib/generators/locomotive/install/templates/dragonfly.rb +2 -3
- data/lib/generators/locomotive/install/templates/locomotive.rb +2 -2
- data/lib/locomotive.rb +13 -2
- data/lib/locomotive/action_controller/locale_helpers.rb +1 -1
- data/lib/locomotive/action_controller/public_responder.rb +17 -1
- data/lib/locomotive/action_controller/responder.rb +3 -2
- data/lib/locomotive/action_controller/url_helpers.rb +1 -1
- data/lib/locomotive/cancan.rb +22 -0
- data/lib/locomotive/carrierwave.rb +2 -0
- data/lib/locomotive/carrierwave/asset.rb +17 -7
- data/lib/locomotive/configuration.rb +6 -2
- data/lib/locomotive/core_ext.rb +5 -4
- data/lib/locomotive/custom_fields.rb +11 -0
- data/lib/locomotive/dependencies.rb +3 -3
- data/lib/locomotive/dragonfly.rb +1 -1
- data/lib/locomotive/engine.rb +24 -8
- data/lib/locomotive/formtastic.rb +26 -1
- data/lib/locomotive/liquid/drops/current_user.rb +2 -2
- data/lib/locomotive/liquid/drops/page.rb +5 -1
- data/lib/locomotive/liquid/filters/date.rb +19 -0
- data/lib/locomotive/liquid/filters/html.rb +7 -7
- data/lib/locomotive/liquid/filters/misc.rb +5 -7
- data/lib/locomotive/liquid/filters/text.rb +11 -0
- data/lib/locomotive/liquid/filters/translate.rb +16 -0
- data/lib/locomotive/liquid/patches.rb +21 -0
- data/lib/locomotive/liquid/tags/consume.rb +13 -2
- data/lib/locomotive/liquid/tags/csrf.rb +3 -3
- data/lib/locomotive/liquid/tags/editable/base.rb +11 -4
- data/lib/locomotive/liquid/tags/inline_editor.rb +5 -2
- data/lib/locomotive/liquid/tags/locale_switcher.rb +12 -4
- data/lib/locomotive/liquid/tags/nav.rb +1 -1
- data/lib/locomotive/liquid/tags/paginate.rb +4 -1
- data/lib/locomotive/liquid/tags/seo.rb +2 -2
- data/lib/locomotive/liquid/tags/snippet.rb +10 -2
- data/lib/locomotive/liquid/tags/with_scope.rb +11 -0
- data/lib/locomotive/middlewares.rb +2 -1
- data/lib/locomotive/middlewares/fonts.rb +2 -2
- data/lib/locomotive/middlewares/permalink.rb +22 -0
- data/lib/locomotive/misc/api_documentation.rb +114 -0
- data/lib/locomotive/misc/api_documentation/bootstrap.html.haml +196 -0
- data/lib/locomotive/mongoid.rb +2 -1
- data/lib/locomotive/mongoid/document.rb +3 -2
- data/lib/locomotive/mongoid/liquid.rb +39 -0
- data/lib/locomotive/mongoid/presenter.rb +73 -0
- data/lib/locomotive/presentable.rb +216 -0
- data/lib/locomotive/render.rb +76 -24
- data/lib/locomotive/routing/site_dispatcher.rb +15 -4
- data/lib/locomotive/version.rb +1 -1
- data/lib/tasks/development.rake +29 -0
- data/lib/tasks/locomotive.rake +58 -7
- data/spec/cells/locomotive/global_actions_spec.rb +98 -0
- data/spec/cells/locomotive/main_menu_cell_spec.rb +99 -0
- data/spec/cells/locomotive/settings_menu_cell_spec.rb +107 -0
- data/spec/dummy/Rakefile +7 -0
- data/spec/dummy/app/assets/javascripts/application.js +9 -0
- data/spec/dummy/app/assets/javascripts/locomotive_misc.js.coffee +2 -0
- data/spec/dummy/app/assets/stylesheets/application.css +7 -0
- data/spec/dummy/app/cells/locomotive/main_menu_cell.rb +9 -0
- data/spec/dummy/app/controllers/application_controller.rb +3 -0
- data/spec/dummy/app/controllers/foo_controller.rb +10 -0
- data/spec/dummy/app/helpers/application_helper.rb +2 -0
- data/spec/dummy/app/models/foo.rb +7 -0
- data/spec/dummy/app/views/foo/index.html.haml +1 -0
- data/spec/dummy/app/views/layouts/application.html.erb +14 -0
- data/spec/dummy/app/views/locomotive/shared/_main_app_head.html.haml +1 -0
- data/spec/dummy/config.ru +4 -0
- data/spec/dummy/config/application.rb +57 -0
- data/spec/dummy/config/boot.rb +20 -0
- data/spec/dummy/config/environment.rb +5 -0
- data/spec/dummy/config/environments/development.rb +38 -0
- data/spec/dummy/config/environments/production.rb +60 -0
- data/spec/dummy/config/environments/test.rb +39 -0
- data/spec/dummy/config/initializers/carrierwave.rb +8 -0
- data/spec/dummy/config/initializers/devise.rb +190 -0
- data/spec/dummy/config/initializers/dragonfly.rb +21 -0
- data/spec/dummy/config/initializers/formtastic.rb +5 -0
- data/spec/dummy/config/initializers/haml.rb +2 -0
- data/spec/dummy/config/initializers/locomotive.rb +80 -0
- data/spec/dummy/config/initializers/secret_token.rb +7 -0
- data/spec/dummy/config/initializers/session_store.rb +8 -0
- data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/spec/dummy/config/locales/en.yml +10 -0
- data/spec/dummy/config/locales/fr.yml +10 -0
- data/spec/dummy/config/mongoid.yml +23 -0
- data/spec/dummy/config/routes.rb +9 -0
- data/spec/dummy/public/404.html +26 -0
- data/spec/dummy/public/422.html +26 -0
- data/spec/dummy/public/500.html +26 -0
- data/spec/dummy/script/rails +6 -0
- data/spec/fixtures/assets/5k.png +0 -0
- data/spec/fixtures/assets/5k_2.png +0 -0
- data/spec/fixtures/assets/application.js +1 -0
- data/spec/fixtures/assets/main.css +1 -0
- data/spec/fixtures/assets/wrong.txt +1 -0
- data/spec/fixtures/images/logo1.jpg +0 -0
- data/spec/fixtures/images/logo2.jpg +0 -0
- data/spec/lib/core_ext_spec.rb +37 -0
- data/spec/lib/locomotive/configuration_spec.rb +26 -0
- data/spec/lib/locomotive/httparty/webservice_spec.rb +33 -0
- data/spec/lib/locomotive/liquid/drops/content_entry_spec.rb +46 -0
- data/spec/lib/locomotive/liquid/drops/current_user.rb +63 -0
- data/spec/lib/locomotive/liquid/drops/page_spec.rb +143 -0
- data/spec/lib/locomotive/liquid/drops/site_spec.rb +32 -0
- data/spec/lib/locomotive/liquid/filters/date_spec.rb +68 -0
- data/spec/lib/locomotive/liquid/filters/html_spec.rb +224 -0
- data/spec/lib/locomotive/liquid/filters/misc_spec.rb +56 -0
- data/spec/lib/locomotive/liquid/filters/resize_spec.rb +61 -0
- data/spec/lib/locomotive/liquid/filters/text_spec.rb +32 -0
- data/spec/lib/locomotive/liquid/filters/translate_spec.rb +50 -0
- data/spec/lib/locomotive/liquid/tags/consume_spec.rb +52 -0
- data/spec/lib/locomotive/liquid/tags/csrf_spec.rb +26 -0
- data/spec/lib/locomotive/liquid/tags/editable/short_text_spec.rb +46 -0
- data/spec/lib/locomotive/liquid/tags/extends_spec.rb +58 -0
- data/spec/lib/locomotive/liquid/tags/locale_switcher_spec.rb +47 -0
- data/spec/lib/locomotive/liquid/tags/nav_spec.rb +142 -0
- data/spec/lib/locomotive/liquid/tags/paginate_spec.rb +139 -0
- data/spec/lib/locomotive/liquid/tags/seo_spec.rb +135 -0
- data/spec/lib/locomotive/liquid/tags/with_scope_spec.rb +49 -0
- data/spec/lib/locomotive/presentable_spec.rb +184 -0
- data/spec/lib/locomotive/render_spec.rb +209 -0
- data/spec/lib/locomotive/routing/site_dispatcher_spec.rb +258 -0
- data/spec/mailers/locomotive/notifications_spec.rb +57 -0
- data/spec/models/locomotive/ability_spec.rb +132 -0
- data/spec/models/locomotive/account_spec.rb +87 -0
- data/spec/models/locomotive/content_asset_spec.rb +46 -0
- data/spec/models/locomotive/content_entry_spec.rb +269 -0
- data/spec/models/locomotive/content_type_spec.rb +391 -0
- data/spec/models/locomotive/editable_control_spec.rb +70 -0
- data/spec/models/locomotive/editable_file_spec.rb +95 -0
- data/spec/models/locomotive/editable_long_text_spec.rb +50 -0
- data/spec/models/locomotive/editable_short_text_spec.rb +174 -0
- data/spec/models/locomotive/extensions/page/editable_elements_spec.rb +67 -0
- data/spec/models/locomotive/extensions/page/redirect_spec.rb +28 -0
- data/spec/models/locomotive/extensions/page/render_spec.rb +88 -0
- data/spec/models/locomotive/extensions/site/locales_spec.rb +52 -0
- data/spec/models/locomotive/extensions/site/subdomain_domains_spec.rb +25 -0
- data/spec/models/locomotive/membership_spec.rb +61 -0
- data/spec/models/locomotive/page_spec.rb +427 -0
- data/spec/models/locomotive/site_spec.rb +176 -0
- data/spec/models/locomotive/snippet_spec.rb +77 -0
- data/spec/models/locomotive/theme_asset_spec.rb +128 -0
- data/spec/requests/seo_trailing_slash_spec.rb +25 -0
- data/spec/support/carrierwave.rb +50 -0
- data/spec/support/cells.rb +3 -0
- data/spec/support/controller.rb +32 -0
- data/spec/support/factories.rb +156 -0
- data/spec/support/locomotive.rb +37 -0
- data/spec/support/matchers.rb +127 -0
- data/spec/support/middlewares.rb +0 -0
- data/vendor/assets/fonts/locomotive/fontawesome-webfont.eot +0 -0
- data/vendor/assets/fonts/locomotive/fontawesome-webfont.svg +255 -0
- data/vendor/assets/fonts/locomotive/fontawesome-webfont.ttf +0 -0
- data/vendor/assets/fonts/locomotive/fontawesome-webfont.woff +0 -0
- data/vendor/assets/javascripts/locomotive/backbone.modelbinding.js +34 -9
- data/vendor/assets/javascripts/locomotive/backbone.sync.js +2 -2
- data/vendor/assets/javascripts/locomotive/form_submit_notification.js +2 -2
- data/vendor/assets/javascripts/locomotive/growl.js +10 -10
- data/vendor/assets/javascripts/locomotive/menu_toggler.js +8 -4
- data/vendor/assets/javascripts/locomotive/slugify.js +21 -5
- data/vendor/assets/stylesheets/locomotive/font-awesome.scss +329 -0
- data/vendor/assets/stylesheets/locomotive/jquery/{ui.css → ui.css.scss} +19 -19
- metadata +538 -195
- data/app/assets/images/locomotive/background/light.png +0 -0
- data/app/assets/images/locomotive/datepicker/ui-widget-left-icon.png +0 -0
- data/app/assets/images/locomotive/datepicker/ui-widget-right-icon.png +0 -0
- data/app/assets/images/locomotive/form/folded-arrow-off.png +0 -0
- data/app/assets/images/locomotive/form/folded-arrow-on.png +0 -0
- data/app/assets/images/locomotive/form/icons/drag.png +0 -0
- data/app/assets/images/locomotive/form/icons/edit.png +0 -0
- data/app/assets/images/locomotive/form/icons/error.png +0 -0
- data/app/assets/images/locomotive/form/icons/spinner.gif +0 -0
- data/app/assets/images/locomotive/form/icons/trash.png +0 -0
- data/app/assets/images/locomotive/form/pen.png +0 -0
- data/app/assets/images/locomotive/form/spinner.gif +0 -0
- data/app/assets/images/locomotive/icons/actions.png +0 -0
- data/app/assets/images/locomotive/icons/asset_add.png +0 -0
- data/app/assets/images/locomotive/icons/asset_switch.png +0 -0
- data/app/assets/images/locomotive/icons/membership_edit.png +0 -0
- data/app/assets/images/locomotive/icons/membership_lock.png +0 -0
- data/app/assets/images/locomotive/inline_editor/back.png +0 -0
- data/app/assets/images/locomotive/list/icons/cross.png +0 -0
- data/app/assets/images/locomotive/list/icons/drag.png +0 -0
- data/app/assets/images/locomotive/list/icons/move.png +0 -0
- data/app/assets/images/locomotive/list/icons/move_off.png +0 -0
- data/app/assets/images/locomotive/list/icons/node_closed.png +0 -0
- data/app/assets/images/locomotive/list/icons/node_open.png +0 -0
- data/app/assets/images/locomotive/list/icons/pencil.png +0 -0
- data/app/assets/images/locomotive/list/icons/pencil_off.png +0 -0
- data/app/assets/images/locomotive/list/icons/popup.png +0 -0
- data/app/assets/images/locomotive/list/icons/popup_off.png +0 -0
- data/app/assets/images/locomotive/list/icons/redirect.png +0 -0
- data/app/assets/images/locomotive/list/icons/states.png +0 -0
- data/app/assets/images/locomotive/list/icons/template.png +0 -0
- data/app/assets/images/locomotive/list/icons/toggle.png +0 -0
- data/app/assets/images/locomotive/list/icons/toggle_off.png +0 -0
- data/app/assets/images/locomotive/list/icons/trash.png +0 -0
- data/app/assets/images/locomotive/list/icons/trash_off.png +0 -0
- data/app/assets/images/locomotive/menu/icons.png +0 -0
- data/app/assets/images/locomotive/menu/popup/add.png +0 -0
- data/app/assets/images/locomotive/menu/popup/bottom-right-corner.png +0 -0
- data/app/assets/images/locomotive/menu/popup/bullet.png +0 -0
- data/app/assets/images/locomotive/plugins/selectmenu/arrow.png +0 -0
- data/app/assets/images/locomotive/plugins/selectmenu/background.png +0 -0
- data/app/assets/images/locomotive/plugins/sites_picker_entry_bg.png +0 -0
- data/app/assets/images/locomotive/simple/light_bg.png +0 -0
- data/app/assets/images/locomotive/simple/wrapper_bg.png +0 -0
- data/app/assets/stylesheets/locomotive/backoffice/menu/_icons.css.scss +0 -30
- data/app/uploaders/locomotive/theme_uploader.rb +0 -19
- data/lib/locomotive/mongoid/model_extensions.rb +0 -1
- data/lib/tasks/cucumber.rake +0 -66
- data/vendor/assets/stylesheets/locomotive/jquery.css +0 -3
@@ -3,8 +3,9 @@
|
|
3
3
|
* and any sub-directories. You're free to add application-wide styles to this file and they'll appear at
|
4
4
|
* the top of the compiled file, but it's generally better to create a new file per style scope.
|
5
5
|
*= require locomotive/blueprint/screen.css
|
6
|
-
*= require locomotive/jquery
|
6
|
+
*= require locomotive/jquery/ui.css
|
7
7
|
*= require locomotive/toggle.css
|
8
|
+
*= require locomotive/font-awesome
|
8
9
|
*= require locomotive/backoffice/dialog_changes.css
|
9
10
|
*= require locomotive/backoffice/content_assets.css
|
10
11
|
*= require_tree ./shared
|
@@ -11,7 +11,7 @@
|
|
11
11
|
line-height: 22px;
|
12
12
|
|
13
13
|
margin: 0 5px;
|
14
|
-
padding:
|
14
|
+
padding: 0px 14px;
|
15
15
|
|
16
16
|
@include border-radius(14px);
|
17
17
|
@include background-image(linear-gradient(#303138, #1e1e24));
|
@@ -25,16 +25,6 @@
|
|
25
25
|
text-decoration: none;
|
26
26
|
@include single-text-shadow(rgba(0, 0, 0, 1), 1px, 1px, 1px);
|
27
27
|
|
28
|
-
em {
|
29
|
-
display: inline-block;
|
30
|
-
position: relative;
|
31
|
-
background: transparent image-url("locomotive/menu/icons.png") no-repeat 0 0px;
|
32
|
-
height: 11px;
|
33
|
-
width: 11px;
|
34
|
-
top: 2px;
|
35
|
-
left: -5px;
|
36
|
-
}
|
37
|
-
|
38
28
|
&:hover {
|
39
29
|
border: 1px solid rgba(255, 255, 255, 0.5);
|
40
30
|
border-top: 1px solid rgba(255, 255, 255, 0.4);
|
@@ -3,5 +3,6 @@
|
|
3
3
|
* and any sub-directories. You're free to add application-wide styles to this file and they'll appear at
|
4
4
|
* the top of the compiled file, but it's generally better to create a new file per style scope.
|
5
5
|
*= require locomotive/blueprint/screen.css
|
6
|
+
*= require locomotive/font-awesome
|
6
7
|
*= require_tree ./not_logged_in
|
7
8
|
*/
|
@@ -4,7 +4,12 @@
|
|
4
4
|
@import "compass/css3/text-shadow";
|
5
5
|
@import "../backoffice/buttons";
|
6
6
|
|
7
|
-
|
7
|
+
html { height: 100%; }
|
8
|
+
|
9
|
+
body {
|
10
|
+
background: #000 image-url("locomotive/background/body.png") repeat 0 0;
|
11
|
+
height: 100%;
|
12
|
+
}
|
8
13
|
|
9
14
|
div.application-message {
|
10
15
|
font-size: 1.2em;
|
@@ -25,17 +30,19 @@ div#flash-notice {
|
|
25
30
|
}
|
26
31
|
|
27
32
|
#wrapper {
|
28
|
-
background
|
29
|
-
|
33
|
+
@include background-image(linear-gradient(top, rgba(102, 102, 115, 0.3), rgba(30, 30, 35, 0.3) 252px, rgba(30, 30, 35, 0.3)));
|
34
|
+
height: 100%;
|
30
35
|
}
|
31
36
|
|
32
37
|
#light {
|
33
|
-
background
|
34
|
-
|
35
|
-
padding-top: 100px;
|
38
|
+
@include background-image(radial-gradient(top, rgba(255, 255, 255, 0.2), rgba(95, 95, 105, 0.3) 240px, rgba(30, 30, 35, 0.1) 370px));
|
39
|
+
height: 100%;
|
36
40
|
}
|
37
41
|
|
38
42
|
#panel {
|
43
|
+
position: relative;
|
44
|
+
top: 100px;
|
45
|
+
|
39
46
|
width: 346px;
|
40
47
|
padding: 0px;
|
41
48
|
|
@@ -110,11 +117,13 @@ div#flash-notice {
|
|
110
117
|
width: auto;
|
111
118
|
line-height: 14px;
|
112
119
|
margin: 0px;
|
113
|
-
padding: 3px
|
120
|
+
padding: 3px 8px 4px 8px;
|
114
121
|
|
115
122
|
@include box-shadow(rgba(0, 0, 0, 0.4) 2px 2px 2px 0);
|
116
123
|
@include border-radius(3px);
|
117
|
-
background: #cd0f19
|
124
|
+
background: #cd0f19;
|
125
|
+
|
126
|
+
&:before { font-family: FontAwesome; content: "\f071\00a0\00a0"; }
|
118
127
|
|
119
128
|
color: #fff !important;
|
120
129
|
font-size: 12px;
|
@@ -44,15 +44,20 @@
|
|
44
44
|
}
|
45
45
|
|
46
46
|
@mixin editable {
|
47
|
-
padding: 2px
|
47
|
+
padding: 2px 6px 2px 6px;
|
48
48
|
color: #1e1f26;
|
49
49
|
outline: none;
|
50
50
|
cursor: pointer;
|
51
51
|
|
52
|
+
&:after { font-family: FontAwesome; color: #e8e1ad; content: "\00a0"; }
|
53
|
+
|
52
54
|
&:hover {
|
53
55
|
text-decoration: none;
|
54
|
-
background: #fffbe5
|
56
|
+
background: #fffbe5;
|
57
|
+
|
55
58
|
border-bottom: 1px dotted #efe4a5;
|
59
|
+
|
60
|
+
&:after { font-family: FontAwesome; color: #e8e1ad; content: "\00a0\00a0\f040"; }
|
56
61
|
}
|
57
62
|
}
|
58
63
|
|
@@ -78,49 +83,24 @@
|
|
78
83
|
padding-left: 10px;
|
79
84
|
}
|
80
85
|
|
81
|
-
a.edit, a.
|
82
|
-
|
83
|
-
|
84
|
-
height: 16px;
|
85
|
-
|
86
|
-
position: relative;
|
87
|
-
top: 4px;
|
88
|
-
|
89
|
-
outline: none;
|
90
|
-
text-indent: -9999px;
|
86
|
+
a.edit, a.drag, a.remove, a.toggle {
|
87
|
+
@include icon-button;
|
88
|
+
}
|
91
89
|
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
background-image: image-url("locomotive/list/icons/pencil.png");
|
96
|
-
}
|
97
|
-
}
|
90
|
+
a.edit:hover {
|
91
|
+
background: #f0c334;
|
92
|
+
}
|
98
93
|
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
background-image: image-url("locomotive/list/icons/trash.png");
|
103
|
-
}
|
104
|
-
}
|
94
|
+
a.drag:hover {
|
95
|
+
background: #25a7ed;
|
96
|
+
}
|
105
97
|
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
background-image: image-url("locomotive/list/icons/toggle.png");
|
110
|
-
}
|
111
|
-
&.open {
|
112
|
-
@include rotate(180deg);
|
113
|
-
}
|
114
|
-
@include single-transition(transform, 0.5s);
|
115
|
-
}
|
98
|
+
a.remove:hover {
|
99
|
+
background: #e72635;
|
100
|
+
}
|
116
101
|
|
117
|
-
|
118
|
-
|
119
|
-
background: transparent image-url("locomotive/list/icons/move_off.png") repeat 0 0;
|
120
|
-
&:hover {
|
121
|
-
background-image: image-url("locomotive/list/icons/move.png");
|
122
|
-
}
|
123
|
-
}
|
102
|
+
a.toggle:hover {
|
103
|
+
background: #f3c526;
|
124
104
|
}
|
125
105
|
}
|
126
106
|
|
@@ -5,31 +5,25 @@
|
|
5
5
|
position: relative;
|
6
6
|
|
7
7
|
padding-left: 10px !important;
|
8
|
-
padding-right:
|
8
|
+
padding-right: 10px !important;
|
9
9
|
|
10
10
|
cursor: pointer;
|
11
11
|
|
12
|
-
.
|
13
|
-
|
14
|
-
|
15
|
-
right: 7px;
|
16
|
-
|
17
|
-
height: 7px;
|
18
|
-
width: 12px;
|
19
|
-
|
20
|
-
background: transparent image-url("locomotive/menu/icons.png") no-repeat 0px -16px;
|
12
|
+
.caret {
|
13
|
+
margin-left: 5px;
|
14
|
+
color: #fff;
|
21
15
|
}
|
22
16
|
|
23
17
|
img.flag {
|
24
|
-
|
18
|
+
vertical-align: middle;
|
25
19
|
|
26
20
|
position: relative;
|
27
|
-
top: 1px;
|
21
|
+
top: -1px;
|
28
22
|
|
29
23
|
width: 20px;
|
30
24
|
height: 20px;
|
31
25
|
|
32
|
-
margin-right:
|
26
|
+
margin-right: 2px;
|
33
27
|
}
|
34
28
|
|
35
29
|
span.text {
|
@@ -74,6 +68,10 @@
|
|
74
68
|
text-transform: uppercase;
|
75
69
|
}
|
76
70
|
|
71
|
+
&.selected {
|
72
|
+
display: none;
|
73
|
+
}
|
74
|
+
|
77
75
|
&:last-child {
|
78
76
|
border-bottom: 0px;
|
79
77
|
@include box-shadow(transparent 0 0 0 0);
|
@@ -1,7 +1,7 @@
|
|
1
1
|
#content-locale-picker
|
2
2
|
%ul
|
3
3
|
- @locales.each do |locale|
|
4
|
-
%li{ :'data-locale' => locale }
|
5
|
-
=
|
4
|
+
%li{ :'data-locale' => locale, :class => "#{'selected' if @locale == locale}" }
|
5
|
+
= flag_tag(locale)
|
6
6
|
|
7
7
|
%span.text= locale
|
@@ -1,14 +1,18 @@
|
|
1
1
|
module Locomotive
|
2
2
|
class ContentLocalePickerCell < Cell::Base
|
3
3
|
|
4
|
+
helper do
|
5
|
+
include ::Locomotive::BaseHelper
|
6
|
+
end
|
7
|
+
|
4
8
|
def show(args)
|
5
9
|
site = args[:site]
|
6
|
-
locale
|
10
|
+
@locale = args[:locale].to_s
|
7
11
|
|
8
12
|
if site.locales.empty? || site.locales.size < 2
|
9
13
|
''
|
10
14
|
else
|
11
|
-
@locales = site.locales
|
15
|
+
@locales = site.locales
|
12
16
|
render
|
13
17
|
end
|
14
18
|
end
|
@@ -24,7 +24,7 @@ module Locomotive
|
|
24
24
|
add :switch, :url => '#', :id => 'sites-picker-link'
|
25
25
|
end
|
26
26
|
|
27
|
-
add :help, :url => 'http://doc.locomotivecms.com/templates/basics', :class => 'tutorial', :id => 'help'
|
27
|
+
add :help, :url => 'http://doc.locomotivecms.com/templates/basics', :class => 'tutorial', :id => 'help', :target => '_blank'
|
28
28
|
add :logout, :url => destroy_locomotive_session_url, :data => { :confirm => t('locomotive.messages.confirm') }, :method => :delete
|
29
29
|
end
|
30
30
|
|
@@ -4,8 +4,8 @@ module Locomotive
|
|
4
4
|
protected
|
5
5
|
|
6
6
|
def build_list
|
7
|
-
add :contents, :url => pages_url
|
8
|
-
add :settings, :url => edit_current_site_url
|
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
|
@@ -0,0 +1,70 @@
|
|
1
|
+
module Locomotive
|
2
|
+
module Api
|
3
|
+
class AccountsController < Api::BaseController
|
4
|
+
|
5
|
+
load_and_authorize_resource class: Locomotive::Account
|
6
|
+
|
7
|
+
def index
|
8
|
+
respond_with(@accounts)
|
9
|
+
end
|
10
|
+
|
11
|
+
def show
|
12
|
+
respond_with(@account)
|
13
|
+
end
|
14
|
+
|
15
|
+
def create
|
16
|
+
@account.from_presenter(params[:account])
|
17
|
+
@account.save
|
18
|
+
respond_with(@account)
|
19
|
+
end
|
20
|
+
|
21
|
+
def destroy
|
22
|
+
@account.destroy
|
23
|
+
respond_with(@account)
|
24
|
+
end
|
25
|
+
|
26
|
+
protected
|
27
|
+
|
28
|
+
def self.description
|
29
|
+
{
|
30
|
+
overall: %{Manage the accounts (only if logged as an admin) no matter the site they belong to},
|
31
|
+
actions: {
|
32
|
+
index: {
|
33
|
+
description: %{Return all the accounts},
|
34
|
+
example: {
|
35
|
+
command: %{curl 'http://mysite.com/locomotive/api/accounts.json?auth_token=dtsjkqs1TJrWiSiJt2gg'},
|
36
|
+
response: %(TODO)
|
37
|
+
}
|
38
|
+
},
|
39
|
+
show: {
|
40
|
+
description: %{Return the attributes of an account},
|
41
|
+
response: Locomotive::AccountPresenter.getters_to_hash,
|
42
|
+
example: {
|
43
|
+
command: %{curl 'http://mysite.com/locomotive/api/accounts/4244af4ef0000002.json?auth_token=dtsjkqs1TJrWiSiJt2gg'},
|
44
|
+
response: %(TODO)
|
45
|
+
}
|
46
|
+
},
|
47
|
+
create: {
|
48
|
+
description: %{Create an account},
|
49
|
+
params: Locomotive::AccountPresenter.setters_to_hash,
|
50
|
+
example: {
|
51
|
+
command: %{curl -d '...' 'http://mysite.com/locomotive/api/accounts.json?auth_token=dtsjkqs1TJrWiSiJt2gg'},
|
52
|
+
response: %(TODO)
|
53
|
+
}
|
54
|
+
},
|
55
|
+
destroy: {
|
56
|
+
description: %{Delete an account},
|
57
|
+
example: {
|
58
|
+
command: %{curl -X DELETE 'http://mysite.com/locomotive/api/accounts.json?auth_token=dtsjkqs1TJrWiSiJt2gg'},
|
59
|
+
response: %(TODO)
|
60
|
+
}
|
61
|
+
}
|
62
|
+
}
|
63
|
+
}
|
64
|
+
end
|
65
|
+
|
66
|
+
end
|
67
|
+
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
@@ -41,6 +41,14 @@ module Locomotive
|
|
41
41
|
self.setup_i18n_fallbacks
|
42
42
|
end
|
43
43
|
|
44
|
+
def self.cancan_resource_class
|
45
|
+
Locomotive::Api::CanCan::ControllerResource
|
46
|
+
end
|
47
|
+
|
48
|
+
def self.description
|
49
|
+
{ overall: 'No documentation', actions: {} }
|
50
|
+
end
|
51
|
+
|
44
52
|
end
|
45
53
|
end
|
46
54
|
end
|
@@ -2,31 +2,29 @@ module Locomotive
|
|
2
2
|
module Api
|
3
3
|
class ContentAssetsController < BaseController
|
4
4
|
|
5
|
-
load_and_authorize_resource :
|
5
|
+
load_and_authorize_resource class: Locomotive::ContentAsset, through: :current_site
|
6
6
|
|
7
7
|
def index
|
8
|
-
@content_assets = current_site.content_assets
|
9
8
|
respond_with(@content_assets)
|
10
9
|
end
|
11
10
|
|
12
11
|
def show
|
13
|
-
@content_asset = current_site.content_assets.find(params[:id])
|
14
12
|
respond_with(@content_asset)
|
15
13
|
end
|
16
14
|
|
17
15
|
def create
|
18
|
-
@content_asset
|
19
|
-
|
16
|
+
@content_asset.from_presenter(params[:content_asset])
|
17
|
+
@content_asset.save
|
18
|
+
respond_with @content_asset, location: main_app.locomotive_api_content_assets_url
|
20
19
|
end
|
21
20
|
|
22
21
|
def update
|
23
|
-
@content_asset
|
24
|
-
@content_asset.
|
25
|
-
respond_with @content_asset, :
|
22
|
+
@content_asset.from_presenter(params[:content_asset])
|
23
|
+
@content_asset.save
|
24
|
+
respond_with @content_asset, location: main_app.locomotive_api_content_assets_url
|
26
25
|
end
|
27
26
|
|
28
27
|
def destroy
|
29
|
-
@content_asset = current_site.content_assets.find(params[:id])
|
30
28
|
@content_asset.destroy
|
31
29
|
respond_with @content_asset
|
32
30
|
end
|