locomotivecms 3.0.0.pre.alpha.3 → 3.0.0.pre.beta.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +15 -8
- data/app/api/locomotive/api.rb +1 -0
- data/app/api/locomotive/api/entities/content_entry_entity.rb +1 -0
- data/app/api/locomotive/api/entities/content_type_entity.rb +2 -1
- data/app/api/locomotive/api/entities/site_entity.rb +4 -0
- data/app/api/locomotive/api/entities/theme_asset_entity.rb +3 -3
- data/app/api/locomotive/api/forms/base_form.rb +0 -6
- data/app/api/locomotive/api/forms/content_type_field_form.rb +6 -10
- data/app/api/locomotive/api/forms/content_type_form.rb +26 -4
- data/app/api/locomotive/api/middlewares/params_decoder_middleware.rb +91 -0
- data/app/api/locomotive/api/resources/content_type_resource.rb +7 -2
- data/app/api/locomotive/api/resources/current_site_resource.rb +10 -2
- data/app/assets/images/locomotive/favicon.png +0 -0
- data/app/assets/javascripts/locomotive/not_logged_in.js.coffee +11 -1
- data/app/assets/javascripts/locomotive/views/application_view.js.coffee +0 -76
- data/app/assets/javascripts/locomotive/views/content_assets/edit_image_view.js.coffee +3 -1
- data/app/assets/javascripts/locomotive/views/dashboard/show_view.js.coffee +33 -1
- data/app/assets/javascripts/locomotive/views/developers_documentation/show_view.js.coffee +9 -0
- data/app/assets/javascripts/locomotive/views/editable_elements/edit_view.js.coffee +3 -1
- data/app/assets/javascripts/locomotive/views/editable_elements/index_view.js.coffee +11 -11
- data/app/assets/javascripts/locomotive/views/inputs/text_view.js.coffee +16 -0
- data/app/assets/javascripts/locomotive/views/pages/_form_view.js.coffee +0 -158
- data/app/assets/javascripts/locomotive/views/pages/edit_view.js.coffee +0 -41
- data/app/assets/javascripts/locomotive/views/public_submission_accounts/edit_view.js.coffee +7 -0
- data/app/assets/javascripts/locomotive/views/shared/form_view.js.coffee +11 -3
- data/app/assets/javascripts/locomotive/views/shared/list_view.js.coffee +4 -2
- data/app/assets/javascripts/locomotive/views/translations/index_view.js.coffee +5 -0
- data/app/assets/stylesheets/locomotive/application.scss +4 -0
- data/app/assets/stylesheets/locomotive/base/_fonts.scss +5 -5
- data/app/assets/stylesheets/locomotive/base/form/_base.scss +9 -1
- data/app/assets/stylesheets/locomotive/components/_activity_feed.scss +66 -0
- data/app/assets/stylesheets/locomotive/components/_content_assets.scss +27 -8
- data/app/assets/stylesheets/locomotive/components/_developers.scss +34 -0
- data/app/assets/stylesheets/locomotive/components/_error.scss +37 -0
- data/app/assets/stylesheets/locomotive/components/_list.scss +6 -0
- data/app/assets/stylesheets/locomotive/components/_main.scss +4 -0
- data/app/assets/stylesheets/locomotive/components/_misc.scss +1 -0
- data/app/assets/stylesheets/locomotive/components/_translations.scss +13 -0
- data/app/assets/stylesheets/locomotive/components/header/_base.scss +7 -2
- data/app/assets/stylesheets/locomotive/components/misc/_modal.scss +13 -0
- data/app/assets/stylesheets/locomotive/components/misc/_notify.scss +2 -2
- data/app/assets/stylesheets/locomotive/components/not_logged_in/_sign_in_and_up.scss +11 -1
- data/app/assets/stylesheets/locomotive/components/sidebar/_pages_tree.scss +2 -2
- data/app/assets/stylesheets/locomotive/error.scss +12 -0
- data/app/assets/stylesheets/locomotive/globals/_bootstrap.scss +1 -1
- data/app/assets/stylesheets/locomotive/globals/_mixins.scss +8 -4
- data/app/assets/stylesheets/locomotive/globals/_variables.scss +2 -0
- data/app/assets/stylesheets/locomotive/not_logged_in.scss +4 -0
- data/app/controllers/locomotive/accounts_controller.rb +6 -1
- data/app/controllers/locomotive/base_controller.rb +1 -1
- data/app/controllers/locomotive/concerns/exception_controller.rb +2 -1
- data/app/controllers/locomotive/concerns/site_dispatcher_controller.rb +2 -1
- data/app/controllers/locomotive/content_assets_controller.rb +2 -2
- data/app/controllers/locomotive/content_entries_controller.rb +2 -2
- data/app/controllers/locomotive/current_site_controller.rb +5 -1
- data/app/controllers/locomotive/custom_fields/select_options_controller.rb +1 -1
- data/app/controllers/locomotive/dashboard_controller.rb +2 -0
- data/app/controllers/locomotive/developers_documentation_controller.rb +11 -0
- data/app/controllers/locomotive/editable_elements_controller.rb +11 -10
- data/app/controllers/locomotive/errors_controller.rb +15 -0
- data/app/controllers/locomotive/pages_controller.rb +3 -3
- data/app/controllers/locomotive/public_submission_accounts_controller.rb +42 -0
- data/app/controllers/locomotive/translations_controller.rb +9 -23
- data/app/helpers/locomotive/base_helper.rb +25 -23
- data/app/helpers/locomotive/content_assets_helper.rb +8 -0
- data/app/helpers/locomotive/content_entries_helper.rb +13 -19
- data/app/helpers/locomotive/content_types_helper.rb +9 -12
- data/app/helpers/locomotive/custom_fields_helper.rb +1 -0
- data/app/helpers/locomotive/dashboard_helper.rb +91 -0
- data/app/helpers/locomotive/developers_documentation_helper.rb +32 -0
- data/app/helpers/locomotive/editable_elements_helper.rb +25 -14
- data/app/helpers/locomotive/errors_helper.rb +21 -0
- data/app/helpers/locomotive/my_account_helper.rb +10 -8
- data/app/helpers/locomotive/pages_helper.rb +1 -1
- data/app/helpers/locomotive/public_submission_accounts_helper.rb +11 -0
- data/app/helpers/locomotive/shared/accounts_helper.rb +2 -2
- data/app/helpers/locomotive/sites_helper.rb +15 -11
- data/app/helpers/locomotive/translations_helper.rb +21 -13
- data/app/inputs/locomotive/api_key_input.rb +2 -0
- data/app/inputs/locomotive/array_input.rb +8 -3
- data/app/inputs/locomotive/code_input.rb +1 -47
- data/app/inputs/locomotive/document_picker_input.rb +1 -0
- data/app/inputs/locomotive/rte_input.rb +2 -0
- data/app/inputs/locomotive/toggle_input.rb +2 -0
- data/app/models/locomotive/activity.rb +32 -0
- data/app/models/locomotive/concerns/content_entry/localized.rb +12 -1
- data/app/models/locomotive/concerns/content_type/entry_template.rb +52 -0
- data/app/models/locomotive/concerns/page/editable_elements.rb +0 -111
- data/app/models/locomotive/concerns/page/layout.rb +21 -6
- data/app/models/locomotive/concerns/site/access_points.rb +24 -3
- data/app/models/locomotive/concerns/site/locales.rb +7 -27
- data/app/models/locomotive/content_asset.rb +0 -4
- data/app/models/locomotive/content_entry.rb +10 -8
- data/app/models/locomotive/content_type.rb +12 -1
- data/app/models/locomotive/editable_element.rb +11 -106
- data/app/models/locomotive/editable_file.rb +6 -53
- data/app/models/locomotive/editable_model.rb +13 -0
- data/app/models/locomotive/editable_text.rb +0 -51
- data/app/models/locomotive/page.rb +31 -17
- data/app/models/locomotive/site.rb +12 -13
- data/app/models/locomotive/theme_asset.rb +0 -4
- data/app/models/locomotive/translation.rb +50 -35
- data/app/policies/locomotive/content_type_policy.rb +4 -0
- data/app/policies/locomotive/site_policy.rb +4 -0
- data/app/services/locomotive/concerns/activity_service.rb +27 -0
- data/app/services/locomotive/content_asset_service.rb +16 -2
- data/app/services/locomotive/content_entry_service.rb +77 -8
- data/app/services/locomotive/content_type_service.rb +6 -2
- data/app/services/locomotive/editable_element_service.rb +11 -4
- data/app/services/locomotive/membership_service.rb +20 -4
- data/app/services/locomotive/page_parsing_service.rb +94 -23
- data/app/services/locomotive/page_service.rb +61 -3
- data/app/services/locomotive/site_service.rb +43 -1
- data/app/services/locomotive/translation_service.rb +51 -0
- data/app/uploaders/locomotive/picture_uploader.rb +5 -1
- data/app/views/locomotive/accounts/{new.html.haml → new.html.slim} +0 -0
- data/app/views/locomotive/content_assets/{_dropzone.html.haml → _dropzone.html.slim} +4 -3
- data/app/views/locomotive/content_assets/{_list.html.haml → _list.html.slim} +11 -9
- data/app/views/locomotive/content_assets/{_nav.html.haml → _nav.html.slim} +5 -5
- data/app/views/locomotive/content_assets/{_search_form.html.haml → _search_form.html.slim} +1 -1
- data/app/views/locomotive/content_assets/edit_in_drawer.html.slim +27 -0
- data/app/views/locomotive/content_assets/{index.html.haml → index.html.slim} +4 -4
- data/app/views/locomotive/content_assets/{index_in_drawer.html.haml → index_in_drawer.html.slim} +1 -1
- data/app/views/locomotive/content_entries/{_entry.html.haml → _entry.html.slim} +3 -3
- data/app/views/locomotive/content_entries/{_list.html.haml → _list.html.slim} +9 -8
- data/app/views/locomotive/content_entries/{edit.html.haml → edit.html.slim} +5 -0
- data/app/views/locomotive/content_entries/form/{_actions.html.haml → _actions.html.slim} +0 -0
- data/app/views/locomotive/content_entries/form/{_advanced.html.haml → _advanced.html.slim} +0 -0
- data/app/views/locomotive/content_entries/form/{_main.html.haml → _main.html.slim} +0 -0
- data/app/views/locomotive/content_entries/form/{_panes.html.haml → _panes.html.slim} +0 -0
- data/app/views/locomotive/content_entries/form/{_seo.html.haml → _seo.html.slim} +0 -0
- data/app/views/locomotive/content_entries/form/_tabs.html.slim +13 -0
- data/app/views/locomotive/content_entries/{index.html.haml → index.html.slim} +22 -9
- data/app/views/locomotive/content_entries/{new.html.haml → new.html.slim} +0 -0
- data/app/views/locomotive/current_site/{_domain.html.haml → _domain.html.slim} +3 -3
- data/app/views/locomotive/current_site/{_locale.html.haml → _locale.html.slim} +4 -4
- data/app/views/locomotive/current_site/{_membership.html.haml → _membership.html.slim} +7 -6
- data/app/views/locomotive/current_site/{edit.html.haml → edit.html.slim} +1 -1
- data/app/views/locomotive/current_site/form/{_access_points.html.haml → _access_points.html.slim} +1 -0
- data/app/views/locomotive/current_site/form/{_advanced.html.haml → _advanced.html.slim} +0 -0
- data/app/views/locomotive/current_site/form/{_main.html.haml → _main.html.slim} +0 -0
- data/app/views/locomotive/current_site/form/{_panes.html.haml → _panes.html.slim} +0 -0
- data/app/views/locomotive/current_site/form/{_seo.html.haml → _seo.html.slim} +0 -0
- data/app/views/locomotive/current_site/form/_tabs.html.slim +14 -0
- data/app/views/locomotive/custom_fields/select_options/{_option.html.haml → _option.html.slim} +7 -7
- data/app/views/locomotive/custom_fields/select_options/{edit.html.haml → edit.html.slim} +0 -0
- data/app/views/locomotive/dashboard/show.html.slim +28 -0
- data/app/views/locomotive/developers_documentation/_api.html.slim +44 -0
- data/app/views/locomotive/developers_documentation/_wagon.html.slim +42 -0
- data/app/views/locomotive/developers_documentation/show.html.slim +11 -0
- data/app/views/locomotive/devise_mailer/reset_password_instructions.html.slim +12 -0
- data/app/views/locomotive/editable_elements/_edit.html.slim +52 -0
- data/app/views/locomotive/editable_elements/{_form.html.haml → _form.html.slim} +12 -3
- data/app/views/locomotive/editable_elements/index.html.slim +8 -0
- data/app/views/locomotive/editable_elements/{index_without_preview.html.haml → index_without_preview.html.slim} +5 -4
- data/app/views/locomotive/errors/404.html.slim +2 -0
- data/app/views/locomotive/errors/500.html.slim +2 -0
- data/app/views/locomotive/errors/no_site.html.slim +7 -0
- data/app/views/locomotive/layouts/application.html.slim +42 -0
- data/app/views/locomotive/layouts/error.html.slim +24 -0
- data/app/views/locomotive/layouts/{live_editing.html.haml → live_editing.html.slim} +10 -10
- data/app/views/locomotive/layouts/not_logged_in.html.slim +26 -0
- data/app/views/locomotive/layouts/{without_site.html.haml → without_site.html.slim} +9 -6
- data/app/views/locomotive/memberships/{edit.html.haml → edit.html.slim} +0 -0
- data/app/views/locomotive/memberships/{new.html.haml → new.html.slim} +0 -0
- data/app/views/locomotive/my_account/{edit.html.haml → edit.html.slim} +1 -1
- data/app/views/locomotive/my_account/form/{_actions.html.haml → _actions.html.slim} +0 -0
- data/app/views/locomotive/my_account/form/{_api.html.haml → _api.html.slim} +0 -1
- data/app/views/locomotive/my_account/form/{_credentials.html.haml → _credentials.html.slim} +0 -0
- data/app/views/locomotive/my_account/form/{_main.html.haml → _main.html.slim} +0 -0
- data/app/views/locomotive/my_account/form/{_panes.html.haml → _panes.html.slim} +1 -1
- data/app/views/locomotive/my_account/form/_tabs.html.slim +7 -0
- data/app/views/locomotive/notifications/{new_content_entry.html.haml → new_content_entry.html.slim} +11 -11
- data/app/views/locomotive/pages/{edit.html.haml → edit.html.slim} +0 -0
- data/app/views/locomotive/pages/form/{_actions.html.haml → _actions.html.slim} +0 -0
- data/app/views/locomotive/pages/form/{_main.html.haml → _main.html.slim} +0 -0
- data/app/views/locomotive/pages/form/{_panes.html.haml → _panes.html.slim} +0 -0
- data/app/views/locomotive/pages/form/{_seo.html.haml → _seo.html.slim} +0 -0
- data/app/views/locomotive/pages/form/{_tabs.html.haml → _tabs.html.slim} +1 -1
- data/app/views/locomotive/pages/{new.html.haml → new.html.slim} +0 -0
- data/app/views/locomotive/pages/show.html.slim +2 -0
- data/app/views/locomotive/passwords/{edit.html.haml → edit.html.slim} +6 -6
- data/app/views/locomotive/passwords/{new.html.haml → new.html.slim} +6 -6
- data/app/views/locomotive/public_submission_accounts/_account.html.slim +19 -0
- data/app/views/locomotive/public_submission_accounts/edit.html.slim +16 -0
- data/app/views/locomotive/registrations/{new.html.haml → new.html.slim} +2 -4
- data/app/views/locomotive/sessions/{new.html.haml → new.html.slim} +2 -4
- data/app/views/locomotive/shared/_footer.html.slim +2 -0
- data/app/views/locomotive/shared/{_form_actions.html.haml → _form_actions.html.slim} +4 -4
- data/app/views/locomotive/shared/_head.html.slim +39 -0
- data/app/views/locomotive/shared/{_header.html.haml → _header.html.slim} +10 -10
- data/app/views/locomotive/shared/_locale_picker_link.html.slim +11 -0
- data/app/views/locomotive/shared/{_main_app_head.html.haml → _main_app_head.html.slim} +0 -0
- data/app/views/locomotive/shared/{_main_app_head_before_backbone.html.haml → _main_app_head_before_backbone.html.slim} +0 -0
- data/app/views/locomotive/shared/{_main_app_header.html.haml → _main_app_header.html.slim} +0 -0
- data/app/views/locomotive/shared/{_sidebar.html.haml → _sidebar.html.slim} +6 -0
- data/app/views/locomotive/shared/{_sidebar_without_site.html.haml → _sidebar_without_site.html.slim} +0 -0
- data/app/views/locomotive/shared/actions/{_contents.html.haml → _contents.html.slim} +1 -1
- data/app/views/locomotive/shared/header/{_account.html.haml → _account.html.slim} +1 -1
- data/app/views/locomotive/shared/header/_account_menu.html.slim +5 -0
- data/app/views/locomotive/shared/header/_brand.html.slim +5 -0
- data/app/views/locomotive/shared/header/{_site.html.haml → _site.html.slim} +2 -2
- data/app/views/locomotive/shared/rte/{_image_popover.html.haml → _image_popover.html.slim} +5 -5
- data/app/views/locomotive/shared/rte/{_link_popover.html.haml → _link_popover.html.slim} +5 -5
- data/app/views/locomotive/shared/rte/_toolbar.html.slim +62 -0
- data/app/views/locomotive/shared/sidebar/_content_types.html.slim +16 -0
- data/app/views/locomotive/shared/sidebar/_link.html.slim +10 -0
- data/app/views/locomotive/shared/sidebar/{_my_account.html.haml → _my_account.html.slim} +2 -2
- data/app/views/locomotive/shared/sidebar/_page.html.slim +33 -0
- data/app/views/locomotive/shared/sidebar/_pages.html.slim +11 -0
- data/app/views/locomotive/sites/{_site.html.haml → _site.html.slim} +3 -3
- data/app/views/locomotive/sites/{index.html.haml → index.html.slim} +3 -3
- data/app/views/locomotive/sites/{new.html.haml → new.html.slim} +0 -0
- data/app/views/locomotive/translations/_form.html.slim +9 -0
- data/app/views/locomotive/translations/edit.html.slim +7 -0
- data/app/views/locomotive/translations/index.html.slim +41 -0
- data/config/initializers/slim.rb +1 -0
- data/config/initializers/time_format.rb +15 -0
- data/config/locales/admin_ui.en.yml +65 -49
- data/config/locales/default.en.yml +3 -0
- data/config/locales/default.fr.yml +4 -1
- data/config/locales/simple_form.en.yml +14 -8
- data/config/routes.rb +6 -0
- data/features/support/env.rb +1 -1
- data/lib/generators/locomotive/install/install_generator.rb +48 -0
- data/lib/generators/locomotive/install/templates/heroku.rb +29 -0
- data/lib/generators/locomotive/install/templates/locomotive.rb +5 -2
- data/lib/generators/locomotive/install/templates/mongoid.yml +1 -1
- data/lib/generators/locomotive/install/templates/mongoid_heroku.yml +78 -0
- data/lib/locomotive.rb +0 -1
- data/lib/locomotive/configuration.rb +2 -6
- data/lib/locomotive/dependencies.rb +1 -2
- data/lib/locomotive/dragonfly.rb +4 -5
- data/lib/locomotive/engine.rb +10 -13
- data/lib/locomotive/middlewares.rb +0 -1
- data/lib/locomotive/middlewares/custom_public_exceptions.rb +19 -0
- data/lib/locomotive/middlewares/site.rb +49 -16
- data/lib/locomotive/simple_form.rb +67 -26
- data/lib/locomotive/steam/middlewares/missing_translations.rb +48 -0
- data/lib/locomotive/steam/middlewares/page_editing.rb +48 -0
- data/lib/locomotive/steam/services/api_entry_submission_service.rb +38 -0
- data/lib/locomotive/steam_adaptor.rb +25 -6
- data/lib/locomotive/version.rb +1 -1
- data/lib/tasks/locomotive.rake +27 -47
- data/spec/dummy/app/views/foo/index.html.slim +1 -0
- data/spec/dummy/app/views/locomotive/shared/{_main_app_head.html.haml → _main_app_head.html.slim} +0 -0
- data/spec/dummy/config.ru +4 -0
- data/spec/dummy/config/application.rb +4 -0
- data/spec/dummy/config/environments/profile.rb +48 -0
- data/spec/dummy/config/mongoid.yml +6 -6
- data/spec/lib/locomotive/steam/services/api_entry_submission_service_spec.rb +39 -0
- data/spec/models/locomotive/concerns/content_type/entry_template_spec.rb +55 -0
- data/spec/models/locomotive/concerns/page/layout_spec.rb +2 -2
- data/spec/models/locomotive/concerns/site/access_points_spec.rb +87 -2
- data/spec/models/locomotive/concerns/site/locales_spec.rb +2 -3
- data/spec/models/locomotive/content_entry_spec.rb +22 -37
- data/spec/models/locomotive/page_spec.rb +11 -0
- data/spec/models/locomotive/site_spec.rb +0 -36
- data/spec/requests/site_spec.rb +28 -0
- data/spec/support/capybara.rb +27 -0
- data/spec/support/factories.rb +9 -0
- data/spec/support/features/session_helpers.rb +21 -0
- data/spec/support/locomotive.rb +0 -4
- data/spec/support/matchers.rb +0 -25
- data/vendor/assets/javascripts/locomotive/highlight.pack.js +1 -0
- data/vendor/assets/stylesheets/locomotive/highlightjs/default.css +155 -0
- data/vendor/assets/stylesheets/locomotive/highlightjs/github.css +123 -0
- metadata +179 -195
- data/app/assets/images/locomotive/background/body.png +0 -0
- data/app/assets/images/locomotive/form/error-arrow.png +0 -0
- data/app/assets/images/locomotive/form/input-sep.png +0 -0
- data/app/assets/images/locomotive/icons/start.png +0 -0
- data/app/assets/images/locomotive/list/empty.png +0 -0
- data/app/assets/images/locomotive/list/item-left.png +0 -0
- data/app/assets/images/locomotive/nocoffee.png +0 -0
- data/app/assets/images/locomotive/plugins/sites_picker_top_arrow.png +0 -0
- data/app/assets/images/locomotive/rails.png +0 -0
- data/app/assets/javascripts/locomotive/views/pages/index_view.js.coffee +0 -11
- data/app/cells/locomotive/content_locale_picker/show.html.haml +0 -7
- data/app/cells/locomotive/content_locale_picker_cell.rb +0 -21
- data/app/helpers/locomotive/installation_helper.rb +0 -9
- data/app/inputs/locomotive/locale_input.rb +0 -41
- data/app/inputs/locomotive/small_code_input.rb +0 -23
- data/app/models/locomotive/concerns/content_entry/notifications.rb +0 -33
- data/app/models/locomotive/concerns/content_type/item_template.rb +0 -49
- data/app/models/locomotive/concerns/page/parse.rb +0 -133
- data/app/presenters/locomotive/account_presenter.rb +0 -20
- data/app/presenters/locomotive/base_presenter.rb +0 -144
- data/app/presenters/locomotive/content_asset_presenter.rb +0 -51
- data/app/presenters/locomotive/content_entry_presenter.rb +0 -177
- data/app/presenters/locomotive/content_field_presenter.rb +0 -76
- data/app/presenters/locomotive/content_type_presenter.rb +0 -82
- data/app/presenters/locomotive/editable_control_presenter.rb +0 -19
- data/app/presenters/locomotive/editable_element_presenter.rb +0 -46
- data/app/presenters/locomotive/editable_file_presenter.rb +0 -36
- data/app/presenters/locomotive/editable_text_presenter.rb +0 -40
- data/app/presenters/locomotive/membership_presenter.rb +0 -35
- data/app/presenters/locomotive/page_presenter.rb +0 -81
- data/app/presenters/locomotive/site_presenter.rb +0 -40
- data/app/presenters/locomotive/snippet_presenter.rb +0 -22
- data/app/presenters/locomotive/theme_asset_presenter.rb +0 -61
- data/app/presenters/locomotive/translation_presenter.rb +0 -9
- data/app/views/locomotive/content_assets/edit_in_drawer.html.haml +0 -26
- data/app/views/locomotive/content_entries/form/_tabs.html.haml +0 -9
- data/app/views/locomotive/current_site/form/_tabs.html.haml +0 -14
- data/app/views/locomotive/dashboard/show.html.haml +0 -0
- data/app/views/locomotive/devise_mailer/reset_password_instructions.html.haml +0 -12
- data/app/views/locomotive/editable_elements/_edit.html.haml +0 -49
- data/app/views/locomotive/editable_elements/_edit_with_content_entry.html.haml +0 -21
- data/app/views/locomotive/editable_elements/index.html.haml +0 -8
- data/app/views/locomotive/errors/404.html.haml +0 -7
- data/app/views/locomotive/errors/500.html.haml +0 -7
- data/app/views/locomotive/errors/no_page.html.haml +0 -1
- data/app/views/locomotive/errors/no_site.html.haml +0 -1
- data/app/views/locomotive/layouts/application.html.haml +0 -42
- data/app/views/locomotive/layouts/error.html.haml +0 -1
- data/app/views/locomotive/layouts/not_logged_in.html.haml +0 -18
- data/app/views/locomotive/my_account/form/_tabs.html.haml +0 -7
- data/app/views/locomotive/pages/_editable_elements.html.haml +0 -64
- data/app/views/locomotive/pages/index.html.haml +0 -22
- data/app/views/locomotive/pages/show.html.haml +0 -2
- data/app/views/locomotive/shared/_footer.html.haml +0 -2
- data/app/views/locomotive/shared/_head.html.haml +0 -40
- data/app/views/locomotive/shared/_locale_picker_link.html.haml +0 -6
- data/app/views/locomotive/shared/header/_account_menu.html.haml +0 -5
- data/app/views/locomotive/shared/header/_brand.html.haml +0 -4
- data/app/views/locomotive/shared/rte/_toolbar.html.haml +0 -62
- data/app/views/locomotive/shared/sidebar/_content_types.html.haml +0 -15
- data/app/views/locomotive/shared/sidebar/_link.html.haml +0 -10
- data/app/views/locomotive/shared/sidebar/_page.html.haml +0 -33
- data/app/views/locomotive/shared/sidebar/_pages.html.haml +0 -11
- data/app/views/locomotive/translations/_form.html.haml +0 -12
- data/app/views/locomotive/translations/edit.html.haml +0 -15
- data/app/views/locomotive/translations/index.html.haml +0 -30
- data/app/views/locomotive/translations/new.html.haml +0 -12
- data/config/initializers/haml.rb +0 -2
- data/config/initializers/locomotive_loaded_first.rb +0 -19
- data/config/locales/formtastic.bg.yml +0 -113
- data/config/locales/formtastic.cs.yml +0 -125
- data/config/locales/formtastic.de.yml +0 -106
- data/config/locales/formtastic.es.yml +0 -84
- data/config/locales/formtastic.et.yml +0 -103
- data/config/locales/formtastic.fr.yml +0 -109
- data/config/locales/formtastic.it.yml +0 -99
- data/config/locales/formtastic.ja.yml +0 -103
- data/config/locales/formtastic.nb.yml +0 -103
- data/config/locales/formtastic.nl.yml +0 -85
- data/config/locales/formtastic.pl.yml +0 -105
- data/config/locales/formtastic.pt-BR.yml +0 -70
- data/config/locales/formtastic.pt.yml +0 -70
- data/config/locales/formtastic.ru.yml +0 -106
- data/config/locales/formtastic.sk.yml +0 -125
- data/config/locales/formtastic.sr.yml +0 -112
- data/config/locales/formtastic.zh-CN.yml +0 -112
- data/lib/locomotive/haml.rb +0 -1
- data/lib/locomotive/middlewares/page_editing.rb +0 -41
- data/spec/dummy/app/views/foo/index.html.haml +0 -1
- data/spec/dummy/config/initializers/haml.rb +0 -2
- data/spec/support/asset_host_stubs.rb +0 -17
- data/spec/support/controller.rb +0 -32
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -1,21 +0,0 @@
|
|
1
|
-
# module Locomotive
|
2
|
-
# class ContentLocalePickerCell < Cell::Base
|
3
|
-
|
4
|
-
# helper do
|
5
|
-
# include ::Locomotive::BaseHelper
|
6
|
-
# end
|
7
|
-
|
8
|
-
# def show(args)
|
9
|
-
# site = args[:site]
|
10
|
-
# @locale = args[:locale].to_s
|
11
|
-
|
12
|
-
# if site.locales.empty? || site.locales.size < 2
|
13
|
-
# ''
|
14
|
-
# else
|
15
|
-
# @locales = site.locales
|
16
|
-
# render
|
17
|
-
# end
|
18
|
-
# end
|
19
|
-
|
20
|
-
# end
|
21
|
-
# end
|
@@ -1,41 +0,0 @@
|
|
1
|
-
# FIXME: @deprecated
|
2
|
-
# module Locomotive
|
3
|
-
# class LocaleInput < Formtastic::Inputs::TextInput
|
4
|
-
|
5
|
-
# include Formtastic::Inputs::Base::Choices
|
6
|
-
|
7
|
-
# def to_html
|
8
|
-
# input_wrapping do
|
9
|
-
# label_html <<
|
10
|
-
# self.available_locales_to_html
|
11
|
-
# end
|
12
|
-
# end
|
13
|
-
|
14
|
-
# def available_locales_to_html
|
15
|
-
# template.content_tag(:div,
|
16
|
-
# Locomotive.config.locales.map do |locale|
|
17
|
-
# template.content_tag(:div, locale_to_html(locale).html_safe, class: 'entry')
|
18
|
-
# end.join.html_safe +
|
19
|
-
# template.content_tag(:div, '', class: 'clear'), class: 'list')
|
20
|
-
# end
|
21
|
-
|
22
|
-
# def locale_to_html(locale)
|
23
|
-
# text = I18n.t("locomotive.locales.#{locale}")
|
24
|
-
|
25
|
-
# builder.radio_button(:locale, locale, id: choice_input_dom_id(locale)) +
|
26
|
-
# template.content_tag(:label,
|
27
|
-
# template.image_tag("locomotive/icons/flags/#{locale}.png", alt: text, size: '24x24') +
|
28
|
-
# text, for: choice_input_dom_id(locale))
|
29
|
-
# end
|
30
|
-
|
31
|
-
# def choice_input_dom_id(choice)
|
32
|
-
# [
|
33
|
-
# builder.custom_namespace,
|
34
|
-
# sanitized_object_name,
|
35
|
-
# association_primary_key || method,
|
36
|
-
# choice_html_safe_value(choice)
|
37
|
-
# ].compact.reject { |i| i.blank? }.join("_")
|
38
|
-
# end
|
39
|
-
|
40
|
-
# end
|
41
|
-
# end
|
@@ -1,23 +0,0 @@
|
|
1
|
-
# @deprecated
|
2
|
-
# module Locomotive
|
3
|
-
# class SmallCodeInput < Formtastic::Inputs::TextInput
|
4
|
-
|
5
|
-
# def wrapper_html_options
|
6
|
-
# super.tap do |opts|
|
7
|
-
# opts[:class] += ' code small'
|
8
|
-
# end
|
9
|
-
# end
|
10
|
-
|
11
|
-
# def input_wrapping(&block)
|
12
|
-
# template.content_tag(:li,
|
13
|
-
# [template.capture(&block), error_html, error_anchor, hint_html].join("\n").html_safe,
|
14
|
-
# wrapper_html_options
|
15
|
-
# )
|
16
|
-
# end
|
17
|
-
|
18
|
-
# def error_anchor
|
19
|
-
# template.content_tag(:span, '', class: 'error-anchor')
|
20
|
-
# end
|
21
|
-
|
22
|
-
# end
|
23
|
-
# end
|
@@ -1,33 +0,0 @@
|
|
1
|
-
module Locomotive
|
2
|
-
module Concerns
|
3
|
-
module ContentEntry
|
4
|
-
module Notifications
|
5
|
-
|
6
|
-
extend ActiveSupport::Concern
|
7
|
-
|
8
|
-
included do
|
9
|
-
|
10
|
-
## callbacks ##
|
11
|
-
after_create :send_notifications, if: :notifications?
|
12
|
-
|
13
|
-
end
|
14
|
-
|
15
|
-
def notifications?
|
16
|
-
self.content_type.public_submission_enabled? &&
|
17
|
-
!self.content_type.public_submission_accounts.blank?
|
18
|
-
end
|
19
|
-
|
20
|
-
def send_notifications
|
21
|
-
account_ids = self.content_type.public_submission_accounts.map(&:to_s)
|
22
|
-
|
23
|
-
self.site.accounts.each do |account|
|
24
|
-
next unless account_ids.include?(account._id.to_s)
|
25
|
-
|
26
|
-
Locomotive::Notifications.new_content_entry(account, self).deliver
|
27
|
-
end
|
28
|
-
end
|
29
|
-
|
30
|
-
end
|
31
|
-
end
|
32
|
-
end
|
33
|
-
end
|
@@ -1,49 +0,0 @@
|
|
1
|
-
module Locomotive
|
2
|
-
module Concerns
|
3
|
-
module ContentType
|
4
|
-
module ItemTemplate
|
5
|
-
|
6
|
-
extend ActiveSupport::Concern
|
7
|
-
|
8
|
-
included do
|
9
|
-
field :raw_item_template
|
10
|
-
field :serialized_item_template, type: BSON::Binary
|
11
|
-
|
12
|
-
before_validation :serialize_item_template
|
13
|
-
|
14
|
-
validate :item_template_must_be_valid
|
15
|
-
end
|
16
|
-
|
17
|
-
def item_template
|
18
|
-
@item_template ||= Marshal.load(read_attribute(:serialized_item_template).to_s) rescue nil
|
19
|
-
end
|
20
|
-
|
21
|
-
protected
|
22
|
-
|
23
|
-
def serialize_item_template
|
24
|
-
if self.new_record? || self.raw_item_template_changed?
|
25
|
-
@item_parsing_errors = []
|
26
|
-
|
27
|
-
begin
|
28
|
-
self._parse_and_serialize_item_template
|
29
|
-
rescue ::Liquid::SyntaxError => error
|
30
|
-
@item_parsing_errors << I18n.t(:liquid_syntax, error: error.to_s, scope: [:errors, :messages])
|
31
|
-
end
|
32
|
-
end
|
33
|
-
end
|
34
|
-
|
35
|
-
def _parse_and_serialize_item_template
|
36
|
-
item_template = ::Liquid::Template.parse(self.raw_item_template, {})
|
37
|
-
self.serialized_item_template = BSON::Binary.new(Marshal.dump(item_template), :generic)
|
38
|
-
end
|
39
|
-
|
40
|
-
def item_template_must_be_valid
|
41
|
-
@item_parsing_errors.try(:each) do |msg|
|
42
|
-
%w(item_template raw_item_template).each { |field| self.errors.add field.to_sym, msg }
|
43
|
-
end
|
44
|
-
end
|
45
|
-
|
46
|
-
end
|
47
|
-
end
|
48
|
-
end
|
49
|
-
end
|
@@ -1,133 +0,0 @@
|
|
1
|
-
# module Locomotive
|
2
|
-
# module Concerns
|
3
|
-
# module Page
|
4
|
-
# module Parse
|
5
|
-
|
6
|
-
# extend ActiveSupport::Concern
|
7
|
-
|
8
|
-
# included do
|
9
|
-
# ## fields ##
|
10
|
-
# field :serialized_template, type: BSON::Binary, localize: true
|
11
|
-
# field :template_dependencies, type: Array, default: [], localize: true
|
12
|
-
# field :snippet_dependencies, type: Array, default: [], localize: true
|
13
|
-
|
14
|
-
# ## virtual attributes
|
15
|
-
# attr_reader :template_changed
|
16
|
-
# attr_accessor :updating_descendants
|
17
|
-
|
18
|
-
# ## callbacks ##
|
19
|
-
# before_validation :serialize_template
|
20
|
-
# after_save :update_template_descendants
|
21
|
-
# skip_callback :save, :after, :update_template_descendants, if: -> { self.updating_descendants }
|
22
|
-
|
23
|
-
# ## validations ##
|
24
|
-
# validate :template_must_be_valid
|
25
|
-
|
26
|
-
# ## scopes ##
|
27
|
-
# scope :pages, lambda { |domain| { any_in: { domains: [*domain] } } }
|
28
|
-
# end
|
29
|
-
|
30
|
-
# def template
|
31
|
-
# return @template if @template.present?
|
32
|
-
|
33
|
-
# if self.serialized_template.present?
|
34
|
-
# begin
|
35
|
-
# @template = Marshal.load(self.serialized_template.data)
|
36
|
-
# rescue Exception => e
|
37
|
-
# Locomotive.log :warn, "[Page][#{self._id}] unable to de-serialize the template, error: #{e.message}"
|
38
|
-
# nil
|
39
|
-
# end
|
40
|
-
# else
|
41
|
-
# nil
|
42
|
-
# end
|
43
|
-
# # @template ||= Marshal.load(self.serialized_template.data) rescue nil
|
44
|
-
# end
|
45
|
-
|
46
|
-
# def force_serialize_template
|
47
|
-
# self.serialize_template
|
48
|
-
# @done_serialize_template = true
|
49
|
-
# end
|
50
|
-
|
51
|
-
# protected
|
52
|
-
|
53
|
-
# def serialize_template
|
54
|
-
# if !@done_serialize_template && (self.new_record? || self.raw_template_changed?)
|
55
|
-
# @template_changed, @parsing_errors = true, []
|
56
|
-
|
57
|
-
# begin
|
58
|
-
# self._parse_and_serialize_template
|
59
|
-
# rescue ::Liquid::SyntaxError => error
|
60
|
-
# @parsing_errors << I18n.t(:liquid_syntax, fullpath: self.fullpath, error: error.to_s, scope: [:errors, :messages, :page])
|
61
|
-
# rescue ::Locomotive::Liquid::PageNotFound => error
|
62
|
-
# @parsing_errors << I18n.t(:liquid_extend, fullpath: self.fullpath, scope: [:errors, :messages, :page])
|
63
|
-
# rescue ::Locomotive::Liquid::PageNotTranslated => error
|
64
|
-
# @parsing_errors << I18n.t(:liquid_translation, fullpath: self.fullpath, scope: [:errors, :messages, :page])
|
65
|
-
# end
|
66
|
-
# end
|
67
|
-
# end
|
68
|
-
|
69
|
-
# def _parse_and_serialize_template(context = {})
|
70
|
-
# self.parse(context)
|
71
|
-
# self._serialize_template
|
72
|
-
# end
|
73
|
-
|
74
|
-
# def _serialize_template
|
75
|
-
# self.serialized_template = BSON::Binary.new(Marshal.dump(@template), :generic)
|
76
|
-
# end
|
77
|
-
|
78
|
-
# def parse(context = {})
|
79
|
-
# self.disable_all_editable_elements
|
80
|
-
|
81
|
-
# default_context = { site: self.site, page: self, templates: [], snippets: [] }
|
82
|
-
|
83
|
-
# context = default_context.merge(context)
|
84
|
-
|
85
|
-
# @template = ::Liquid::Template.parse(self.raw_template, context)
|
86
|
-
|
87
|
-
# self.template_dependencies = context[:templates]
|
88
|
-
# self.snippet_dependencies = context[:snippets]
|
89
|
-
|
90
|
-
# @template.root.context.clear
|
91
|
-
# end
|
92
|
-
|
93
|
-
# def template_must_be_valid
|
94
|
-
# @parsing_errors.try(:each) do |msg|
|
95
|
-
# self.errors.add :template, msg
|
96
|
-
# self.errors.add :raw_template, msg
|
97
|
-
# end
|
98
|
-
# end
|
99
|
-
|
100
|
-
# def update_template_descendants
|
101
|
-
# return unless @template_changed == true
|
102
|
-
|
103
|
-
# # we admit at this point that the current template is up-to-date
|
104
|
-
# condition = { "template_dependencies.#{::Mongoid::Fields::I18n.locale}" => [self.id] }
|
105
|
-
# template_descendants = self.site.pages.any_in(condition).to_a
|
106
|
-
|
107
|
-
# # group them by fullpath for better performance
|
108
|
-
# cached = template_descendants.inject({}) { |memo, page| memo[page.fullpath] = page; memo }
|
109
|
-
|
110
|
-
# self._update_direct_template_descendants(template_descendants.clone, cached)
|
111
|
-
|
112
|
-
# # finally save them all
|
113
|
-
# template_descendants.each do |page|
|
114
|
-
# page.update_without_validation_and_callback!
|
115
|
-
# end
|
116
|
-
# end
|
117
|
-
|
118
|
-
# def _update_direct_template_descendants(template_descendants, cached)
|
119
|
-
# direct_descendants = template_descendants.select do |page|
|
120
|
-
# ((self.template_dependencies || []) + [self._id]) == (page.template_dependencies || [])
|
121
|
-
# end
|
122
|
-
|
123
|
-
# direct_descendants.each do |page|
|
124
|
-
# page.send(:_parse_and_serialize_template, { cached_parent: self, cached_pages: cached })
|
125
|
-
# template_descendants.delete(page) # no need to loop over it next time
|
126
|
-
# page.send(:_update_direct_template_descendants, template_descendants, cached) # move down
|
127
|
-
# end
|
128
|
-
# end
|
129
|
-
|
130
|
-
# end
|
131
|
-
# end
|
132
|
-
# end
|
133
|
-
# end
|
@@ -1,20 +0,0 @@
|
|
1
|
-
module Locomotive
|
2
|
-
class AccountPresenter < BasePresenter
|
3
|
-
|
4
|
-
## properties ##
|
5
|
-
properties :name, :email, :locale, :encrypted_password, :password_salt, :api_key
|
6
|
-
property :super_admin, only_getter: true
|
7
|
-
property :local_admin, only_getter: true
|
8
|
-
|
9
|
-
with_options only_setter: true do |presenter|
|
10
|
-
presenter.properties :password, :password_confirmation
|
11
|
-
end
|
12
|
-
|
13
|
-
## other getters / setters ##
|
14
|
-
|
15
|
-
def local_admin
|
16
|
-
self.__source.local_admin?
|
17
|
-
end
|
18
|
-
|
19
|
-
end
|
20
|
-
end
|
@@ -1,144 +0,0 @@
|
|
1
|
-
class Locomotive::BasePresenter
|
2
|
-
|
3
|
-
include Locomotive::Presentable
|
4
|
-
|
5
|
-
include ::Pundit
|
6
|
-
include ActionView::Helpers::SanitizeHelper
|
7
|
-
extend ActionView::Helpers::SanitizeHelper::ClassMethods
|
8
|
-
include ActionView::Helpers::TextHelper
|
9
|
-
include ActionView::Helpers::NumberHelper
|
10
|
-
|
11
|
-
## default properties ##
|
12
|
-
with_options allow_nil: true do |presenter|
|
13
|
-
presenter.properties :id, :_id
|
14
|
-
end
|
15
|
-
properties :created_at, :updated_at, type: 'Date', only_getter: true
|
16
|
-
|
17
|
-
## utility accessors ##
|
18
|
-
attr_reader :__policy, :__depth
|
19
|
-
|
20
|
-
# Set the policy object to check if we can or not
|
21
|
-
# get a property.
|
22
|
-
#
|
23
|
-
def after_initialize
|
24
|
-
@__depth = self.__options[:depth] || 0
|
25
|
-
@__policy = self.__options[:policy]
|
26
|
-
end
|
27
|
-
|
28
|
-
# Get the id of the source only if it has been persisted
|
29
|
-
# or if it's an embedded document.
|
30
|
-
#
|
31
|
-
# @return [ String ] The id of the source, nil if not persisted or not embedded.
|
32
|
-
#
|
33
|
-
def _id
|
34
|
-
self.__source.persisted? || self.__source.embedded? ? self.__source._id.to_s : nil
|
35
|
-
end
|
36
|
-
alias :id :_id
|
37
|
-
|
38
|
-
# Check if there is a policy object used for authorization/permission.
|
39
|
-
#
|
40
|
-
# @return [ Boolean ] True if defined, false otherwise
|
41
|
-
#
|
42
|
-
def policy?
|
43
|
-
self.__policy.present?
|
44
|
-
end
|
45
|
-
|
46
|
-
# Shortcut to the site taken from the source.
|
47
|
-
#
|
48
|
-
# @return [ Object ] The site or nil if not found
|
49
|
-
#
|
50
|
-
def site
|
51
|
-
self.__source.try(:site)
|
52
|
-
end
|
53
|
-
|
54
|
-
# Shortcut to the errors of the source
|
55
|
-
#
|
56
|
-
# @return [ Hash ] The errors or an empty hash if no errors
|
57
|
-
#
|
58
|
-
def errors
|
59
|
-
self.__source.errors.messages.to_hash.stringify_keys
|
60
|
-
end
|
61
|
-
|
62
|
-
# Tell if we have to include errors or not
|
63
|
-
#
|
64
|
-
# @return [ Boolean ] True if the source has errors.
|
65
|
-
#
|
66
|
-
def include_errors?
|
67
|
-
!!self.__options[:include_errors]
|
68
|
-
end
|
69
|
-
|
70
|
-
# Tell if the presenter is aimed to be used in a html view
|
71
|
-
#
|
72
|
-
# @return [ Boolean ] True if used in a HTML view
|
73
|
-
#
|
74
|
-
def html_view?
|
75
|
-
!!self.__options[:html_view]
|
76
|
-
end
|
77
|
-
|
78
|
-
# Mimic format used by to_json
|
79
|
-
#
|
80
|
-
# @param [ String ] text The string representing the time
|
81
|
-
#
|
82
|
-
# @return [ Time ] The time or nil if the input is nil or empty
|
83
|
-
#
|
84
|
-
def formatted_time(text)
|
85
|
-
return nil if text.blank?
|
86
|
-
format = '%Y-%m-%dT%H:%M:%S%Z'
|
87
|
-
::Time.strptime(text, format)
|
88
|
-
end
|
89
|
-
|
90
|
-
# Return the set of setters with their options.
|
91
|
-
#
|
92
|
-
# @param [ Hash ] options Some options: with_ids (add id and _id)
|
93
|
-
#
|
94
|
-
# @return [ Hash ] The setters
|
95
|
-
#
|
96
|
-
def self.setters_to_hash(options = {})
|
97
|
-
options = { without_ids: true }.merge(options)
|
98
|
-
|
99
|
-
{}.tap do |hash|
|
100
|
-
self.setters.each do |name|
|
101
|
-
next if %w(id _id).include?(name.to_s) && options[:without_ids]
|
102
|
-
hash[name] = self.getters_or_setters_to_hash(name)
|
103
|
-
end
|
104
|
-
end
|
105
|
-
end
|
106
|
-
|
107
|
-
# Return the set of getters with their options.
|
108
|
-
#
|
109
|
-
# @return [ Hash ] The getters
|
110
|
-
#
|
111
|
-
def self.getters_to_hash
|
112
|
-
{}.tap do |hash|
|
113
|
-
self.getters.each do |name|
|
114
|
-
next if %w(_id created_at updated_at).include?(name)
|
115
|
-
hash[name] = self.getters_or_setters_to_hash(name)
|
116
|
-
end
|
117
|
-
|
118
|
-
%w(created_at updated_at).each do |name|
|
119
|
-
hash[name] = self.getters_or_setters_to_hash(name)
|
120
|
-
end
|
121
|
-
end
|
122
|
-
end
|
123
|
-
|
124
|
-
def self.getters_or_setters_to_hash(name)
|
125
|
-
options = self.property_options[name] || {}
|
126
|
-
|
127
|
-
attributes = {
|
128
|
-
type: options[:type] || 'String',
|
129
|
-
required: options[:required].nil? ? true : options[:required],
|
130
|
-
alias_of: self.alias_of(name),
|
131
|
-
description: options[:description]
|
132
|
-
}
|
133
|
-
|
134
|
-
if options[:presenter]
|
135
|
-
attributes[:collection_of] = {
|
136
|
-
name: options[:presenter].to_s.demodulize.gsub(/Presenter$/, '').underscore,
|
137
|
-
params: options[:presenter].setters_to_hash
|
138
|
-
}
|
139
|
-
end
|
140
|
-
|
141
|
-
attributes
|
142
|
-
end
|
143
|
-
|
144
|
-
end
|