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
@@ -144,42 +144,6 @@ describe Locomotive::Site do
|
|
144
144
|
expect(site.pages.map(&:fullpath).sort).to eq(%w{404 index})
|
145
145
|
end
|
146
146
|
|
147
|
-
it 'translates the index/404 pages if a new locale is added' do
|
148
|
-
site.update_attributes locales: %w(en fr)
|
149
|
-
|
150
|
-
expect(site.errors).to be_empty
|
151
|
-
|
152
|
-
::Mongoid::Fields::I18n.with_locale('fr') do
|
153
|
-
site.pages.root.first.tap do |page|
|
154
|
-
expect(page.title).to eq("Page d'accueil")
|
155
|
-
expect(page.slug).to eq('index')
|
156
|
-
end
|
157
|
-
|
158
|
-
site.pages.not_found.first.tap do |page|
|
159
|
-
expect(page.title).to eq('Page non trouvée')
|
160
|
-
expect(page.slug).to eq('404')
|
161
|
-
end
|
162
|
-
end
|
163
|
-
end
|
164
|
-
|
165
|
-
it 'translates the index/404 pages if the default locale changes' do
|
166
|
-
site.update_attributes locales: %w(fr en)
|
167
|
-
|
168
|
-
expect(site.errors).to be_empty
|
169
|
-
|
170
|
-
::Mongoid::Fields::I18n.with_locale('fr') do
|
171
|
-
site.pages.root.first.tap do |page|
|
172
|
-
expect(page.title).to eq("Page d'accueil")
|
173
|
-
expect(page.slug).to eq('index')
|
174
|
-
end
|
175
|
-
|
176
|
-
site.pages.not_found.first.tap do |page|
|
177
|
-
expect(page.title).to eq('Page non trouvée')
|
178
|
-
expect(page.slug).to eq('404')
|
179
|
-
end
|
180
|
-
end
|
181
|
-
end
|
182
|
-
|
183
147
|
it 'does not allow to remove the default locale' do
|
184
148
|
site.update_attributes locales: %w(fr)
|
185
149
|
expect(site.errors[:locales]).to eq(['The previous default locale can not be removed right away.'])
|
data/spec/requests/site_spec.rb
CHANGED
@@ -15,6 +15,34 @@ describe 'Locomotive::Middlewares::Site' do
|
|
15
15
|
|
16
16
|
end
|
17
17
|
|
18
|
+
describe 'the requested site is also the default host' do
|
19
|
+
|
20
|
+
before { site }
|
21
|
+
before { allow(middleware).to receive(:default_host).and_return('steve.me') }
|
22
|
+
|
23
|
+
context 'home page' do
|
24
|
+
|
25
|
+
let(:url) { 'http://steve.me' }
|
26
|
+
it { expect(subject.name).to eq('Locomotive site with existing models') }
|
27
|
+
|
28
|
+
end
|
29
|
+
|
30
|
+
context 'about page' do
|
31
|
+
|
32
|
+
let(:url) { 'http://steve.me/about' }
|
33
|
+
it { expect(subject.name).to eq('Locomotive site with existing models') }
|
34
|
+
|
35
|
+
end
|
36
|
+
|
37
|
+
context 'locomotive app section' do
|
38
|
+
|
39
|
+
let(:url) { 'http://steve.me/locomotive/sites' }
|
40
|
+
it { is_expected.to eq(nil) }
|
41
|
+
|
42
|
+
end
|
43
|
+
|
44
|
+
end
|
45
|
+
|
18
46
|
describe 'existing site' do
|
19
47
|
|
20
48
|
before { site }
|
@@ -0,0 +1,27 @@
|
|
1
|
+
def ensure_host_resolution(app_host)
|
2
|
+
hosts = Resolv::Hosts.new
|
3
|
+
app_host_name = URI.parse(app_host).host
|
4
|
+
begin
|
5
|
+
hosts.getaddress(app_host_name)
|
6
|
+
rescue Resolv::ResolvError
|
7
|
+
raise "Unable to resolve ip address for #{app_host_name}. Please consider adding an entry to '/etc/hosts' that associates #{app_host_name} with '127.0.0.1'."
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
Capybara.configure do |config|
|
12
|
+
config.default_selector = :css
|
13
|
+
config.server_port = 9886
|
14
|
+
config.app_host = 'http://test.example.com:9886'
|
15
|
+
|
16
|
+
ensure_host_resolution(config.app_host)
|
17
|
+
end
|
18
|
+
|
19
|
+
Capybara.default_wait_time = 5
|
20
|
+
|
21
|
+
Capybara.javascript_driver = :poltergeist
|
22
|
+
|
23
|
+
# Stop endless errors like
|
24
|
+
# ~/.rvm/gems/ruby-1.9.2-p0@global/gems/rack-1.2.1/lib/rack/utils.rb:16:
|
25
|
+
# warning: regexp match /.../n against to UTF-8 string
|
26
|
+
# more information here: https://github.com/jnicklas/capybara/issues/243
|
27
|
+
$VERBOSE = nil
|
data/spec/support/factories.rb
CHANGED
@@ -188,6 +188,15 @@ FactoryGirl.define do
|
|
188
188
|
description 'The list of my tasks'
|
189
189
|
end
|
190
190
|
|
191
|
+
factory 'message content type' do
|
192
|
+
name 'Messages'
|
193
|
+
description 'Messages posted from the contact form'
|
194
|
+
after(:build) do |content_type, _|
|
195
|
+
content_type.entries_custom_fields.build label: 'Name', name: 'name', type: 'string'
|
196
|
+
content_type.entries_custom_fields.build label: 'Message', name: 'message', type: 'text'
|
197
|
+
end
|
198
|
+
end
|
199
|
+
|
191
200
|
factory 'article content type' do
|
192
201
|
name 'Articles'
|
193
202
|
description 'The list of articles'
|
@@ -0,0 +1,21 @@
|
|
1
|
+
module Features
|
2
|
+
module SessionHelpers
|
3
|
+
|
4
|
+
def sign_up_with(name, email, password, password_confirmation = nil)
|
5
|
+
visit locomotive.sign_up_path
|
6
|
+
fill_in 'Name', with: name
|
7
|
+
fill_in 'Email', with: email
|
8
|
+
fill_in 'locomotive_account[password]', with: password
|
9
|
+
fill_in 'locomotive_account[password_confirmation]', with: password_confirmation || password
|
10
|
+
click_button 'Sign up'
|
11
|
+
end
|
12
|
+
|
13
|
+
def sign_in
|
14
|
+
account = create(:account)
|
15
|
+
visit locomotive.new_locomotive_account_session_path
|
16
|
+
fill_in 'Email', with: account.email
|
17
|
+
fill_in 'Password', with: account.password
|
18
|
+
click_button 'Sign in'
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
data/spec/support/locomotive.rb
CHANGED
data/spec/support/matchers.rb
CHANGED
@@ -1,31 +1,6 @@
|
|
1
1
|
module Locomotive
|
2
2
|
module RSpec
|
3
3
|
module Matchers
|
4
|
-
# class BeValid #:nodoc:
|
5
|
-
|
6
|
-
# def matches?(model)
|
7
|
-
# @model = model
|
8
|
-
# @model.errors.clear
|
9
|
-
# @model.errors.empty? && @model.valid?
|
10
|
-
# end
|
11
|
-
|
12
|
-
# def failure_message
|
13
|
-
# "#{@model.class} expected to be valid but had errors:\n #{@model.errors.full_messages.join("\n ")}"
|
14
|
-
# end
|
15
|
-
|
16
|
-
# def negative_failure_message
|
17
|
-
# "#{@model.class} expected to be invalid but was valid.\n"
|
18
|
-
# end
|
19
|
-
|
20
|
-
# def description
|
21
|
-
# "be valid"
|
22
|
-
# end
|
23
|
-
|
24
|
-
# end
|
25
|
-
|
26
|
-
# def be_valid
|
27
|
-
# BeValid.new
|
28
|
-
# end
|
29
4
|
|
30
5
|
class IncludeInstanceMethod #:nodoc:
|
31
6
|
|
@@ -0,0 +1 @@
|
|
1
|
+
!function(e){"undefined"!=typeof exports?e(exports):(window.hljs=e({}),"function"==typeof define&&define.amd&&define("hljs",[],function(){return window.hljs}))}(function(e){function n(e){return e.replace(/&/gm,"&").replace(/</gm,"<").replace(/>/gm,">")}function t(e){return e.nodeName.toLowerCase()}function r(e,n){var t=e&&e.exec(n);return t&&0==t.index}function a(e){return/no-?highlight|plain|text/.test(e)}function i(e){var n,t,r,i=e.className+" ";if(i+=e.parentNode?e.parentNode.className:"",t=/\blang(?:uage)?-([\w-]+)\b/.exec(i))return E(t[1])?t[1]:"no-highlight";for(i=i.split(/\s+/),n=0,r=i.length;r>n;n++)if(E(i[n])||a(i[n]))return i[n]}function o(e,n){var t,r={};for(t in e)r[t]=e[t];if(n)for(t in n)r[t]=n[t];return r}function u(e){var n=[];return function r(e,a){for(var i=e.firstChild;i;i=i.nextSibling)3==i.nodeType?a+=i.nodeValue.length:1==i.nodeType&&(n.push({event:"start",offset:a,node:i}),a=r(i,a),t(i).match(/br|hr|img|input/)||n.push({event:"stop",offset:a,node:i}));return a}(e,0),n}function c(e,r,a){function i(){return e.length&&r.length?e[0].offset!=r[0].offset?e[0].offset<r[0].offset?e:r:"start"==r[0].event?e:r:e.length?e:r}function o(e){function r(e){return" "+e.nodeName+'="'+n(e.value)+'"'}f+="<"+t(e)+Array.prototype.map.call(e.attributes,r).join("")+">"}function u(e){f+="</"+t(e)+">"}function c(e){("start"==e.event?o:u)(e.node)}for(var s=0,f="",l=[];e.length||r.length;){var g=i();if(f+=n(a.substr(s,g[0].offset-s)),s=g[0].offset,g==e){l.reverse().forEach(u);do c(g.splice(0,1)[0]),g=i();while(g==e&&g.length&&g[0].offset==s);l.reverse().forEach(o)}else"start"==g[0].event?l.push(g[0].node):l.pop(),c(g.splice(0,1)[0])}return f+n(a.substr(s))}function s(e){function n(e){return e&&e.source||e}function t(t,r){return new RegExp(n(t),"m"+(e.cI?"i":"")+(r?"g":""))}function r(a,i){if(!a.compiled){if(a.compiled=!0,a.k=a.k||a.bK,a.k){var u={},c=function(n,t){e.cI&&(t=t.toLowerCase()),t.split(" ").forEach(function(e){var t=e.split("|");u[t[0]]=[n,t[1]?Number(t[1]):1]})};"string"==typeof a.k?c("keyword",a.k):Object.keys(a.k).forEach(function(e){c(e,a.k[e])}),a.k=u}a.lR=t(a.l||/\b\w+\b/,!0),i&&(a.bK&&(a.b="\\b("+a.bK.split(" ").join("|")+")\\b"),a.b||(a.b=/\B|\b/),a.bR=t(a.b),a.e||a.eW||(a.e=/\B|\b/),a.e&&(a.eR=t(a.e)),a.tE=n(a.e)||"",a.eW&&i.tE&&(a.tE+=(a.e?"|":"")+i.tE)),a.i&&(a.iR=t(a.i)),void 0===a.r&&(a.r=1),a.c||(a.c=[]);var s=[];a.c.forEach(function(e){e.v?e.v.forEach(function(n){s.push(o(e,n))}):s.push("self"==e?a:e)}),a.c=s,a.c.forEach(function(e){r(e,a)}),a.starts&&r(a.starts,i);var f=a.c.map(function(e){return e.bK?"\\.?("+e.b+")\\.?":e.b}).concat([a.tE,a.i]).map(n).filter(Boolean);a.t=f.length?t(f.join("|"),!0):{exec:function(){return null}}}}r(e)}function f(e,t,a,i){function o(e,n){for(var t=0;t<n.c.length;t++)if(r(n.c[t].bR,e))return n.c[t]}function u(e,n){if(r(e.eR,n)){for(;e.endsParent&&e.parent;)e=e.parent;return e}return e.eW?u(e.parent,n):void 0}function c(e,n){return!a&&r(n.iR,e)}function g(e,n){var t=N.cI?n[0].toLowerCase():n[0];return e.k.hasOwnProperty(t)&&e.k[t]}function h(e,n,t,r){var a=r?"":w.classPrefix,i='<span class="'+a,o=t?"":"</span>";return i+=e+'">',i+n+o}function p(){if(!L.k)return n(B);var e="",t=0;L.lR.lastIndex=0;for(var r=L.lR.exec(B);r;){e+=n(B.substr(t,r.index-t));var a=g(L,r);a?(y+=a[1],e+=h(a[0],n(r[0]))):e+=n(r[0]),t=L.lR.lastIndex,r=L.lR.exec(B)}return e+n(B.substr(t))}function d(){if(L.sL&&!x[L.sL])return n(B);var e=L.sL?f(L.sL,B,!0,M[L.sL]):l(B);return L.r>0&&(y+=e.r),"continuous"==L.subLanguageMode&&(M[L.sL]=e.top),h(e.language,e.value,!1,!0)}function b(){return void 0!==L.sL?d():p()}function v(e,t){var r=e.cN?h(e.cN,"",!0):"";e.rB?(k+=r,B=""):e.eB?(k+=n(t)+r,B=""):(k+=r,B=t),L=Object.create(e,{parent:{value:L}})}function m(e,t){if(B+=e,void 0===t)return k+=b(),0;var r=o(t,L);if(r)return k+=b(),v(r,t),r.rB?0:t.length;var a=u(L,t);if(a){var i=L;i.rE||i.eE||(B+=t),k+=b();do L.cN&&(k+="</span>"),y+=L.r,L=L.parent;while(L!=a.parent);return i.eE&&(k+=n(t)),B="",a.starts&&v(a.starts,""),i.rE?0:t.length}if(c(t,L))throw new Error('Illegal lexeme "'+t+'" for mode "'+(L.cN||"<unnamed>")+'"');return B+=t,t.length||1}var N=E(e);if(!N)throw new Error('Unknown language: "'+e+'"');s(N);var R,L=i||N,M={},k="";for(R=L;R!=N;R=R.parent)R.cN&&(k=h(R.cN,"",!0)+k);var B="",y=0;try{for(var C,j,I=0;;){if(L.t.lastIndex=I,C=L.t.exec(t),!C)break;j=m(t.substr(I,C.index-I),C[0]),I=C.index+j}for(m(t.substr(I)),R=L;R.parent;R=R.parent)R.cN&&(k+="</span>");return{r:y,value:k,language:e,top:L}}catch(O){if(-1!=O.message.indexOf("Illegal"))return{r:0,value:n(t)};throw O}}function l(e,t){t=t||w.languages||Object.keys(x);var r={r:0,value:n(e)},a=r;return t.forEach(function(n){if(E(n)){var t=f(n,e,!1);t.language=n,t.r>a.r&&(a=t),t.r>r.r&&(a=r,r=t)}}),a.language&&(r.second_best=a),r}function g(e){return w.tabReplace&&(e=e.replace(/^((<[^>]+>|\t)+)/gm,function(e,n){return n.replace(/\t/g,w.tabReplace)})),w.useBR&&(e=e.replace(/\n/g,"<br>")),e}function h(e,n,t){var r=n?R[n]:t,a=[e.trim()];return e.match(/\bhljs\b/)||a.push("hljs"),-1===e.indexOf(r)&&a.push(r),a.join(" ").trim()}function p(e){var n=i(e);if(!a(n)){var t;w.useBR?(t=document.createElementNS("http://www.w3.org/1999/xhtml","div"),t.innerHTML=e.innerHTML.replace(/\n/g,"").replace(/<br[ \/]*>/g,"\n")):t=e;var r=t.textContent,o=n?f(n,r,!0):l(r),s=u(t);if(s.length){var p=document.createElementNS("http://www.w3.org/1999/xhtml","div");p.innerHTML=o.value,o.value=c(s,u(p),r)}o.value=g(o.value),e.innerHTML=o.value,e.className=h(e.className,n,o.language),e.result={language:o.language,re:o.r},o.second_best&&(e.second_best={language:o.second_best.language,re:o.second_best.r})}}function d(e){w=o(w,e)}function b(){if(!b.called){b.called=!0;var e=document.querySelectorAll("pre code");Array.prototype.forEach.call(e,p)}}function v(){addEventListener("DOMContentLoaded",b,!1),addEventListener("load",b,!1)}function m(n,t){var r=x[n]=t(e);r.aliases&&r.aliases.forEach(function(e){R[e]=n})}function N(){return Object.keys(x)}function E(e){return x[e]||x[R[e]]}var w={classPrefix:"hljs-",tabReplace:null,useBR:!1,languages:void 0},x={},R={};return e.highlight=f,e.highlightAuto=l,e.fixMarkup=g,e.highlightBlock=p,e.configure=d,e.initHighlighting=b,e.initHighlightingOnLoad=v,e.registerLanguage=m,e.listLanguages=N,e.getLanguage=E,e.inherit=o,e.IR="[a-zA-Z]\\w*",e.UIR="[a-zA-Z_]\\w*",e.NR="\\b\\d+(\\.\\d+)?",e.CNR="\\b(0[xX][a-fA-F0-9]+|(\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",e.BNR="\\b(0b[01]+)",e.RSR="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",e.BE={b:"\\\\[\\s\\S]",r:0},e.ASM={cN:"string",b:"'",e:"'",i:"\\n",c:[e.BE]},e.QSM={cN:"string",b:'"',e:'"',i:"\\n",c:[e.BE]},e.PWM={b:/\b(a|an|the|are|I|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such)\b/},e.C=function(n,t,r){var a=e.inherit({cN:"comment",b:n,e:t,c:[]},r||{});return a.c.push(e.PWM),a.c.push({cN:"doctag",bK:"TODO FIXME NOTE BUG XXX",r:0}),a},e.CLCM=e.C("//","$"),e.CBCM=e.C("/\\*","\\*/"),e.HCM=e.C("#","$"),e.NM={cN:"number",b:e.NR,r:0},e.CNM={cN:"number",b:e.CNR,r:0},e.BNM={cN:"number",b:e.BNR,r:0},e.CSSNM={cN:"number",b:e.NR+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",r:0},e.RM={cN:"regexp",b:/\//,e:/\/[gimuy]*/,i:/\n/,c:[e.BE,{b:/\[/,e:/\]/,r:0,c:[e.BE]}]},e.TM={cN:"title",b:e.IR,r:0},e.UTM={cN:"title",b:e.UIR,r:0},e});hljs.registerLanguage("ruby",function(e){var c="[a-zA-Z_]\\w*[!?=]?|[-+~]\\@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?",r="and false then defined module in return redo if BEGIN retry end for true self when next until do begin unless END rescue nil else break undef not super class case require yield alias while ensure elsif or include attr_reader attr_writer attr_accessor",b={cN:"doctag",b:"@[A-Za-z]+"},a={cN:"value",b:"#<",e:">"},n=[e.C("#","$",{c:[b]}),e.C("^\\=begin","^\\=end",{c:[b],r:10}),e.C("^__END__","\\n$")],s={cN:"subst",b:"#\\{",e:"}",k:r},t={cN:"string",c:[e.BE,s],v:[{b:/'/,e:/'/},{b:/"/,e:/"/},{b:/`/,e:/`/},{b:"%[qQwWx]?\\(",e:"\\)"},{b:"%[qQwWx]?\\[",e:"\\]"},{b:"%[qQwWx]?{",e:"}"},{b:"%[qQwWx]?<",e:">"},{b:"%[qQwWx]?/",e:"/"},{b:"%[qQwWx]?%",e:"%"},{b:"%[qQwWx]?-",e:"-"},{b:"%[qQwWx]?\\|",e:"\\|"},{b:/\B\?(\\\d{1,3}|\\x[A-Fa-f0-9]{1,2}|\\u[A-Fa-f0-9]{4}|\\?\S)\b/}]},i={cN:"params",b:"\\(",e:"\\)",k:r},d=[t,a,{cN:"class",bK:"class module",e:"$|;",i:/=/,c:[e.inherit(e.TM,{b:"[A-Za-z_]\\w*(::\\w+)*(\\?|\\!)?"}),{cN:"inheritance",b:"<\\s*",c:[{cN:"parent",b:"("+e.IR+"::)?"+e.IR}]}].concat(n)},{cN:"function",bK:"def",e:" |$|;",r:0,c:[e.inherit(e.TM,{b:c}),i].concat(n)},{cN:"constant",b:"(::)?(\\b[A-Z]\\w*(::)?)+",r:0},{cN:"symbol",b:e.UIR+"(\\!|\\?)?:",r:0},{cN:"symbol",b:":",c:[t,{b:c}],r:0},{cN:"number",b:"(\\b0[0-7_]+)|(\\b0x[0-9a-fA-F_]+)|(\\b[1-9][0-9_]*(\\.[0-9_]+)?)|[0_]\\b",r:0},{cN:"variable",b:"(\\$\\W)|((\\$|\\@\\@?)(\\w+))"},{b:"("+e.RSR+")\\s*",c:[a,{cN:"regexp",c:[e.BE,s],i:/\n/,v:[{b:"/",e:"/[a-z]*"},{b:"%r{",e:"}[a-z]*"},{b:"%r\\(",e:"\\)[a-z]*"},{b:"%r!",e:"![a-z]*"},{b:"%r\\[",e:"\\][a-z]*"}]}].concat(n),r:0}].concat(n);s.c=d,i.c=d;var o="[>?]>",l="[\\w#]+\\(\\w+\\):\\d+:\\d+>",u="(\\w+-)?\\d+\\.\\d+\\.\\d(p\\d+)?[^>]+>",N=[{b:/^\s*=>/,cN:"status",starts:{e:"$",c:d}},{cN:"prompt",b:"^("+o+"|"+l+"|"+u+")",starts:{e:"$",c:d}}];return{aliases:["rb","gemspec","podspec","thor","irb"],k:r,c:n.concat(N).concat(d)}});hljs.registerLanguage("bash",function(e){var t={cN:"variable",v:[{b:/\$[\w\d#@][\w\d_]*/},{b:/\$\{(.*?)}/}]},s={cN:"string",b:/"/,e:/"/,c:[e.BE,t,{cN:"variable",b:/\$\(/,e:/\)/,c:[e.BE]}]},a={cN:"string",b:/'/,e:/'/};return{aliases:["sh","zsh"],l:/-?[a-z\.]+/,k:{keyword:"if then else elif fi for while in do done case esac function",literal:"true false",built_in:"break cd continue eval exec exit export getopts hash pwd readonly return shift test times trap umask unset alias bind builtin caller command declare echo enable help let local logout mapfile printf read readarray source type typeset ulimit unalias set shopt autoload bg bindkey bye cap chdir clone comparguments compcall compctl compdescribe compfiles compgroups compquote comptags comptry compvalues dirs disable disown echotc echoti emulate fc fg float functions getcap getln history integer jobs kill limit log noglob popd print pushd pushln rehash sched setcap setopt stat suspend ttyctl unfunction unhash unlimit unsetopt vared wait whence where which zcompile zformat zftp zle zmodload zparseopts zprof zpty zregexparse zsocket zstyle ztcp",operator:"-ne -eq -lt -gt -f -d -e -s -l -a"},c:[{cN:"shebang",b:/^#![^\n]+sh\s*$/,r:10},{cN:"function",b:/\w[\w\d_]*\s*\(\s*\)\s*\{/,rB:!0,c:[e.inherit(e.TM,{b:/\w[\w\d_]*/})],r:0},e.HCM,e.NM,s,a,t]}});
|
@@ -0,0 +1,155 @@
|
|
1
|
+
/*
|
2
|
+
|
3
|
+
Original style from softwaremaniacs.org (c) Ivan Sagalaev <Maniac@SoftwareManiacs.Org>
|
4
|
+
|
5
|
+
*/
|
6
|
+
|
7
|
+
.hljs {
|
8
|
+
display: block;
|
9
|
+
overflow-x: auto;
|
10
|
+
padding: 0.5em;
|
11
|
+
background: #f0f0f0;
|
12
|
+
-webkit-text-size-adjust: none;
|
13
|
+
}
|
14
|
+
|
15
|
+
.hljs,
|
16
|
+
.hljs-subst,
|
17
|
+
.hljs-tag .hljs-title,
|
18
|
+
.nginx .hljs-title {
|
19
|
+
color: black;
|
20
|
+
}
|
21
|
+
|
22
|
+
.hljs-string,
|
23
|
+
.hljs-title,
|
24
|
+
.hljs-constant,
|
25
|
+
.hljs-parent,
|
26
|
+
.hljs-tag .hljs-value,
|
27
|
+
.hljs-rule .hljs-value,
|
28
|
+
.hljs-preprocessor,
|
29
|
+
.hljs-pragma,
|
30
|
+
.hljs-name,
|
31
|
+
.haml .hljs-symbol,
|
32
|
+
.ruby .hljs-symbol,
|
33
|
+
.ruby .hljs-symbol .hljs-string,
|
34
|
+
.hljs-template_tag,
|
35
|
+
.django .hljs-variable,
|
36
|
+
.smalltalk .hljs-class,
|
37
|
+
.hljs-addition,
|
38
|
+
.hljs-flow,
|
39
|
+
.hljs-stream,
|
40
|
+
.bash .hljs-variable,
|
41
|
+
.pf .hljs-variable,
|
42
|
+
.apache .hljs-tag,
|
43
|
+
.apache .hljs-cbracket,
|
44
|
+
.tex .hljs-command,
|
45
|
+
.tex .hljs-special,
|
46
|
+
.erlang_repl .hljs-function_or_atom,
|
47
|
+
.asciidoc .hljs-header,
|
48
|
+
.markdown .hljs-header,
|
49
|
+
.coffeescript .hljs-attribute,
|
50
|
+
.tp .hljs-variable {
|
51
|
+
color: #800;
|
52
|
+
}
|
53
|
+
|
54
|
+
.smartquote,
|
55
|
+
.hljs-comment,
|
56
|
+
.hljs-annotation,
|
57
|
+
.diff .hljs-header,
|
58
|
+
.hljs-chunk,
|
59
|
+
.asciidoc .hljs-blockquote,
|
60
|
+
.markdown .hljs-blockquote {
|
61
|
+
color: #888;
|
62
|
+
}
|
63
|
+
|
64
|
+
.hljs-number,
|
65
|
+
.hljs-date,
|
66
|
+
.hljs-regexp,
|
67
|
+
.hljs-literal,
|
68
|
+
.hljs-hexcolor,
|
69
|
+
.smalltalk .hljs-symbol,
|
70
|
+
.smalltalk .hljs-char,
|
71
|
+
.go .hljs-constant,
|
72
|
+
.hljs-change,
|
73
|
+
.lasso .hljs-variable,
|
74
|
+
.makefile .hljs-variable,
|
75
|
+
.asciidoc .hljs-bullet,
|
76
|
+
.markdown .hljs-bullet,
|
77
|
+
.asciidoc .hljs-link_url,
|
78
|
+
.markdown .hljs-link_url {
|
79
|
+
color: #080;
|
80
|
+
}
|
81
|
+
|
82
|
+
.hljs-label,
|
83
|
+
.ruby .hljs-string,
|
84
|
+
.hljs-decorator,
|
85
|
+
.hljs-filter .hljs-argument,
|
86
|
+
.hljs-localvars,
|
87
|
+
.hljs-array,
|
88
|
+
.hljs-attr_selector,
|
89
|
+
.hljs-important,
|
90
|
+
.hljs-pseudo,
|
91
|
+
.hljs-pi,
|
92
|
+
.haml .hljs-bullet,
|
93
|
+
.hljs-doctype,
|
94
|
+
.hljs-deletion,
|
95
|
+
.hljs-envvar,
|
96
|
+
.hljs-shebang,
|
97
|
+
.apache .hljs-sqbracket,
|
98
|
+
.nginx .hljs-built_in,
|
99
|
+
.tex .hljs-formula,
|
100
|
+
.erlang_repl .hljs-reserved,
|
101
|
+
.hljs-prompt,
|
102
|
+
.asciidoc .hljs-link_label,
|
103
|
+
.markdown .hljs-link_label,
|
104
|
+
.vhdl .hljs-attribute,
|
105
|
+
.clojure .hljs-attribute,
|
106
|
+
.asciidoc .hljs-attribute,
|
107
|
+
.lasso .hljs-attribute,
|
108
|
+
.coffeescript .hljs-property,
|
109
|
+
.hljs-phony {
|
110
|
+
color: #88f;
|
111
|
+
}
|
112
|
+
|
113
|
+
.hljs-keyword,
|
114
|
+
.hljs-id,
|
115
|
+
.hljs-title,
|
116
|
+
.hljs-built_in,
|
117
|
+
.css .hljs-tag,
|
118
|
+
.hljs-doctag,
|
119
|
+
.smalltalk .hljs-class,
|
120
|
+
.hljs-winutils,
|
121
|
+
.bash .hljs-variable,
|
122
|
+
.pf .hljs-variable,
|
123
|
+
.apache .hljs-tag,
|
124
|
+
.hljs-type,
|
125
|
+
.hljs-typename,
|
126
|
+
.tex .hljs-command,
|
127
|
+
.asciidoc .hljs-strong,
|
128
|
+
.markdown .hljs-strong,
|
129
|
+
.hljs-request,
|
130
|
+
.hljs-status,
|
131
|
+
.tp .hljs-data,
|
132
|
+
.tp .hljs-io {
|
133
|
+
font-weight: bold;
|
134
|
+
}
|
135
|
+
|
136
|
+
.asciidoc .hljs-emphasis,
|
137
|
+
.markdown .hljs-emphasis,
|
138
|
+
.tp .hljs-units {
|
139
|
+
font-style: italic;
|
140
|
+
}
|
141
|
+
|
142
|
+
.nginx .hljs-built_in {
|
143
|
+
font-weight: normal;
|
144
|
+
}
|
145
|
+
|
146
|
+
.coffeescript .javascript,
|
147
|
+
.javascript .xml,
|
148
|
+
.lasso .markup,
|
149
|
+
.tex .hljs-formula,
|
150
|
+
.xml .javascript,
|
151
|
+
.xml .vbscript,
|
152
|
+
.xml .css,
|
153
|
+
.xml .hljs-cdata {
|
154
|
+
opacity: 0.5;
|
155
|
+
}
|
@@ -0,0 +1,123 @@
|
|
1
|
+
/*
|
2
|
+
|
3
|
+
github.com style (c) Vasily Polovnyov <vast@whiteants.net>
|
4
|
+
|
5
|
+
*/
|
6
|
+
|
7
|
+
.hljs {
|
8
|
+
display: block;
|
9
|
+
overflow-x: auto;
|
10
|
+
padding: 0.5em;
|
11
|
+
color: #333;
|
12
|
+
background: #f8f8f8;
|
13
|
+
-webkit-text-size-adjust: none;
|
14
|
+
}
|
15
|
+
|
16
|
+
.hljs-comment,
|
17
|
+
.diff .hljs-header {
|
18
|
+
color: #998;
|
19
|
+
font-style: italic;
|
20
|
+
}
|
21
|
+
|
22
|
+
.hljs-keyword,
|
23
|
+
.css .rule .hljs-keyword,
|
24
|
+
.hljs-winutils,
|
25
|
+
.nginx .hljs-title,
|
26
|
+
.hljs-subst,
|
27
|
+
.hljs-request,
|
28
|
+
.hljs-status {
|
29
|
+
color: #333;
|
30
|
+
font-weight: bold;
|
31
|
+
}
|
32
|
+
|
33
|
+
.hljs-number,
|
34
|
+
.hljs-hexcolor,
|
35
|
+
.ruby .hljs-constant {
|
36
|
+
color: #008080;
|
37
|
+
}
|
38
|
+
|
39
|
+
.hljs-string,
|
40
|
+
.hljs-tag .hljs-value,
|
41
|
+
.hljs-doctag,
|
42
|
+
.tex .hljs-formula {
|
43
|
+
color: #d14;
|
44
|
+
}
|
45
|
+
|
46
|
+
.hljs-title,
|
47
|
+
.hljs-id,
|
48
|
+
.scss .hljs-preprocessor {
|
49
|
+
color: #900;
|
50
|
+
font-weight: bold;
|
51
|
+
}
|
52
|
+
|
53
|
+
.hljs-list .hljs-keyword,
|
54
|
+
.hljs-subst {
|
55
|
+
font-weight: normal;
|
56
|
+
}
|
57
|
+
|
58
|
+
.hljs-class .hljs-title,
|
59
|
+
.hljs-type,
|
60
|
+
.vhdl .hljs-literal,
|
61
|
+
.tex .hljs-command {
|
62
|
+
color: #458;
|
63
|
+
font-weight: bold;
|
64
|
+
}
|
65
|
+
|
66
|
+
.hljs-tag,
|
67
|
+
.hljs-tag .hljs-title,
|
68
|
+
.hljs-rule .hljs-property,
|
69
|
+
.django .hljs-tag .hljs-keyword {
|
70
|
+
color: #000080;
|
71
|
+
font-weight: normal;
|
72
|
+
}
|
73
|
+
|
74
|
+
.hljs-attribute,
|
75
|
+
.hljs-variable,
|
76
|
+
.lisp .hljs-body,
|
77
|
+
.hljs-name {
|
78
|
+
color: #008080;
|
79
|
+
}
|
80
|
+
|
81
|
+
.hljs-regexp {
|
82
|
+
color: #009926;
|
83
|
+
}
|
84
|
+
|
85
|
+
.hljs-symbol,
|
86
|
+
.ruby .hljs-symbol .hljs-string,
|
87
|
+
.lisp .hljs-keyword,
|
88
|
+
.clojure .hljs-keyword,
|
89
|
+
.scheme .hljs-keyword,
|
90
|
+
.tex .hljs-special,
|
91
|
+
.hljs-prompt {
|
92
|
+
color: #990073;
|
93
|
+
}
|
94
|
+
|
95
|
+
.hljs-built_in {
|
96
|
+
color: #0086b3;
|
97
|
+
}
|
98
|
+
|
99
|
+
.hljs-preprocessor,
|
100
|
+
.hljs-pragma,
|
101
|
+
.hljs-pi,
|
102
|
+
.hljs-doctype,
|
103
|
+
.hljs-shebang,
|
104
|
+
.hljs-cdata {
|
105
|
+
color: #999;
|
106
|
+
font-weight: bold;
|
107
|
+
}
|
108
|
+
|
109
|
+
.hljs-deletion {
|
110
|
+
background: #fdd;
|
111
|
+
}
|
112
|
+
|
113
|
+
.hljs-addition {
|
114
|
+
background: #dfd;
|
115
|
+
}
|
116
|
+
|
117
|
+
.diff .hljs-change {
|
118
|
+
background: #0086b3;
|
119
|
+
}
|
120
|
+
|
121
|
+
.hljs-chunk {
|
122
|
+
color: #aaa;
|
123
|
+
}
|