tribeca_cms 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +58 -0
- data/LICENSE +1 -0
- data/README.textile +0 -0
- data/app/assets/images/locomotive/background/body.png +0 -0
- data/app/assets/images/locomotive/datepicker/ui-widget-content-top.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/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/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/aloha/plugins/custom/locomotive_media/css/image.css +3 -0
- data/app/assets/javascripts/aloha/plugins/custom/locomotive_media/img/image.gif +0 -0
- data/app/assets/javascripts/aloha/plugins/custom/locomotive_media/lib/locomotive_media-plugin.js +96 -0
- data/app/assets/javascripts/aloha/plugins/custom/locomotive_media/nls/fr/i18n.js +1 -0
- data/app/assets/javascripts/aloha/plugins/custom/locomotive_media/nls/i18n.js +4 -0
- data/app/assets/javascripts/aloha/plugins/custom/locomotive_media/package.json +1 -0
- data/app/assets/javascripts/locomotive.js +25 -0
- data/app/assets/javascripts/locomotive/aloha.js.coffee +2 -0
- data/app/assets/javascripts/locomotive/application.js.coffee +12 -0
- data/app/assets/javascripts/locomotive/inline_editor.js.coffee +22 -0
- data/app/assets/javascripts/locomotive/models/account.js.coffee +11 -0
- data/app/assets/javascripts/locomotive/models/content_asset.js.coffee +20 -0
- data/app/assets/javascripts/locomotive/models/content_entry.js.coffee +61 -0
- data/app/assets/javascripts/locomotive/models/content_type.js.coffee +26 -0
- data/app/assets/javascripts/locomotive/models/custom_field.js.coffee +38 -0
- data/app/assets/javascripts/locomotive/models/custom_field_select_option.js.coffee +16 -0
- data/app/assets/javascripts/locomotive/models/domain.js.coffee +3 -0
- data/app/assets/javascripts/locomotive/models/editable_element.js.coffee +27 -0
- data/app/assets/javascripts/locomotive/models/membership.js.coffee +13 -0
- data/app/assets/javascripts/locomotive/models/page.js.coffee +27 -0
- data/app/assets/javascripts/locomotive/models/site.js.coffee +34 -0
- data/app/assets/javascripts/locomotive/models/snippet.js.coffee +11 -0
- data/app/assets/javascripts/locomotive/models/theme_asset.js.coffee +11 -0
- data/app/assets/javascripts/locomotive/models/translation.js.coffee +5 -0
- data/app/assets/javascripts/locomotive/not_logged_in.js.coffee +1 -0
- data/app/assets/javascripts/locomotive/utils/aloha_settings.js.coffee +37 -0
- data/app/assets/javascripts/locomotive/utils/core_ext.js +75 -0
- data/app/assets/javascripts/locomotive/utils/growl.js +14 -0
- data/app/assets/javascripts/locomotive/utils/handlebar_helpers.js.coffee +9 -0
- data/app/assets/javascripts/locomotive/utils/tinymce_settings.js.coffee +48 -0
- data/app/assets/javascripts/locomotive/views/application_view.js.coffee +92 -0
- data/app/assets/javascripts/locomotive/views/content_assets/picker_item_view.js.coffee +30 -0
- data/app/assets/javascripts/locomotive/views/content_assets/picker_view.js.coffee +58 -0
- data/app/assets/javascripts/locomotive/views/content_entries/_form_view.js.coffee +144 -0
- data/app/assets/javascripts/locomotive/views/content_entries/_popup_form_view.js.coffee +90 -0
- data/app/assets/javascripts/locomotive/views/content_entries/edit_view.js.coffee +9 -0
- data/app/assets/javascripts/locomotive/views/content_entries/index_view.js.coffee +36 -0
- data/app/assets/javascripts/locomotive/views/content_entries/new_view.js.coffee +8 -0
- data/app/assets/javascripts/locomotive/views/content_types/_form_view.js.coffee +86 -0
- data/app/assets/javascripts/locomotive/views/content_types/custom_field_entry_view.js.coffee +104 -0
- data/app/assets/javascripts/locomotive/views/content_types/custom_fields_view.coffee +94 -0
- data/app/assets/javascripts/locomotive/views/content_types/edit_view.coffee +14 -0
- data/app/assets/javascripts/locomotive/views/content_types/new_view.js.coffee +11 -0
- data/app/assets/javascripts/locomotive/views/content_types/select_options_view.js.coffee +89 -0
- data/app/assets/javascripts/locomotive/views/current_site/edit_view.js.coffee +86 -0
- data/app/assets/javascripts/locomotive/views/editable_elements/control_view.js.coffee +24 -0
- data/app/assets/javascripts/locomotive/views/editable_elements/edit_all_view.js.coffee +83 -0
- data/app/assets/javascripts/locomotive/views/editable_elements/file_view.js.coffee +74 -0
- data/app/assets/javascripts/locomotive/views/editable_elements/long_text_view.js.coffee +36 -0
- data/app/assets/javascripts/locomotive/views/editable_elements/short_text_view.js.coffee +22 -0
- data/app/assets/javascripts/locomotive/views/inline_editor/application_view.js.coffee +124 -0
- data/app/assets/javascripts/locomotive/views/inline_editor/toolbar_view.js.coffee +145 -0
- data/app/assets/javascripts/locomotive/views/my_account/edit_view.js.coffee +24 -0
- data/app/assets/javascripts/locomotive/views/pages/_form_view.js.coffee +162 -0
- data/app/assets/javascripts/locomotive/views/pages/edit_view.js.coffee +31 -0
- data/app/assets/javascripts/locomotive/views/pages/index_view.js.coffee +11 -0
- data/app/assets/javascripts/locomotive/views/pages/list_view.js.coffee +40 -0
- data/app/assets/javascripts/locomotive/views/pages/new_view.js.coffee +8 -0
- data/app/assets/javascripts/locomotive/views/shared/asset_picker_view.js.coffee +92 -0
- data/app/assets/javascripts/locomotive/views/shared/fields/file_view.js.coffee +88 -0
- data/app/assets/javascripts/locomotive/views/shared/fields/has_many_view.js.coffee +125 -0
- data/app/assets/javascripts/locomotive/views/shared/fields/many_to_many_view.js.coffee +131 -0
- data/app/assets/javascripts/locomotive/views/shared/fields/select_view.js.coffee +83 -0
- data/app/assets/javascripts/locomotive/views/shared/form_view.js.coffee +138 -0
- data/app/assets/javascripts/locomotive/views/shared/list_item_view.js.coffee +22 -0
- data/app/assets/javascripts/locomotive/views/shared/list_view.js.coffee +53 -0
- data/app/assets/javascripts/locomotive/views/sites/domain_entry_view.js.coffee +26 -0
- data/app/assets/javascripts/locomotive/views/sites/domains_view.js.coffee +84 -0
- data/app/assets/javascripts/locomotive/views/sites/membership_entry_view.js.coffee +31 -0
- data/app/assets/javascripts/locomotive/views/sites/memberships_view.js.coffee +41 -0
- data/app/assets/javascripts/locomotive/views/sites/new_view.js.coffee +43 -0
- data/app/assets/javascripts/locomotive/views/snippets/_form_view.js.coffee +75 -0
- data/app/assets/javascripts/locomotive/views/snippets/edit_view.js.coffee +6 -0
- data/app/assets/javascripts/locomotive/views/snippets/list_item_view.js.coffee +8 -0
- data/app/assets/javascripts/locomotive/views/snippets/list_view.js.coffee +17 -0
- data/app/assets/javascripts/locomotive/views/snippets/new_view.js.coffee +8 -0
- data/app/assets/javascripts/locomotive/views/theme_assets/_form_view.js.coffee +104 -0
- data/app/assets/javascripts/locomotive/views/theme_assets/edit_view.js.coffee +16 -0
- data/app/assets/javascripts/locomotive/views/theme_assets/image_picker_view.js.coffee +48 -0
- data/app/assets/javascripts/locomotive/views/theme_assets/index_view.js.coffee +91 -0
- data/app/assets/javascripts/locomotive/views/theme_assets/list_item_view.js.coffee +8 -0
- data/app/assets/javascripts/locomotive/views/theme_assets/list_view.js.coffee +17 -0
- data/app/assets/javascripts/locomotive/views/theme_assets/new_view.js.coffee +8 -0
- 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 +240 -0
- data/app/assets/javascripts/tinymce/plugins/locomotive_media/editor_plugin.js +78 -0
- data/app/assets/javascripts/tinymce/themes/advanced/skins/locomotive/content.css +66 -0
- data/app/assets/javascripts/tinymce/themes/advanced/skins/locomotive/dialog.css.scss +78 -0
- data/app/assets/javascripts/tinymce/themes/advanced/skins/locomotive/img/butt2.png +0 -0
- data/app/assets/javascripts/tinymce/themes/advanced/skins/locomotive/img/button-bg.png +0 -0
- data/app/assets/javascripts/tinymce/themes/advanced/skins/locomotive/img/buttons.png +0 -0
- data/app/assets/javascripts/tinymce/themes/advanced/skins/locomotive/img/down_arrow.gif +0 -0
- data/app/assets/javascripts/tinymce/themes/advanced/skins/locomotive/img/fade-butt.png +0 -0
- data/app/assets/javascripts/tinymce/themes/advanced/skins/locomotive/img/icons.png +0 -0
- data/app/assets/javascripts/tinymce/themes/advanced/skins/locomotive/img/items.gif +0 -0
- data/app/assets/javascripts/tinymce/themes/advanced/skins/locomotive/img/menu-arrow.png +0 -0
- data/app/assets/javascripts/tinymce/themes/advanced/skins/locomotive/img/menu-check.png +0 -0
- data/app/assets/javascripts/tinymce/themes/advanced/skins/locomotive/img/progress.gif +0 -0
- data/app/assets/javascripts/tinymce/themes/advanced/skins/locomotive/img/tabs.gif +0 -0
- data/app/assets/javascripts/tinymce/themes/advanced/skins/locomotive/img/toolbarbg.png +0 -0
- data/app/assets/javascripts/tinymce/themes/advanced/skins/locomotive/ui.css +1018 -0
- data/app/assets/stylesheets/locomotive.css +16 -0
- data/app/assets/stylesheets/locomotive/backoffice/_box.css.scss +157 -0
- data/app/assets/stylesheets/locomotive/backoffice/_buttons.css.scss +178 -0
- data/app/assets/stylesheets/locomotive/backoffice/application.css.scss +332 -0
- data/app/assets/stylesheets/locomotive/backoffice/codemirror_changes.css.scss +19 -0
- data/app/assets/stylesheets/locomotive/backoffice/content_assets.css.scss +130 -0
- data/app/assets/stylesheets/locomotive/backoffice/datepicker.css.scss +178 -0
- data/app/assets/stylesheets/locomotive/backoffice/dialog_changes.css.scss +141 -0
- data/app/assets/stylesheets/locomotive/backoffice/editable_elements.css.scss +71 -0
- data/app/assets/stylesheets/locomotive/backoffice/formtastic_changes.css.scss +735 -0
- data/app/assets/stylesheets/locomotive/backoffice/layout.css.scss +205 -0
- data/app/assets/stylesheets/locomotive/backoffice/menu.css +8 -0
- data/app/assets/stylesheets/locomotive/backoffice/menu/_colors.css.scss +125 -0
- data/app/assets/stylesheets/locomotive/backoffice/menu/_helpers.css.scss +6 -0
- data/app/assets/stylesheets/locomotive/backoffice/menu/default.css.scss +32 -0
- data/app/assets/stylesheets/locomotive/backoffice/menu/main.css.scss +127 -0
- data/app/assets/stylesheets/locomotive/backoffice/menu/sub.css.scss +276 -0
- data/app/assets/stylesheets/locomotive/backoffice/sites_picker.css.scss +12 -0
- data/app/assets/stylesheets/locomotive/inline_editor.css +13 -0
- data/app/assets/stylesheets/locomotive/inline_editor/_buttons.css.scss +60 -0
- data/app/assets/stylesheets/locomotive/inline_editor/layout.css.scss +22 -0
- data/app/assets/stylesheets/locomotive/inline_editor/toolbar.css.scss +114 -0
- data/app/assets/stylesheets/locomotive/not_logged_in.css +8 -0
- data/app/assets/stylesheets/locomotive/not_logged_in/installation.css.scss +62 -0
- data/app/assets/stylesheets/locomotive/not_logged_in/layout.css.scss +185 -0
- data/app/assets/stylesheets/locomotive/shared/_helpers.css.scss +150 -0
- data/app/assets/stylesheets/locomotive/shared/_picker.css.scss +73 -0
- data/app/assets/stylesheets/locomotive/shared/common.css.scss +34 -0
- data/app/assets/stylesheets/locomotive/shared/content_locale_picker.css.scss +80 -0
- data/app/assets/stylesheets/locomotive/shared/growl.css.scss +29 -0
- data/app/cells/locomotive/content_locale_picker/show.html.haml +7 -0
- data/app/cells/locomotive/content_locale_picker_cell.rb +21 -0
- data/app/cells/locomotive/global_actions/show.html.haml +12 -0
- data/app/cells/locomotive/global_actions_cell.rb +36 -0
- data/app/cells/locomotive/main_menu/show.html.haml +13 -0
- data/app/cells/locomotive/main_menu_cell.rb +12 -0
- data/app/cells/locomotive/menu/show.html.haml +1 -0
- data/app/cells/locomotive/menu_cell.rb +102 -0
- data/app/cells/locomotive/settings_menu_cell.rb +14 -0
- data/app/cells/locomotive/sub_menu/show.html.haml +4 -0
- data/app/cells/locomotive/sub_menu_cell.rb +13 -0
- data/app/controllers/locomotive/accounts_controller.rb +18 -0
- data/app/controllers/locomotive/api/accounts_controller.rb +79 -0
- data/app/controllers/locomotive/api/base_controller.rb +50 -0
- data/app/controllers/locomotive/api/content_assets_controller.rb +39 -0
- data/app/controllers/locomotive/api/content_entries_controller.rb +45 -0
- data/app/controllers/locomotive/api/content_types_controller.rb +39 -0
- data/app/controllers/locomotive/api/current_site_controller.rb +58 -0
- data/app/controllers/locomotive/api/documentation_controller.rb +15 -0
- data/app/controllers/locomotive/api/memberships_controller.rb +97 -0
- data/app/controllers/locomotive/api/my_account_controller.rb +35 -0
- data/app/controllers/locomotive/api/pages_controller.rb +41 -0
- data/app/controllers/locomotive/api/sites_controller.rb +93 -0
- data/app/controllers/locomotive/api/snippets_controller.rb +40 -0
- data/app/controllers/locomotive/api/theme_assets_controller.rb +39 -0
- data/app/controllers/locomotive/api/tokens_controller.rb +54 -0
- data/app/controllers/locomotive/api/translations_controller.rb +31 -0
- data/app/controllers/locomotive/base_controller.rb +61 -0
- data/app/controllers/locomotive/content_assets_controller.rb +23 -0
- data/app/controllers/locomotive/content_entries_controller.rb +71 -0
- data/app/controllers/locomotive/content_types_controller.rb +40 -0
- data/app/controllers/locomotive/current_site_controller.rb +52 -0
- data/app/controllers/locomotive/installation_controller.rb +72 -0
- data/app/controllers/locomotive/memberships_controller.rb +29 -0
- data/app/controllers/locomotive/my_account_controller.rb +24 -0
- data/app/controllers/locomotive/pages_controller.rb +63 -0
- data/app/controllers/locomotive/passwords_controller.rb +19 -0
- data/app/controllers/locomotive/public/base_controller.rb +22 -0
- data/app/controllers/locomotive/public/content_entries_controller.rb +55 -0
- data/app/controllers/locomotive/public/pages_controller.rb +50 -0
- data/app/controllers/locomotive/public/robots_controller.rb +16 -0
- data/app/controllers/locomotive/public/sitemaps_controller.rb +14 -0
- data/app/controllers/locomotive/sessions_controller.rb +29 -0
- data/app/controllers/locomotive/sites_controller.rb +33 -0
- data/app/controllers/locomotive/snippets_controller.rb +47 -0
- data/app/controllers/locomotive/theme_assets_controller.rb +52 -0
- data/app/controllers/locomotive/translations_controller.rb +32 -0
- data/app/helpers/locomotive/accounts_helper.rb +13 -0
- data/app/helpers/locomotive/base_helper.rb +182 -0
- data/app/helpers/locomotive/content_entries_helper.rb +15 -0
- data/app/helpers/locomotive/content_types_helper.rb +72 -0
- data/app/helpers/locomotive/custom_fields_helper.rb +70 -0
- data/app/helpers/locomotive/installation_helper.rb +9 -0
- data/app/helpers/locomotive/pages_helper.rb +95 -0
- data/app/helpers/locomotive/sites_helper.rb +15 -0
- data/app/helpers/locomotive/snippets_helper.rb +20 -0
- data/app/helpers/locomotive/theme_assets_helper.rb +30 -0
- data/app/helpers/locomotive/translations_helper.rb +19 -0
- data/app/inputs/locomotive/code_input.rb +51 -0
- data/app/inputs/locomotive/empty_input.rb +35 -0
- data/app/inputs/locomotive/file_input.rb +45 -0
- data/app/inputs/locomotive/locale_input.rb +40 -0
- data/app/inputs/locomotive/locales_input.rb +60 -0
- data/app/inputs/locomotive/rte_input.rb +13 -0
- data/app/inputs/locomotive/small_code_input.rb +22 -0
- data/app/inputs/locomotive/subdomain_input.rb +22 -0
- data/app/inputs/locomotive/toggle_input.rb +13 -0
- data/app/mailers/locomotive/devise_mailer.rb +10 -0
- data/app/mailers/locomotive/notifications.rb +15 -0
- data/app/models/locomotive/ability.rb +89 -0
- data/app/models/locomotive/account.rb +117 -0
- data/app/models/locomotive/content_asset.rb +40 -0
- data/app/models/locomotive/content_entry.rb +197 -0
- data/app/models/locomotive/content_type.rb +224 -0
- data/app/models/locomotive/editable_control.rb +52 -0
- data/app/models/locomotive/editable_element.rb +122 -0
- data/app/models/locomotive/editable_file.rb +85 -0
- data/app/models/locomotive/editable_long_text.rb +5 -0
- data/app/models/locomotive/editable_short_text.rb +66 -0
- data/app/models/locomotive/extensions/asset/types.rb +31 -0
- data/app/models/locomotive/extensions/asset/vignette.rb +19 -0
- data/app/models/locomotive/extensions/content_type/default_values.rb +57 -0
- data/app/models/locomotive/extensions/content_type/item_template.rb +49 -0
- data/app/models/locomotive/extensions/content_type/sync.rb +62 -0
- data/app/models/locomotive/extensions/page/editable_elements.rb +105 -0
- data/app/models/locomotive/extensions/page/listed.rb +18 -0
- data/app/models/locomotive/extensions/page/parse.rb +125 -0
- data/app/models/locomotive/extensions/page/redirect.rb +25 -0
- data/app/models/locomotive/extensions/page/render.rb +93 -0
- data/app/models/locomotive/extensions/page/templatized.rb +163 -0
- data/app/models/locomotive/extensions/page/tree.rb +133 -0
- data/app/models/locomotive/extensions/shared/seo.rb +16 -0
- data/app/models/locomotive/extensions/site/first_installation.rb +20 -0
- data/app/models/locomotive/extensions/site/locales.rb +112 -0
- data/app/models/locomotive/extensions/site/subdomain_domains.rb +91 -0
- data/app/models/locomotive/membership.rb +75 -0
- data/app/models/locomotive/page.rb +130 -0
- data/app/models/locomotive/site.rb +79 -0
- data/app/models/locomotive/snippet.rb +70 -0
- data/app/models/locomotive/theme_asset.rb +175 -0
- data/app/models/locomotive/translation.rb +32 -0
- data/app/presenters/locomotive/account_presenter.rb +19 -0
- data/app/presenters/locomotive/base_presenter.rb +99 -0
- data/app/presenters/locomotive/content_asset_presenter.rb +43 -0
- data/app/presenters/locomotive/content_entry_presenter.rb +217 -0
- data/app/presenters/locomotive/content_field_presenter.rb +71 -0
- data/app/presenters/locomotive/content_type_presenter.rb +68 -0
- data/app/presenters/locomotive/editable_control_presenter.rb +19 -0
- data/app/presenters/locomotive/editable_element_presenter.rb +40 -0
- data/app/presenters/locomotive/editable_file_presenter.rb +29 -0
- data/app/presenters/locomotive/editable_long_text_presenter.rb +5 -0
- data/app/presenters/locomotive/editable_short_text_presenter.rb +27 -0
- data/app/presenters/locomotive/membership_presenter.rb +36 -0
- data/app/presenters/locomotive/page_presenter.rb +58 -0
- data/app/presenters/locomotive/site_presenter.rb +36 -0
- data/app/presenters/locomotive/snippet_presenter.rb +22 -0
- data/app/presenters/locomotive/theme_asset_presenter.rb +61 -0
- data/app/presenters/locomotive/translation_presenter.rb +9 -0
- data/app/uploaders/locomotive/content_asset_uploader.rb +13 -0
- data/app/uploaders/locomotive/editable_file_uploader.rb +15 -0
- data/app/uploaders/locomotive/theme_asset_uploader.rb +28 -0
- data/app/views/locomotive/accounts/new.html.haml +21 -0
- data/app/views/locomotive/content_assets/_asset.html.haml +5 -0
- data/app/views/locomotive/content_assets/_picker.html.haml +33 -0
- data/app/views/locomotive/content_entries/_form.html.haml +22 -0
- data/app/views/locomotive/content_entries/_list.html.haml +18 -0
- data/app/views/locomotive/content_entries/edit.html.haml +21 -0
- data/app/views/locomotive/content_entries/index.html.haml +32 -0
- data/app/views/locomotive/content_entries/new.html.haml +19 -0
- data/app/views/locomotive/content_types/_form.html.haml +39 -0
- data/app/views/locomotive/content_types/edit.html.haml +19 -0
- data/app/views/locomotive/content_types/new.html.haml +15 -0
- data/app/views/locomotive/current_site/_form.html.haml +36 -0
- data/app/views/locomotive/current_site/edit.html.haml +19 -0
- data/app/views/locomotive/custom_fields/_form.html.haml +61 -0
- data/app/views/locomotive/custom_fields/_select_templates.html.haml +16 -0
- data/app/views/locomotive/custom_fields/types/_belongs_to.html.haml +5 -0
- data/app/views/locomotive/custom_fields/types/_boolean.html.haml +4 -0
- data/app/views/locomotive/custom_fields/types/_date.html.haml +5 -0
- data/app/views/locomotive/custom_fields/types/_file.html.haml +4 -0
- data/app/views/locomotive/custom_fields/types/_has_many.html.haml +70 -0
- data/app/views/locomotive/custom_fields/types/_many_to_many.html.haml +41 -0
- data/app/views/locomotive/custom_fields/types/_select.html.haml +34 -0
- data/app/views/locomotive/custom_fields/types/_string.html.haml +4 -0
- data/app/views/locomotive/custom_fields/types/_text.html.haml +5 -0
- data/app/views/locomotive/devise_mailer/reset_password_instructions.html.haml +12 -0
- data/app/views/locomotive/errors/404.html.haml +7 -0
- data/app/views/locomotive/errors/500.html.haml +7 -0
- data/app/views/locomotive/errors/no_page.html.haml +1 -0
- data/app/views/locomotive/errors/no_site.html.haml +1 -0
- data/app/views/locomotive/installation/step_1.html.haml +23 -0
- data/app/views/locomotive/installation/step_2.html.haml +24 -0
- data/app/views/locomotive/layouts/application.html.haml +34 -0
- data/app/views/locomotive/layouts/error.html.haml +1 -0
- data/app/views/locomotive/layouts/not_logged_in.html.haml +18 -0
- data/app/views/locomotive/memberships/new.html.haml +14 -0
- data/app/views/locomotive/my_account/edit.html.haml +40 -0
- data/app/views/locomotive/notifications/new_content_entry.html.haml +29 -0
- data/app/views/locomotive/pages/_editable_elements.html.haml +64 -0
- data/app/views/locomotive/pages/_form.html.haml +61 -0
- data/app/views/locomotive/pages/_page.html.haml +42 -0
- data/app/views/locomotive/pages/edit.html.haml +18 -0
- data/app/views/locomotive/pages/index.html.haml +19 -0
- data/app/views/locomotive/pages/new.html.haml +15 -0
- data/app/views/locomotive/passwords/edit.html.haml +18 -0
- data/app/views/locomotive/passwords/new.html.haml +17 -0
- data/app/views/locomotive/public/pages/show_toolbar.html.haml +64 -0
- data/app/views/locomotive/public/sitemaps/show.xml.builder +29 -0
- data/app/views/locomotive/sessions/new.html.haml +17 -0
- data/app/views/locomotive/shared/_footer.html.haml +1 -0
- data/app/views/locomotive/shared/_form_actions.html.haml +14 -0
- data/app/views/locomotive/shared/_head.html.haml +38 -0
- data/app/views/locomotive/shared/_header.html.haml +10 -0
- data/app/views/locomotive/shared/_locale_picker_link.html.haml +6 -0
- data/app/views/locomotive/shared/_main_app_head.html.haml +1 -0
- data/app/views/locomotive/shared/_site_picker.html.haml +10 -0
- data/app/views/locomotive/shared/actions/_contents.html.haml +7 -0
- data/app/views/locomotive/shared/menu/_contents.html.haml +51 -0
- data/app/views/locomotive/sites/_domains.html.haml +22 -0
- data/app/views/locomotive/sites/_form.html.haml +12 -0
- data/app/views/locomotive/sites/_memberships.html.haml +27 -0
- data/app/views/locomotive/sites/new.html.haml +12 -0
- data/app/views/locomotive/snippets/_form.html.haml +13 -0
- data/app/views/locomotive/snippets/_snippet.html.haml +8 -0
- data/app/views/locomotive/snippets/edit.html.haml +18 -0
- data/app/views/locomotive/snippets/new.html.haml +15 -0
- data/app/views/locomotive/theme_assets/_asset.html.haml +11 -0
- data/app/views/locomotive/theme_assets/_form.html.haml +35 -0
- data/app/views/locomotive/theme_assets/_list.html.haml +7 -0
- data/app/views/locomotive/theme_assets/_picker.html.haml +25 -0
- data/app/views/locomotive/theme_assets/edit.html.haml +21 -0
- data/app/views/locomotive/theme_assets/index.html.haml +50 -0
- data/app/views/locomotive/theme_assets/new.html.haml +12 -0
- 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 +26 -0
- data/app/views/locomotive/translations/new.html.haml +12 -0
- data/config/cucumber.yml +8 -0
- data/config/initializers/deny_phantomjs_ttf.rb +29 -0
- data/config/initializers/devise.rb +15 -0
- data/config/initializers/formtastic.rb +4 -0
- data/config/initializers/haml.rb +2 -0
- data/config/initializers/locomotive_loaded_first.rb +19 -0
- data/config/locales/admin_ui.de.yml +316 -0
- data/config/locales/admin_ui.en.yml +332 -0
- data/config/locales/admin_ui.es.yml +296 -0
- data/config/locales/admin_ui.et.yml +315 -0
- data/config/locales/admin_ui.fr.yml +326 -0
- data/config/locales/admin_ui.it.yml +295 -0
- data/config/locales/admin_ui.nb.yml +314 -0
- data/config/locales/admin_ui.nl.yml +279 -0
- data/config/locales/admin_ui.pl.yml +319 -0
- data/config/locales/admin_ui.pt-BR.yml +274 -0
- data/config/locales/admin_ui.ru.yml +313 -0
- data/config/locales/carrierwave.de.yml +4 -0
- data/config/locales/carrierwave.en.yml +4 -0
- data/config/locales/carrierwave.es.yml +4 -0
- data/config/locales/carrierwave.et.yml +4 -0
- data/config/locales/carrierwave.fr.yml +4 -0
- data/config/locales/carrierwave.it.yml +4 -0
- data/config/locales/carrierwave.nb.yml +4 -0
- data/config/locales/carrierwave.nl.yml +4 -0
- data/config/locales/carrierwave.pl.yml +4 -0
- data/config/locales/carrierwave.pt-BR.yml +4 -0
- data/config/locales/carrierwave.ru.yml +4 -0
- data/config/locales/default.de.yml +244 -0
- data/config/locales/default.en.yml +43 -0
- data/config/locales/default.es.yml +216 -0
- data/config/locales/default.et.yml +240 -0
- data/config/locales/default.fr.yml +224 -0
- data/config/locales/default.it.yml +243 -0
- data/config/locales/default.nb.yml +313 -0
- data/config/locales/default.nl.yml +170 -0
- data/config/locales/default.pl.yml +317 -0
- data/config/locales/default.pt-BR.yml +211 -0
- data/config/locales/default.ru.yml +279 -0
- data/config/locales/devise.de.yml +62 -0
- data/config/locales/devise.en.yml +63 -0
- data/config/locales/devise.es.yml +63 -0
- data/config/locales/devise.et.yml +64 -0
- data/config/locales/devise.fr.yml +67 -0
- data/config/locales/devise.it.yml +63 -0
- data/config/locales/devise.nb.yml +63 -0
- data/config/locales/devise.nl.yml +63 -0
- data/config/locales/devise.pl.yml +63 -0
- data/config/locales/devise.pt-BR.yml +61 -0
- data/config/locales/devise.ru.yml +63 -0
- data/config/locales/flash.de.yml +106 -0
- data/config/locales/flash.en.yml +115 -0
- data/config/locales/flash.es.yml +106 -0
- data/config/locales/flash.et.yml +106 -0
- data/config/locales/flash.fr.yml +106 -0
- data/config/locales/flash.it.yml +106 -0
- data/config/locales/flash.nb.yml +106 -0
- data/config/locales/flash.nl.yml +106 -0
- data/config/locales/flash.pl.yml +106 -0
- data/config/locales/flash.pt-BR.yml +106 -0
- data/config/locales/flash.ru.yml +106 -0
- data/config/locales/formtastic.de.yml +97 -0
- data/config/locales/formtastic.en.yml +105 -0
- data/config/locales/formtastic.es.yml +84 -0
- data/config/locales/formtastic.et.yml +103 -0
- data/config/locales/formtastic.fr.yml +94 -0
- data/config/locales/formtastic.it.yml +99 -0
- data/config/locales/formtastic.nb.yml +103 -0
- data/config/locales/formtastic.nl.yml +85 -0
- data/config/locales/formtastic.pl.yml +105 -0
- data/config/locales/formtastic.pt-BR.yml +70 -0
- data/config/locales/formtastic.ru.yml +103 -0
- data/config/routes.rb +116 -0
- data/lib/generators/locomotive/install/install_generator.rb +35 -0
- data/lib/generators/locomotive/install/templates/README +26 -0
- data/lib/generators/locomotive/install/templates/carrierwave.rb +28 -0
- data/lib/generators/locomotive/install/templates/dragonfly.rb +22 -0
- data/lib/generators/locomotive/install/templates/locomotive.rb +69 -0
- data/lib/generators/locomotive/install/templates/mongoid.yml +34 -0
- data/lib/locomotive.rb +136 -0
- data/lib/locomotive/action_controller.rb +5 -0
- data/lib/locomotive/action_controller/locale_helpers.rb +61 -0
- data/lib/locomotive/action_controller/public_responder.rb +17 -0
- data/lib/locomotive/action_controller/responder.rb +78 -0
- data/lib/locomotive/action_controller/section_helpers.rb +29 -0
- data/lib/locomotive/action_controller/url_helpers.rb +38 -0
- data/lib/locomotive/carrierwave.rb +10 -0
- data/lib/locomotive/carrierwave/asset.rb +72 -0
- data/lib/locomotive/carrierwave/base.rb +15 -0
- data/lib/locomotive/carrierwave/patches.rb +32 -0
- data/lib/locomotive/configuration.rb +122 -0
- data/lib/locomotive/core_ext.rb +64 -0
- data/lib/locomotive/custom_fields.rb +66 -0
- data/lib/locomotive/dependencies.rb +30 -0
- data/lib/locomotive/devise.rb +1 -0
- data/lib/locomotive/dragonfly.rb +38 -0
- data/lib/locomotive/engine.rb +37 -0
- data/lib/locomotive/formtastic.rb +13 -0
- data/lib/locomotive/haml.rb +1 -0
- data/lib/locomotive/httparty.rb +2 -0
- data/lib/locomotive/httparty/patches.rb +18 -0
- data/lib/locomotive/httparty/webservice.rb +42 -0
- data/lib/locomotive/kaminari.rb +35 -0
- data/lib/locomotive/liquid.rb +7 -0
- data/lib/locomotive/liquid/drops/base.rb +42 -0
- data/lib/locomotive/liquid/drops/content_entry.rb +76 -0
- data/lib/locomotive/liquid/drops/content_types.rb +50 -0
- data/lib/locomotive/liquid/drops/current_user.rb +21 -0
- data/lib/locomotive/liquid/drops/page.rb +55 -0
- data/lib/locomotive/liquid/drops/proxy_collection.rb +56 -0
- data/lib/locomotive/liquid/drops/site.rb +19 -0
- data/lib/locomotive/liquid/drops/uploader.rb +15 -0
- data/lib/locomotive/liquid/errors.rb +7 -0
- data/lib/locomotive/liquid/filters/base.rb +47 -0
- data/lib/locomotive/liquid/filters/date.rb +54 -0
- data/lib/locomotive/liquid/filters/html.rb +115 -0
- data/lib/locomotive/liquid/filters/misc.rb +65 -0
- data/lib/locomotive/liquid/filters/resize.rb +16 -0
- data/lib/locomotive/liquid/filters/text.rb +45 -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 +67 -0
- data/lib/locomotive/liquid/tags/csrf.rb +40 -0
- data/lib/locomotive/liquid/tags/editable.rb +5 -0
- data/lib/locomotive/liquid/tags/editable/base.rb +88 -0
- data/lib/locomotive/liquid/tags/editable/control.rb +31 -0
- data/lib/locomotive/liquid/tags/editable/file.rb +39 -0
- data/lib/locomotive/liquid/tags/editable/long_text.rb +33 -0
- data/lib/locomotive/liquid/tags/editable/short_text.rb +41 -0
- data/lib/locomotive/liquid/tags/extends.rb +47 -0
- data/lib/locomotive/liquid/tags/google_analytics.rb +39 -0
- data/lib/locomotive/liquid/tags/inherited_block.rb +31 -0
- data/lib/locomotive/liquid/tags/inline_editor.rb +40 -0
- data/lib/locomotive/liquid/tags/locale_switcher.rb +83 -0
- data/lib/locomotive/liquid/tags/nav.rb +155 -0
- data/lib/locomotive/liquid/tags/paginate.rb +111 -0
- data/lib/locomotive/liquid/tags/seo.rb +72 -0
- data/lib/locomotive/liquid/tags/snippet.rb +75 -0
- data/lib/locomotive/liquid/tags/with_scope.rb +47 -0
- data/lib/locomotive/logger.rb +11 -0
- data/lib/locomotive/middlewares.rb +4 -0
- data/lib/locomotive/middlewares/cache.rb +27 -0
- data/lib/locomotive/middlewares/fonts.rb +42 -0
- data/lib/locomotive/middlewares/inline_editor.rb +36 -0
- data/lib/locomotive/middlewares/seo_trailing_slash.rb +24 -0
- data/lib/locomotive/misc/api_documentation.rb +96 -0
- data/lib/locomotive/misc/api_documentation/bootstrap.html.haml +119 -0
- data/lib/locomotive/mongoid.rb +4 -0
- data/lib/locomotive/mongoid/document.rb +19 -0
- data/lib/locomotive/mongoid/liquid.rb +39 -0
- data/lib/locomotive/mongoid/patches.rb +106 -0
- data/lib/locomotive/mongoid/presenter.rb +73 -0
- data/lib/locomotive/presentable.rb +212 -0
- data/lib/locomotive/rails.rb +1 -0
- data/lib/locomotive/rails/action_view.rb +9 -0
- data/lib/locomotive/regexps.rb +11 -0
- data/lib/locomotive/render.rb +177 -0
- data/lib/locomotive/routing.rb +2 -0
- data/lib/locomotive/routing/default_constraint.rb +42 -0
- data/lib/locomotive/routing/site_dispatcher.rb +54 -0
- data/lib/locomotive/session_store.rb +64 -0
- data/lib/locomotive/version.rb +3 -0
- data/lib/locomotive_cms.rb +1 -0
- data/lib/tasks/cucumber.rake +66 -0
- data/lib/tasks/locomotive.rake +220 -0
- data/public/favicon.ico +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/ICanHandlebarz.js +88 -0
- data/vendor/assets/javascripts/locomotive/backbone.modelbinding.js +565 -0
- data/vendor/assets/javascripts/locomotive/backbone.sync.js +113 -0
- data/vendor/assets/javascripts/locomotive/cmd.js +31 -0
- data/vendor/assets/javascripts/locomotive/cookies.js +96 -0
- data/vendor/assets/javascripts/locomotive/datepicker_i18n.js.erb +28 -0
- data/vendor/assets/javascripts/locomotive/editable_field.js +50 -0
- data/vendor/assets/javascripts/locomotive/form_submit_notification.js +39 -0
- data/vendor/assets/javascripts/locomotive/growl.js +143 -0
- data/vendor/assets/javascripts/locomotive/handlebars.js +1493 -0
- data/vendor/assets/javascripts/locomotive/liquid_mode.js +42 -0
- data/vendor/assets/javascripts/locomotive/menu_toggler.js +37 -0
- data/vendor/assets/javascripts/locomotive/resize.js +9 -0
- data/vendor/assets/javascripts/locomotive/slugify.js +31 -0
- data/vendor/assets/javascripts/locomotive/smartupdater.js +296 -0
- data/vendor/assets/javascripts/locomotive/subscribe.js +367 -0
- data/vendor/assets/javascripts/locomotive/toggle.js +143 -0
- data/vendor/assets/javascripts/locomotive/vendor.js +1 -0
- data/vendor/assets/stylesheets/locomotive/blueprint/ie.css +26 -0
- data/vendor/assets/stylesheets/locomotive/blueprint/print.css +30 -0
- data/vendor/assets/stylesheets/locomotive/blueprint/screen.css +253 -0
- data/vendor/assets/stylesheets/locomotive/font-awesome.scss +329 -0
- data/vendor/assets/stylesheets/locomotive/jquery.css +3 -0
- data/vendor/assets/stylesheets/locomotive/jquery/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- data/vendor/assets/stylesheets/locomotive/jquery/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
- data/vendor/assets/stylesheets/locomotive/jquery/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
- data/vendor/assets/stylesheets/locomotive/jquery/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/vendor/assets/stylesheets/locomotive/jquery/images/ui-bg_glass_75_dadada_1x400.png +0 -0
- data/vendor/assets/stylesheets/locomotive/jquery/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
- data/vendor/assets/stylesheets/locomotive/jquery/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
- data/vendor/assets/stylesheets/locomotive/jquery/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
- data/vendor/assets/stylesheets/locomotive/jquery/images/ui-icons_222222_256x240.png +0 -0
- data/vendor/assets/stylesheets/locomotive/jquery/images/ui-icons_2e83ff_256x240.png +0 -0
- data/vendor/assets/stylesheets/locomotive/jquery/images/ui-icons_454545_256x240.png +0 -0
- data/vendor/assets/stylesheets/locomotive/jquery/images/ui-icons_888888_256x240.png +0 -0
- data/vendor/assets/stylesheets/locomotive/jquery/images/ui-icons_cd0a0a_256x240.png +0 -0
- data/vendor/assets/stylesheets/locomotive/jquery/images/ui-icons_ffffff_256x240.png +0 -0
- data/vendor/assets/stylesheets/locomotive/jquery/ui.css +406 -0
- data/vendor/assets/stylesheets/locomotive/liquid_mode.css +7 -0
- data/vendor/assets/stylesheets/locomotive/toggle.css.scss +75 -0
- metadata +1171 -0
@@ -0,0 +1,74 @@
|
|
1
|
+
Locomotive.Views.EditableElements ||= {}
|
2
|
+
|
3
|
+
class Locomotive.Views.EditableElements.FileView extends Backbone.View
|
4
|
+
|
5
|
+
tagName: 'li'
|
6
|
+
|
7
|
+
className: 'file input'
|
8
|
+
|
9
|
+
states:
|
10
|
+
change: false
|
11
|
+
delete: false
|
12
|
+
|
13
|
+
events:
|
14
|
+
'click a.change': 'toggle_change'
|
15
|
+
'click a.delete': 'toggle_delete'
|
16
|
+
|
17
|
+
render: ->
|
18
|
+
$(@el).html(ich.editable_file_input(@model.toJSON()))
|
19
|
+
|
20
|
+
# only in HTML 5
|
21
|
+
@$('input[type=file]').bind 'change', (event) =>
|
22
|
+
input = $(event.target)[0]
|
23
|
+
if input.files?
|
24
|
+
@model.set(source: input.files[0])
|
25
|
+
|
26
|
+
return @
|
27
|
+
|
28
|
+
after_render: ->
|
29
|
+
# do nothing
|
30
|
+
|
31
|
+
refresh: ->
|
32
|
+
@$('input[type=file]').unbind 'change'
|
33
|
+
@states = { 'change': false, 'delete': false }
|
34
|
+
@render()
|
35
|
+
|
36
|
+
toggle_change: (event) ->
|
37
|
+
@_toggle event, 'change',
|
38
|
+
on_change: =>
|
39
|
+
@$('a:first').hide() & @$('input[type=file]').show() & @$('a.delete').hide()
|
40
|
+
on_cancel: =>
|
41
|
+
@model.set(source: null)
|
42
|
+
@$('a:first').show() & @$('input[type=file]').val('').hide() & @$('a.delete').show()
|
43
|
+
|
44
|
+
toggle_delete: (event) ->
|
45
|
+
@_toggle event, 'delete',
|
46
|
+
on_change: =>
|
47
|
+
@$('a:first').addClass('deleted') & @$('a.change').hide()
|
48
|
+
@$('input[type=hidden].remove-flag').val('1')
|
49
|
+
@model.set('remove_source': true)
|
50
|
+
on_cancel: =>
|
51
|
+
@$('a:first').removeClass('deleted') & @$('a.change').show()
|
52
|
+
@$('input[type=hidden].remove-flag').val('0')
|
53
|
+
@model.set('remove_source': false)
|
54
|
+
|
55
|
+
_toggle: (event, state, options) ->
|
56
|
+
event.stopPropagation() & event.preventDefault()
|
57
|
+
|
58
|
+
button = $(event.target)
|
59
|
+
label = button.attr('data-alt-label')
|
60
|
+
|
61
|
+
unless @states[state]
|
62
|
+
options.on_change()
|
63
|
+
else
|
64
|
+
options.on_cancel()
|
65
|
+
|
66
|
+
button.attr('data-alt-label', button.html())
|
67
|
+
|
68
|
+
button.html(label)
|
69
|
+
|
70
|
+
@states[state] = !@states[state]
|
71
|
+
|
72
|
+
remove: ->
|
73
|
+
@$('input[type=file]').unbind 'change'
|
74
|
+
super
|
@@ -0,0 +1,36 @@
|
|
1
|
+
#= require ./short_text_view
|
2
|
+
|
3
|
+
Locomotive.Views.EditableElements ||= {}
|
4
|
+
|
5
|
+
class Locomotive.Views.EditableElements.LongTextView extends Backbone.View
|
6
|
+
|
7
|
+
tagName: 'li'
|
8
|
+
|
9
|
+
className: 'text input html'
|
10
|
+
|
11
|
+
render: ->
|
12
|
+
$(@el).html(ich.editable_text_input(@model.toJSON()))
|
13
|
+
|
14
|
+
return @
|
15
|
+
|
16
|
+
after_render: ->
|
17
|
+
settings = _.extend {}, @tinymce_settings(),
|
18
|
+
oninit: ((editor) =>
|
19
|
+
$.cmd 'S', (() =>
|
20
|
+
@model.set(content: editor.getBody().innerHTML)
|
21
|
+
$(@el).parents('form').trigger('submit')
|
22
|
+
), [], ignoreCase: true, document: editor.dom.doc),
|
23
|
+
onchange_callback: (editor) =>
|
24
|
+
@model.set(content: editor.getBody().innerHTML)
|
25
|
+
|
26
|
+
@$('textarea').tinymce(settings)
|
27
|
+
|
28
|
+
tinymce_settings: ->
|
29
|
+
_.extend { language: window.locale }, window.Locomotive.tinyMCE.defaultSettings
|
30
|
+
|
31
|
+
refresh: ->
|
32
|
+
# do nothing
|
33
|
+
|
34
|
+
remove: ->
|
35
|
+
@$('textarea').tinymce().destroy()
|
36
|
+
super
|
@@ -0,0 +1,22 @@
|
|
1
|
+
Locomotive.Views.EditableElements ||= {}
|
2
|
+
|
3
|
+
class Locomotive.Views.EditableElements.ShortTextView extends Backbone.View
|
4
|
+
|
5
|
+
tagName: 'li'
|
6
|
+
|
7
|
+
className: 'text input short'
|
8
|
+
|
9
|
+
render: ->
|
10
|
+
$(@el).html(ich.editable_text_input(@model.toJSON()))
|
11
|
+
|
12
|
+
@$('textarea').bind 'keyup', (event) =>
|
13
|
+
input = $(event.target)
|
14
|
+
@model.set(content: input.val())
|
15
|
+
|
16
|
+
return @
|
17
|
+
|
18
|
+
after_render: ->
|
19
|
+
# do nothing
|
20
|
+
|
21
|
+
refresh: ->
|
22
|
+
# do nothing
|
@@ -0,0 +1,124 @@
|
|
1
|
+
Locomotive.Views.InlineEditor ||= {}
|
2
|
+
|
3
|
+
#= require ./toolbar_view
|
4
|
+
|
5
|
+
class Locomotive.Views.InlineEditor.ApplicationView extends Backbone.View
|
6
|
+
|
7
|
+
el: 'body'
|
8
|
+
|
9
|
+
initialize: ->
|
10
|
+
super
|
11
|
+
|
12
|
+
@iframe = @$('#page iframe')
|
13
|
+
|
14
|
+
_.bindAll(@, '_$')
|
15
|
+
|
16
|
+
@toolbar_view = new Locomotive.Views.InlineEditor.ToolbarView(target: @iframe)
|
17
|
+
|
18
|
+
@content_assets_picker_view = new Locomotive.Views.ContentAssets.PickerView(collection: new Locomotive.Models.ContentAssetsCollection())
|
19
|
+
|
20
|
+
render: ->
|
21
|
+
super
|
22
|
+
|
23
|
+
@enable_iframe_autoheight()
|
24
|
+
|
25
|
+
@toolbar_view.render()
|
26
|
+
|
27
|
+
@content_assets_picker_view.render()
|
28
|
+
|
29
|
+
enable_iframe_autoheight: ->
|
30
|
+
iframe = @iframe
|
31
|
+
|
32
|
+
iframe.load =>
|
33
|
+
if @_$('meta[name=inline-editor]').size() > 0
|
34
|
+
# bind the resize event. When the iFrame's size changes, update its height
|
35
|
+
iframe_content = iframe.contents()
|
36
|
+
iframe_content.resize ->
|
37
|
+
elem = $(this)
|
38
|
+
|
39
|
+
if elem.outerHeight(true) > iframe.outerHeight(true) # Resize the iFrame.
|
40
|
+
iframe.css height: elem.outerHeight(true)
|
41
|
+
|
42
|
+
# Resize the iFrame immediately.
|
43
|
+
iframe_content.resize()
|
44
|
+
else
|
45
|
+
@toolbar_view.show_status('disabled', true).hide_editing_mode_block()
|
46
|
+
|
47
|
+
# keep the user in the admin mode
|
48
|
+
@enhance_iframe_links()
|
49
|
+
|
50
|
+
set_page: (attributes) ->
|
51
|
+
@page = new Locomotive.Models.Page(attributes)
|
52
|
+
|
53
|
+
@toolbar_view.model = @page
|
54
|
+
|
55
|
+
@enhance_iframe()
|
56
|
+
|
57
|
+
@toolbar_view.refresh()
|
58
|
+
|
59
|
+
enhance_iframe: ->
|
60
|
+
_window = @_window()
|
61
|
+
|
62
|
+
_window.Aloha.settings.locale = window.locale
|
63
|
+
|
64
|
+
# set main window title
|
65
|
+
window.document.title = _window.document.title
|
66
|
+
|
67
|
+
# allow to hit the refresh button and still stay on the same page
|
68
|
+
window.history.replaceState('OBJECT', 'TITLE', _window.location.href.replace('_edit', '_admin'))
|
69
|
+
|
70
|
+
# only but dirty way to handle back buttons with webkit.
|
71
|
+
if $.browser.webkit
|
72
|
+
window.history.pushState('OBJECT', 'TITLE', _window.location.href.replace('_edit', '_admin'))
|
73
|
+
|
74
|
+
# keep the user in the admin mode
|
75
|
+
@enhance_iframe_links _window.Aloha.jQuery
|
76
|
+
|
77
|
+
# notify the toolbar about changes
|
78
|
+
_window.Aloha.bind 'aloha-editable-deactivated', (event, editable) =>
|
79
|
+
@toolbar_view.notify editable.editable
|
80
|
+
|
81
|
+
enhance_iframe_links: (_jQuery) ->
|
82
|
+
toolbar_view = @toolbar_view
|
83
|
+
_jQuery ||= @_$
|
84
|
+
_window = @_window()
|
85
|
+
|
86
|
+
_jQuery('a[class!="x-tab-right"]').live 'click', (event) ->
|
87
|
+
link = _jQuery(event.target)
|
88
|
+
url = link.attr('href')
|
89
|
+
|
90
|
+
if url? && url.indexOf('#') != 0 && /^(www|http)/.exec(url) == null && /(\/_edit)$/.exec(url) == null && /^\/sites\//.exec(url) == null
|
91
|
+
# change the url only if aloha is enabled
|
92
|
+
unless link.parents('div.editable-long-text, div.editable-short-text').hasClass('aloha-editable')
|
93
|
+
|
94
|
+
url = '/index' if url == '/'
|
95
|
+
|
96
|
+
unless url.indexOf('_edit') > 0
|
97
|
+
if url.indexOf('?') > 0
|
98
|
+
url = url.replace('?', '/_edit?')
|
99
|
+
else
|
100
|
+
url = "#{url}/_edit"
|
101
|
+
|
102
|
+
# let the editor know that we are redirecting her/him to the target page
|
103
|
+
toolbar_view.show_status 'loading'
|
104
|
+
|
105
|
+
# redirection now !
|
106
|
+
link.attr('href', url)
|
107
|
+
else
|
108
|
+
# force the opening of a new window because we are in an iframe (security)
|
109
|
+
event.preventDefault()
|
110
|
+
window.open url
|
111
|
+
|
112
|
+
unique_dialog_zindex: ->
|
113
|
+
# returns the number of jQuery UI modals created in order to set a valid zIndex for each of them.
|
114
|
+
# Each modal window should have a different zIndex, otherwise there will be conflicts between them.
|
115
|
+
window.Locomotive.jQueryModals ||= 0
|
116
|
+
|
117
|
+
1050 + window.Locomotive.jQueryModals++
|
118
|
+
|
119
|
+
_window: ->
|
120
|
+
@iframe[0].contentWindow
|
121
|
+
|
122
|
+
_$: (selector) ->
|
123
|
+
$(selector, @_window().document)
|
124
|
+
|
@@ -0,0 +1,145 @@
|
|
1
|
+
Locomotive.Views.InlineEditor ||= {}
|
2
|
+
|
3
|
+
class Locomotive.Views.InlineEditor.ToolbarView extends Backbone.View
|
4
|
+
|
5
|
+
el: '#toolbar .inner'
|
6
|
+
|
7
|
+
events:
|
8
|
+
'change .editing-mode input[type=checkbox]': 'toggle_editing_mode'
|
9
|
+
'click .back a': 'back'
|
10
|
+
'click .element-actions a.save': 'save_changes'
|
11
|
+
'click .element-actions a.cancel': 'cancel_changes'
|
12
|
+
|
13
|
+
render: ->
|
14
|
+
super
|
15
|
+
|
16
|
+
@enable_editing_mode_checkbox()
|
17
|
+
|
18
|
+
@enable_content_locale_picker()
|
19
|
+
|
20
|
+
@
|
21
|
+
|
22
|
+
notify: (aloha_editable) ->
|
23
|
+
element_id = aloha_editable.obj.attr('data-element-id')
|
24
|
+
@model.get('editable_elements').get(element_id).set
|
25
|
+
content: aloha_editable.getContents()
|
26
|
+
|
27
|
+
@$('.element-actions').show()
|
28
|
+
|
29
|
+
@hide_editing_mode_block()
|
30
|
+
|
31
|
+
show_status: (status, growl) ->
|
32
|
+
growl ||= false
|
33
|
+
|
34
|
+
message = @$('h1').attr("data-#{status}-status")
|
35
|
+
@$('h1').html(message).removeClass().addClass(status)
|
36
|
+
|
37
|
+
$.growl('error', message) if growl
|
38
|
+
|
39
|
+
@
|
40
|
+
|
41
|
+
save_changes: (event) ->
|
42
|
+
event.stopPropagation() & event.preventDefault()
|
43
|
+
|
44
|
+
previous_attributes = _.clone @model.attributes
|
45
|
+
|
46
|
+
@model.save {},
|
47
|
+
success: (model, response, xhr) =>
|
48
|
+
model.attributes = previous_attributes
|
49
|
+
@$('.element-actions').hide()
|
50
|
+
@show_editing_mode_block()
|
51
|
+
error: (model, xhr) =>
|
52
|
+
@$('.element-actions').hide()
|
53
|
+
|
54
|
+
cancel_changes: (event) ->
|
55
|
+
event.stopPropagation() & event.preventDefault()
|
56
|
+
@options.target[0].contentWindow.location.href = @options.target[0].contentWindow.location.href
|
57
|
+
|
58
|
+
back: (event) ->
|
59
|
+
event.stopPropagation() & event.preventDefault()
|
60
|
+
if @model
|
61
|
+
window.location.href = @model.get('edit_url')
|
62
|
+
else
|
63
|
+
window.location.href = window.Locomotive.mounted_on + '/pages'
|
64
|
+
|
65
|
+
show_editing_mode_block: ->
|
66
|
+
@$('.editing-mode').show()
|
67
|
+
|
68
|
+
hide_editing_mode_block: ->
|
69
|
+
@$('.editing-mode').hide()
|
70
|
+
|
71
|
+
toggle_editing_mode: (event) ->
|
72
|
+
return if @editable_elements() == null
|
73
|
+
|
74
|
+
if $(event.target).is(':checked')
|
75
|
+
@editable_elements().aloha()
|
76
|
+
else
|
77
|
+
@editable_elements().removeClass('aloha-editable-highlight').mahalo()
|
78
|
+
|
79
|
+
editable_elements: ->
|
80
|
+
if @options.target[0].contentWindow.Aloha
|
81
|
+
@options.target[0].contentWindow.Aloha.jQuery('.editable-long-text, .editable-short-text')
|
82
|
+
else
|
83
|
+
null
|
84
|
+
|
85
|
+
enable_editing_mode_checkbox: ->
|
86
|
+
@$('.editing-mode input[type=checkbox]').checkToggle
|
87
|
+
on_label_color: '#fff'
|
88
|
+
off_label_color: '#bbb'
|
89
|
+
|
90
|
+
enable_content_locale_picker: ->
|
91
|
+
_window = @options.target[0].contentWindow
|
92
|
+
link = @$('#content-locale-picker-link')
|
93
|
+
picker = $('#content-locale-picker')
|
94
|
+
|
95
|
+
return if picker.size() == 0
|
96
|
+
|
97
|
+
link.bind 'click', (event) ->
|
98
|
+
event.stopPropagation() & event.preventDefault()
|
99
|
+
picker.toggle()
|
100
|
+
|
101
|
+
picker.find('li').bind 'click', (event) =>
|
102
|
+
selected = $(event.target).closest('li')
|
103
|
+
locale = selected.find('span.text').html()
|
104
|
+
|
105
|
+
picker.toggle()
|
106
|
+
|
107
|
+
window.content_locale = locale
|
108
|
+
|
109
|
+
url = @model.get('localized_fullpaths')[locale]
|
110
|
+
url = 'index' if url == ''
|
111
|
+
url = "/#{url}/_edit"
|
112
|
+
|
113
|
+
_window.location.href = url
|
114
|
+
|
115
|
+
select_locale: (locale) ->
|
116
|
+
_window = @options.target[0].contentWindow
|
117
|
+
link = @$('#content-locale-picker-link')
|
118
|
+
picker = $('#content-locale-picker')
|
119
|
+
|
120
|
+
# get the information about the locale
|
121
|
+
entry = picker.find("li[data-locale=#{locale}]")
|
122
|
+
image = entry.find('img').attr('src')
|
123
|
+
label = entry.find('span.text').html()
|
124
|
+
|
125
|
+
# refresh the current entry
|
126
|
+
link.find('img').attr('src', image)
|
127
|
+
link.find('span.text').html(label)
|
128
|
+
|
129
|
+
# refresh the list of locales
|
130
|
+
picker.find('li.selected').removeClass('selected')
|
131
|
+
entry.addClass('selected')
|
132
|
+
|
133
|
+
refresh: ->
|
134
|
+
@select_locale(@model.get('lang'))
|
135
|
+
|
136
|
+
@$('h1').html(@model.get('title')).removeClass()
|
137
|
+
|
138
|
+
if @$('.editing-mode input[type=checkbox]').is(':checked')
|
139
|
+
@$('.editing-mode div.switchArea').trigger('click')
|
140
|
+
|
141
|
+
@$('.element-actions').hide()
|
142
|
+
|
143
|
+
@show_editing_mode_block()
|
144
|
+
|
145
|
+
|
@@ -0,0 +1,24 @@
|
|
1
|
+
#= require ../shared/form_view
|
2
|
+
|
3
|
+
Locomotive.Views.MyAccount ||= {}
|
4
|
+
|
5
|
+
class Locomotive.Views.MyAccount.EditView extends Locomotive.Views.Shared.FormView
|
6
|
+
|
7
|
+
el: '#content'
|
8
|
+
|
9
|
+
events:
|
10
|
+
'submit': 'save'
|
11
|
+
|
12
|
+
initialize: ->
|
13
|
+
@model = new Locomotive.Models.CurrentAccount(@options.account)
|
14
|
+
|
15
|
+
Backbone.ModelBinding.bind @
|
16
|
+
|
17
|
+
render: ->
|
18
|
+
super()
|
19
|
+
|
20
|
+
save: (event) ->
|
21
|
+
if @model.get('locale') == window.locale
|
22
|
+
@save_in_ajax(event)
|
23
|
+
|
24
|
+
|
@@ -0,0 +1,162 @@
|
|
1
|
+
#= require ../shared/form_view
|
2
|
+
|
3
|
+
Locomotive.Views.Pages ||= {}
|
4
|
+
|
5
|
+
class Locomotive.Views.Pages.FormView extends Locomotive.Views.Shared.FormView
|
6
|
+
|
7
|
+
el: '#content'
|
8
|
+
|
9
|
+
events:
|
10
|
+
'change #page_parent_id': 'change_page_url'
|
11
|
+
'click a#image-picker-link': 'open_image_picker'
|
12
|
+
'click a#copy-template-link': 'replace_template'
|
13
|
+
'submit': 'save'
|
14
|
+
|
15
|
+
initialize: ->
|
16
|
+
_.bindAll(@, 'insert_image')
|
17
|
+
|
18
|
+
@model = new Locomotive.Models.Page(@options.page)
|
19
|
+
|
20
|
+
@touched_url = false
|
21
|
+
|
22
|
+
@image_picker_view = new Locomotive.Views.ThemeAssets.ImagePickerView
|
23
|
+
collection: new Locomotive.Models.ThemeAssetsCollection()
|
24
|
+
on_select: @insert_image
|
25
|
+
|
26
|
+
@image_picker_view.render()
|
27
|
+
|
28
|
+
Backbone.ModelBinding.bind @
|
29
|
+
|
30
|
+
@editable_elements_view = new Locomotive.Views.EditableElements.EditAllView(collection: @model.get('editable_elements'))
|
31
|
+
|
32
|
+
render: ->
|
33
|
+
super()
|
34
|
+
|
35
|
+
# slugify the slug field from title
|
36
|
+
@slugify_title()
|
37
|
+
|
38
|
+
# the url gets modified by different ways so reflect the changes in the UI
|
39
|
+
@listen_for_url_changes()
|
40
|
+
|
41
|
+
# enable response type to be changed (xml, json, ...etc)
|
42
|
+
@enable_response_type_select()
|
43
|
+
|
44
|
+
# enable check boxes
|
45
|
+
@enable_templatized_checkbox()
|
46
|
+
|
47
|
+
@enable_redirect_checkbox()
|
48
|
+
|
49
|
+
@enable_other_checkboxes()
|
50
|
+
|
51
|
+
# liquid code textarea
|
52
|
+
@enable_liquid_editing()
|
53
|
+
|
54
|
+
# editable elements
|
55
|
+
@render_editable_elements()
|
56
|
+
|
57
|
+
return @
|
58
|
+
|
59
|
+
open_image_picker: (event) ->
|
60
|
+
event.stopPropagation() & event.preventDefault()
|
61
|
+
@image_picker_view.editor = @editor
|
62
|
+
@image_picker_view.fetch_assets()
|
63
|
+
|
64
|
+
insert_image: (path) ->
|
65
|
+
text = "{{ '#{path}' | theme_image_url }}"
|
66
|
+
@editor.replaceSelection(text)
|
67
|
+
@image_picker_view.close()
|
68
|
+
|
69
|
+
replace_template: (event) ->
|
70
|
+
event.stopPropagation() & event.preventDefault()
|
71
|
+
|
72
|
+
link = $(event.target).closest('a')
|
73
|
+
|
74
|
+
$.rails.ajax
|
75
|
+
url: link.attr('href')
|
76
|
+
type: 'get'
|
77
|
+
dataType: 'json'
|
78
|
+
success: (data) =>
|
79
|
+
@editor.setValue(data.raw_template)
|
80
|
+
|
81
|
+
enable_liquid_editing: ->
|
82
|
+
input = @$('#page_raw_template')
|
83
|
+
|
84
|
+
if input.size() > 0
|
85
|
+
@editor = CodeMirror.fromTextArea input.get()[0],
|
86
|
+
mode: 'liquid'
|
87
|
+
autoMatchParens: false
|
88
|
+
lineNumbers: true
|
89
|
+
passDelay: 50
|
90
|
+
tabMode: 'shift'
|
91
|
+
theme: 'default'
|
92
|
+
onChange: (editor) => @model.set(raw_template: editor.getValue())
|
93
|
+
|
94
|
+
after_inputs_fold: ->
|
95
|
+
@editor.refresh()
|
96
|
+
|
97
|
+
render_editable_elements: ->
|
98
|
+
@$('.formtastic fieldset.inputs:first').before(@editable_elements_view.render().el)
|
99
|
+
@editable_elements_view.after_render()
|
100
|
+
|
101
|
+
# Remove the editable elements and rebuild them
|
102
|
+
reset_editable_elements: ->
|
103
|
+
@editable_elements_view.remove()
|
104
|
+
@editable_elements_view.collection = @model.get('editable_elements')
|
105
|
+
@render_editable_elements()
|
106
|
+
|
107
|
+
# Just re-connect the model and the views (+ redraw the file fields)
|
108
|
+
refresh_editable_elements: ->
|
109
|
+
@editable_elements_view.unbind_model()
|
110
|
+
@editable_elements_view.collection = @model.get('editable_elements')
|
111
|
+
@editable_elements_view.refresh()
|
112
|
+
|
113
|
+
slugify_title: ->
|
114
|
+
@$('#page_title').slugify(target: @$('#page_slug'))
|
115
|
+
@$('#page_slug').bind 'change', ((event) => @touched_url = true)
|
116
|
+
|
117
|
+
listen_for_url_changes: ->
|
118
|
+
setInterval (=> (@change_page_url() & @touched_url = false) if @touched_url), 2000
|
119
|
+
|
120
|
+
change_page_url: ->
|
121
|
+
$.rails.ajax
|
122
|
+
url: @$('#page_slug').attr('data-url')
|
123
|
+
type: 'get'
|
124
|
+
dataType: 'json'
|
125
|
+
data: { parent_id: @$('#page_parent_id').val(), slug: @$('#page_slug').val() }
|
126
|
+
success: (data) =>
|
127
|
+
@$('#page_slug_input .inline-hints').html(data.url).effect('highlight')
|
128
|
+
if data.templatized_parent
|
129
|
+
@$('li#page_slug_input').show()
|
130
|
+
@$('li#page_templatized_input, li#page_target_klass_name_input').hide()
|
131
|
+
else
|
132
|
+
@$('li#page_templatized_input').show() unless @model.get('redirect')
|
133
|
+
|
134
|
+
enable_response_type_select: ->
|
135
|
+
@$('li#page_response_type_input').change (event) =>
|
136
|
+
if $(event.target).val() == 'text/html'
|
137
|
+
@$('li#page_redirect_input, li#page_redirect_url_input, li#page_redirect_type_input').show()
|
138
|
+
else
|
139
|
+
@model.set redirect: false
|
140
|
+
@$('li#page_redirect_input, li#page_redirect_url_input, li#page_redirect_type_input').hide()
|
141
|
+
|
142
|
+
enable_templatized_checkbox: ->
|
143
|
+
@_enable_checkbox 'templatized',
|
144
|
+
features: ['slug', 'redirect', 'listed']
|
145
|
+
on_callback: =>
|
146
|
+
@$('li#page_target_klass_name_input').show()
|
147
|
+
off_callback: =>
|
148
|
+
@$('li#page_target_klass_name_input').hide()
|
149
|
+
|
150
|
+
@$('li#page_templatized_input').hide() if @model.get('templatized_from_parent') == true
|
151
|
+
|
152
|
+
enable_redirect_checkbox: ->
|
153
|
+
@_enable_checkbox 'redirect',
|
154
|
+
features: ['templatized', 'cache_strategy']
|
155
|
+
on_callback: =>
|
156
|
+
@$('li#page_redirect_url_input, li#page_redirect_type_input').show()
|
157
|
+
off_callback: =>
|
158
|
+
@$('li#page_redirect_url_input, li#page_redirect_type_input').hide()
|
159
|
+
|
160
|
+
enable_other_checkboxes: ->
|
161
|
+
_.each ['published', 'listed'], (exp) =>
|
162
|
+
@$('li#page_' + exp + '_input input[type=checkbox]').checkToggle()
|