forest_cms 0.98.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/MIT-LICENSE +20 -0
- data/README.md +204 -0
- data/Rakefile +37 -0
- data/app/assets/config/forest_manifest.js +2 -0
- data/app/assets/fonts/FontAwesome.otf +0 -0
- data/app/assets/fonts/fontawesome-webfont.eot +0 -0
- data/app/assets/fonts/fontawesome-webfont.svg +2671 -0
- data/app/assets/fonts/fontawesome-webfont.ttf +0 -0
- data/app/assets/fonts/fontawesome-webfont.woff +0 -0
- data/app/assets/fonts/fontawesome-webfont.woff2 +0 -0
- data/app/assets/images/forest/favicons/android-chrome-192x192.png +0 -0
- data/app/assets/images/forest/favicons/android-chrome-512x512.png +0 -0
- data/app/assets/images/forest/favicons/apple-touch-icon.png +0 -0
- data/app/assets/images/forest/favicons/browserconfig.xml +9 -0
- data/app/assets/images/forest/favicons/favicon-16x16.png +0 -0
- data/app/assets/images/forest/favicons/favicon-32x32.png +0 -0
- data/app/assets/images/forest/favicons/favicon.ico +0 -0
- data/app/assets/images/forest/favicons/manifest.json.erb +18 -0
- data/app/assets/images/forest/favicons/mstile-150x150.png +0 -0
- data/app/assets/images/forest/favicons/safari-pinned-tab.svg +21 -0
- data/app/assets/images/forest/forest-low.jpg +0 -0
- data/app/assets/images/forest/forest.jpg +0 -0
- data/app/assets/javascripts/forest/admin/lib/jquery_plugins.js +32 -0
- data/app/assets/javascripts/forest/admin/main.js +59 -0
- data/app/assets/javascripts/forest/admin/partials/add_block.js +22 -0
- data/app/assets/javascripts/forest/admin/partials/block_collapser.js +49 -0
- data/app/assets/javascripts/forest/admin/partials/block_errors.js +11 -0
- data/app/assets/javascripts/forest/admin/partials/block_selector_inputs.js +61 -0
- data/app/assets/javascripts/forest/admin/partials/cocoon_events.js +3 -0
- data/app/assets/javascripts/forest/admin/partials/cocoon_sortable_field_sets.js +55 -0
- data/app/assets/javascripts/forest/admin/partials/collage_inputs.js +286 -0
- data/app/assets/javascripts/forest/admin/partials/color_inputs.js +24 -0
- data/app/assets/javascripts/forest/admin/partials/datepicker_init.js +70 -0
- data/app/assets/javascripts/forest/admin/partials/documentation_sidebar_affix.js +22 -0
- data/app/assets/javascripts/forest/admin/partials/dropdown_block_selector.js +106 -0
- data/app/assets/javascripts/forest/admin/partials/edit_header.js +22 -0
- data/app/assets/javascripts/forest/admin/partials/file_upload_init.js +111 -0
- data/app/assets/javascripts/forest/admin/partials/forest_tables.js +42 -0
- data/app/assets/javascripts/forest/admin/partials/infinite_loader.js +89 -0
- data/app/assets/javascripts/forest/admin/partials/markdown_text_editor_init.js +89 -0
- data/app/assets/javascripts/forest/admin/partials/media_item_chooser_modal.js.erb +259 -0
- data/app/assets/javascripts/forest/admin/partials/menus.js +79 -0
- data/app/assets/javascripts/forest/admin/partials/multi_checkbox_selector.js +27 -0
- data/app/assets/javascripts/forest/admin/partials/persisted_value_warnings.js +38 -0
- data/app/assets/javascripts/forest/admin/partials/repeater_inputs.js +24 -0
- data/app/assets/javascripts/forest/admin/partials/select2_init.js +165 -0
- data/app/assets/javascripts/forest/admin/partials/select_tag_form_submitter.js +40 -0
- data/app/assets/javascripts/forest/admin/partials/sortable_gallery.js +45 -0
- data/app/assets/javascripts/forest/admin/partials/sortable_page_block_position_setter.js +37 -0
- data/app/assets/javascripts/forest/admin/partials/status_scheduler.js +16 -0
- data/app/assets/javascripts/forest/admin/partials/tab_templates.js +93 -0
- data/app/assets/javascripts/forest/admin/partials/tables.js +7 -0
- data/app/assets/javascripts/forest/admin/partials/tooltips.js +7 -0
- data/app/assets/javascripts/forest/admin/partials/turboform_form_submitter.js +15 -0
- data/app/assets/javascripts/forest/admin/vendor/imagesloaded.pkgd.min.js +7 -0
- data/app/assets/javascripts/forest/admin/vendor/jquery-ui-timepicker-addon.js +2291 -0
- data/app/assets/javascripts/forest/admin/vendor/jquery.ba-throttle-debounce.min.js +9 -0
- data/app/assets/javascripts/forest/admin/vendor/jquery.nestable.js +756 -0
- data/app/assets/javascripts/forest/admin/vendor/select2.full.min.js +3 -0
- data/app/assets/javascripts/forest/admin/vendor/simplemde.min.js +15 -0
- data/app/assets/javascripts/forest/application_admin.js +29 -0
- data/app/assets/javascripts/forest/application_admin_from_host_app.js +1 -0
- data/app/assets/javascripts/forest/application_public.js +19 -0
- data/app/assets/javascripts/forest/cable.js +13 -0
- data/app/assets/javascripts/forest/lib/jquery-3.3.1.min.js +2 -0
- data/app/assets/javascripts/forest/main.js +59 -0
- data/app/assets/javascripts/forest/public/partials/analytics.js +16 -0
- data/app/assets/stylesheets/forest/admin/_bootstrap-variables.scss +877 -0
- data/app/assets/stylesheets/forest/admin/_variables.scss +13 -0
- data/app/assets/stylesheets/forest/admin/base/_foundation.scss +17 -0
- data/app/assets/stylesheets/forest/admin/mixins/_breakpoints.scss +26 -0
- data/app/assets/stylesheets/forest/admin/mixins/_glyphicons.scss +278 -0
- data/app/assets/stylesheets/forest/admin/mixins/_layout.scss +13 -0
- data/app/assets/stylesheets/forest/admin/mixins/_links.scss +10 -0
- data/app/assets/stylesheets/forest/admin/mixins/_lists.scss +10 -0
- data/app/assets/stylesheets/forest/admin/mixins/_mixins.scss +6 -0
- data/app/assets/stylesheets/forest/admin/mixins/_triangles.scss +21 -0
- data/app/assets/stylesheets/forest/admin/partials/_admin.scss +57 -0
- data/app/assets/stylesheets/forest/admin/partials/_affix.scss +5 -0
- data/app/assets/stylesheets/forest/admin/partials/_block_errors.scss +15 -0
- data/app/assets/stylesheets/forest/admin/partials/_block_layout.scss +48 -0
- data/app/assets/stylesheets/forest/admin/partials/_block_type_edit_ui.scss +15 -0
- data/app/assets/stylesheets/forest/admin/partials/_bootstrap_customizations.scss +12 -0
- data/app/assets/stylesheets/forest/admin/partials/_collage_inputs.scss +122 -0
- data/app/assets/stylesheets/forest/admin/partials/_documentation.scss +7 -0
- data/app/assets/stylesheets/forest/admin/partials/_dropdown_block_selector.scss +19 -0
- data/app/assets/stylesheets/forest/admin/partials/_edit_header.scss +16 -0
- data/app/assets/stylesheets/forest/admin/partials/_file_upload.scss +3 -0
- data/app/assets/stylesheets/forest/admin/partials/_forest_tables.scss +20 -0
- data/app/assets/stylesheets/forest/admin/partials/_forms_and_inputs.scss +72 -0
- data/app/assets/stylesheets/forest/admin/partials/_helper_classes.scss +24 -0
- data/app/assets/stylesheets/forest/admin/partials/_infinite_loader.scss +8 -0
- data/app/assets/stylesheets/forest/admin/partials/_markdown_editor.scss +12 -0
- data/app/assets/stylesheets/forest/admin/partials/_media_item_chooser.scss +168 -0
- data/app/assets/stylesheets/forest/admin/partials/_media_library.scss +109 -0
- data/app/assets/stylesheets/forest/admin/partials/_pages.scss +6 -0
- data/app/assets/stylesheets/forest/admin/partials/_pagination.scss +5 -0
- data/app/assets/stylesheets/forest/admin/partials/_repeater_inputs.scss +57 -0
- data/app/assets/stylesheets/forest/admin/partials/_resizable_ui.scss +1 -0
- data/app/assets/stylesheets/forest/admin/partials/_select2_custom.scss +20 -0
- data/app/assets/stylesheets/forest/admin/partials/_sessions.scss +13 -0
- data/app/assets/stylesheets/forest/admin/partials/_slug_attributes.scss +9 -0
- data/app/assets/stylesheets/forest/admin/partials/_sortable_field_sets.scss +22 -0
- data/app/assets/stylesheets/forest/admin/partials/_sortable_select2.scss +18 -0
- data/app/assets/stylesheets/forest/admin/partials/_sortable_ui.scss +15 -0
- data/app/assets/stylesheets/forest/admin/partials/_status_indicators.scss +33 -0
- data/app/assets/stylesheets/forest/admin/partials/_status_scheduler.scss +9 -0
- data/app/assets/stylesheets/forest/admin/partials/_tooltips.scss +5 -0
- data/app/assets/stylesheets/forest/admin/partials/_turbolinks.scss +5 -0
- data/app/assets/stylesheets/forest/admin/partials/_typography.scss +19 -0
- data/app/assets/stylesheets/forest/admin/partials/_ui.scss +32 -0
- data/app/assets/stylesheets/forest/admin/sprockets/font-awesome.scss +2337 -0
- data/app/assets/stylesheets/forest/admin/sprockets/main_bootstrap.scss +3 -0
- data/app/assets/stylesheets/forest/admin/vendor/_jquery-ui-timepicker-addon.scss +30 -0
- data/app/assets/stylesheets/forest/admin/vendor/_nestable.scss +347 -0
- data/app/assets/stylesheets/forest/admin/vendor/_select2_1_core.scss +484 -0
- data/app/assets/stylesheets/forest/admin/vendor/_select2_2_bootstrap.scss +612 -0
- data/app/assets/stylesheets/forest/admin/vendor/_simplemde.min.scss +7 -0
- data/app/assets/stylesheets/forest/admin_overrides.scss +1 -0
- data/app/assets/stylesheets/forest/application_admin.css +23 -0
- data/app/assets/stylesheets/forest/application_public.css +16 -0
- data/app/assets/stylesheets/forest/main_admin.scss +16 -0
- data/app/assets/stylesheets/forest/main_public.scss +4 -0
- data/app/assets/stylesheets/forest/public/base/_admin_error_messages.scss +15 -0
- data/app/assets/stylesheets/forest/public/base/_foundation.scss +24 -0
- data/app/assets/stylesheets/forest/public/base/_images.scss +14 -0
- data/app/assets/stylesheets/forest/scaffolds.scss +87 -0
- data/app/assets/stylesheets/jquery.fileupload.scss +37 -0
- data/app/classes/forest/block_set.rb +26 -0
- data/app/classes/forest/error.rb +15 -0
- data/app/classes/forest/markdown_renderer.rb +31 -0
- data/app/classes/search_index_manager.rb +83 -0
- data/app/controllers/admin/block_kinds_controller.rb +31 -0
- data/app/controllers/admin/block_layouts_controller.rb +47 -0
- data/app/controllers/admin/cache_purge_controller.rb +11 -0
- data/app/controllers/admin/dashboard_controller.rb +6 -0
- data/app/controllers/admin/documentation_controller.rb +5 -0
- data/app/controllers/admin/errors_controller.rb +9 -0
- data/app/controllers/admin/forest_controller.rb +96 -0
- data/app/controllers/admin/imports_controller.rb +34 -0
- data/app/controllers/admin/media_items_controller.rb +107 -0
- data/app/controllers/admin/menus_controller.rb +69 -0
- data/app/controllers/admin/pages_controller.rb +105 -0
- data/app/controllers/admin/settings_controller.rb +66 -0
- data/app/controllers/admin/translations_controller.rb +58 -0
- data/app/controllers/admin/user_groups_controller.rb +69 -0
- data/app/controllers/admin/users_controller.rb +88 -0
- data/app/controllers/application_controller.rb +2 -0
- data/app/controllers/errors_controller.rb +26 -0
- data/app/controllers/forest_controller.rb +39 -0
- data/app/controllers/media_items_controller.rb +12 -0
- data/app/controllers/pages_controller.rb +39 -0
- data/app/controllers/public_controller.rb +5 -0
- data/app/helpers/admin_helper.rb +95 -0
- data/app/helpers/admin_info_helper.rb +12 -0
- data/app/helpers/admin_settings_helper.rb +16 -0
- data/app/helpers/application_helper.rb +2 -0
- data/app/helpers/block_helper.rb +25 -0
- data/app/helpers/cache_helper.rb +23 -0
- data/app/helpers/forest_errors_helper.rb +34 -0
- data/app/helpers/form_helper.rb +93 -0
- data/app/helpers/image_helper.rb +65 -0
- data/app/helpers/markdown_helper.rb +25 -0
- data/app/helpers/meta_helper.rb +238 -0
- data/app/helpers/navigation_helper.rb +18 -0
- data/app/helpers/status_indicator_helper.rb +7 -0
- data/app/inputs/block_selector_input.rb +16 -0
- data/app/inputs/collage_input.rb +63 -0
- data/app/inputs/color_input.rb +30 -0
- data/app/inputs/currency_input.rb +22 -0
- data/app/inputs/datepicker_input.rb +19 -0
- data/app/inputs/gallery_input.rb +67 -0
- data/app/inputs/grouped_collection_select_input.rb +19 -0
- data/app/inputs/image_input.rb +82 -0
- data/app/inputs/repeater_input.rb +58 -0
- data/app/jobs/forest/application_job.rb +4 -0
- data/app/mailers/forest/application_mailer.rb +6 -0
- data/app/models/application_record.rb +13 -0
- data/app/models/block_kind.rb +54 -0
- data/app/models/block_layout.rb +19 -0
- data/app/models/block_slot.rb +49 -0
- data/app/models/blocks/base_block.rb +134 -0
- data/app/models/cache_record.rb +2 -0
- data/app/models/concerns/attachable.rb +126 -0
- data/app/models/concerns/blockable.rb +65 -0
- data/app/models/concerns/filter_controller_scopes.rb +13 -0
- data/app/models/concerns/forest/cache_buster.rb +112 -0
- data/app/models/concerns/searchable.rb +200 -0
- data/app/models/concerns/sluggable.rb +70 -0
- data/app/models/concerns/statusable.rb +71 -0
- data/app/models/concerns/versionable.rb +13 -0
- data/app/models/forest/application_record.rb +111 -0
- data/app/models/import.rb +43 -0
- data/app/models/media_item.rb +136 -0
- data/app/models/menu.rb +65 -0
- data/app/models/page.rb +154 -0
- data/app/models/setting.rb +142 -0
- data/app/models/translation.rb +97 -0
- data/app/models/user.rb +45 -0
- data/app/models/user_group.rb +17 -0
- data/app/policies/application_policy.rb +71 -0
- data/app/policies/block_kind_policy.rb +2 -0
- data/app/policies/block_layout_policy.rb +2 -0
- data/app/policies/block_record_policy.rb +13 -0
- data/app/policies/dashboard_policy.rb +19 -0
- data/app/policies/media_item_policy.rb +5 -0
- data/app/policies/menu_policy.rb +2 -0
- data/app/policies/page_policy.rb +9 -0
- data/app/policies/setting_policy.rb +2 -0
- data/app/policies/translation_policy.rb +2 -0
- data/app/policies/user_group_policy.rb +2 -0
- data/app/policies/user_policy.rb +17 -0
- data/app/views/admin/_file_upload.html.erb +75 -0
- data/app/views/admin/_flash_notifications.html.erb +20 -0
- data/app/views/admin/_navigation.html.erb +61 -0
- data/app/views/admin/api/index/_header.json.jbuilder +2 -0
- data/app/views/admin/api/index/_records.json.jbuilder +6 -0
- data/app/views/admin/block_kinds/_form.html.erb +34 -0
- data/app/views/admin/block_kinds/edit.html.erb +3 -0
- data/app/views/admin/block_kinds/index.html.erb +31 -0
- data/app/views/admin/block_layouts/_form.html.erb +33 -0
- data/app/views/admin/block_layouts/edit.html.erb +3 -0
- data/app/views/admin/block_layouts/index.html.erb +29 -0
- data/app/views/admin/block_layouts/new.html.erb +3 -0
- data/app/views/admin/block_layouts/show.html.erb +24 -0
- data/app/views/admin/block_record/_block_layout.html.erb +67 -0
- data/app/views/admin/block_record/_block_slot_field_buttons.html.erb +15 -0
- data/app/views/admin/block_record/_block_slot_fields.html.erb +37 -0
- data/app/views/admin/block_record/_block_slot_fields_template.html.erb +50 -0
- data/app/views/admin/dashboard/_panel.html.erb +30 -0
- data/app/views/admin/dashboard/index.html.erb +18 -0
- data/app/views/admin/documentation/_body.html.erb +9 -0
- data/app/views/admin/documentation/_sidebar.html.erb +17 -0
- data/app/views/admin/documentation/index.html.erb +87 -0
- data/app/views/admin/form_inputs/_slug.html.erb +11 -0
- data/app/views/admin/form_inputs/_status.html.erb +20 -0
- data/app/views/admin/form_inputs/collage/_media_item_fields.html.erb +41 -0
- data/app/views/admin/headers/_edit.html.erb +68 -0
- data/app/views/admin/headers/_index.html.erb +61 -0
- data/app/views/admin/headers/_new.html.erb +14 -0
- data/app/views/admin/headers/_show.html.erb +37 -0
- data/app/views/admin/imports/edit.html.erb +60 -0
- data/app/views/admin/media_items/_form.html.erb +54 -0
- data/app/views/admin/media_items/_media_item_grid_layout.html.erb +23 -0
- data/app/views/admin/media_items/_media_item_list_layout.html.erb +32 -0
- data/app/views/admin/media_items/_modal.html.erb +62 -0
- data/app/views/admin/media_items/edit.html.erb +3 -0
- data/app/views/admin/media_items/index.html.erb +58 -0
- data/app/views/admin/media_items/index.json.jbuilder +2 -0
- data/app/views/admin/media_items/new.html.erb +3 -0
- data/app/views/admin/menus/_form.html.erb +92 -0
- data/app/views/admin/menus/_list_item.html.erb +39 -0
- data/app/views/admin/menus/edit.html.erb +3 -0
- data/app/views/admin/menus/index.html.erb +29 -0
- data/app/views/admin/menus/new.html.erb +3 -0
- data/app/views/admin/menus/show.html.erb +3 -0
- data/app/views/admin/navigation/_resources_dropdown.html.erb +12 -0
- data/app/views/admin/pages/_additional_inputs.html.erb +1 -0
- data/app/views/admin/pages/_form.html.erb +52 -0
- data/app/views/admin/pages/_table_row.html.erb +14 -0
- data/app/views/admin/pages/edit.html.erb +3 -0
- data/app/views/admin/pages/index.html.erb +33 -0
- data/app/views/admin/pages/index.json.jbuilder +2 -0
- data/app/views/admin/pages/new.html.erb +3 -0
- data/app/views/admin/pages/show.html.erb +3 -0
- data/app/views/admin/settings/_form.html.erb +25 -0
- data/app/views/admin/settings/edit.html.erb +3 -0
- data/app/views/admin/settings/index.html.erb +38 -0
- data/app/views/admin/settings/new.html.erb +3 -0
- data/app/views/admin/settings/show.html.erb +19 -0
- data/app/views/admin/settings/types/_boolean.html.erb +1 -0
- data/app/views/admin/settings/types/_image.html.erb +10 -0
- data/app/views/admin/settings/types/_integer.html.erb +5 -0
- data/app/views/admin/settings/types/_string.html.erb +5 -0
- data/app/views/admin/settings/types/_text.html.erb +5 -0
- data/app/views/admin/shared/_admin_head_additions.html.erb +1 -0
- data/app/views/admin/shared/navigation/_navbar.html.erb +8 -0
- data/app/views/admin/translations/_form.html.erb +31 -0
- data/app/views/admin/translations/edit.html.erb +3 -0
- data/app/views/admin/translations/index.html.erb +41 -0
- data/app/views/admin/translations/new.html.erb +3 -0
- data/app/views/admin/translations/show.html.erb +19 -0
- data/app/views/admin/user_groups/_form.html.erb +11 -0
- data/app/views/admin/user_groups/edit.html.erb +3 -0
- data/app/views/admin/user_groups/index.html.erb +29 -0
- data/app/views/admin/user_groups/new.html.erb +3 -0
- data/app/views/admin/user_groups/show.html.erb +9 -0
- data/app/views/admin/users/_form.html.erb +41 -0
- data/app/views/admin/users/edit.html.erb +3 -0
- data/app/views/admin/users/index.html.erb +35 -0
- data/app/views/admin/users/new.html.erb +3 -0
- data/app/views/admin/users/show.html.erb +4 -0
- data/app/views/blocks/_show.html.erb +21 -0
- data/app/views/devise/confirmations/new.html.erb +28 -0
- data/app/views/devise/mailer/confirmation_instructions.html.erb +5 -0
- data/app/views/devise/mailer/password_change.html.erb +3 -0
- data/app/views/devise/mailer/reset_password_instructions.html.erb +8 -0
- data/app/views/devise/mailer/unlock_instructions.html.erb +7 -0
- data/app/views/devise/passwords/edit.html.erb +31 -0
- data/app/views/devise/passwords/new.html.erb +27 -0
- data/app/views/devise/registrations/edit.html.erb +39 -0
- data/app/views/devise/registrations/new.html.erb +1 -0
- data/app/views/devise/sessions/_default_login.html.erb +25 -0
- data/app/views/devise/sessions/_first_time_login.html.erb +22 -0
- data/app/views/devise/sessions/new.html.erb +12 -0
- data/app/views/devise/shared/_flash_notifications.html.erb +3 -0
- data/app/views/devise/shared/_links.html.erb +25 -0
- data/app/views/devise/unlocks/new.html.erb +28 -0
- data/app/views/errors/internal_server_error.html.erb +2 -0
- data/app/views/errors/internal_server_error.json.jbuilder +4 -0
- data/app/views/errors/not_found.html.erb +2 -0
- data/app/views/errors/not_found.json.jbuilder +4 -0
- data/app/views/errors/unprocessable.html.erb +2 -0
- data/app/views/errors/unprocessable.json.jbuilder +4 -0
- data/app/views/forest/_analytics.html.erb +10 -0
- data/app/views/forest/_favicons.html.erb +7 -0
- data/app/views/kaminari/_first_page.html.erb +11 -0
- data/app/views/kaminari/_gap.html.erb +8 -0
- data/app/views/kaminari/_last_page.html.erb +11 -0
- data/app/views/kaminari/_next_page.html.erb +11 -0
- data/app/views/kaminari/_page.html.erb +12 -0
- data/app/views/kaminari/_paginator.html.erb +25 -0
- data/app/views/kaminari/_prev_page.html.erb +11 -0
- data/app/views/layouts/_shared_head.html.erb +48 -0
- data/app/views/layouts/admin.html.erb +19 -0
- data/app/views/layouts/application.html.erb +15 -0
- data/app/views/layouts/devise.html.erb +12 -0
- data/app/views/layouts/mailer.html.erb +13 -0
- data/app/views/layouts/mailer.text.erb +1 -0
- data/app/views/media_items/show.html.erb +29 -0
- data/app/views/pages/show.html.erb +1 -0
- data/app/views/public/index.html.erb +2 -0
- data/app/views/shared/_footer.html.erb +9 -0
- data/app/views/shared/_header.html.erb +9 -0
- data/app/views/shared/_header_colophon.html.erb +7 -0
- data/app/views/shared/_menu.html.erb +5 -0
- data/app/views/shared/_menu_item.html.erb +30 -0
- data/app/views/shared/_subnav.html.erb +7 -0
- data/config/initializers/aws.rb +17 -0
- data/config/initializers/devise.rb +275 -0
- data/config/initializers/forest.rb +5 -0
- data/config/initializers/paperclip.rb +1 -0
- data/config/initializers/rails_extensions.rb +6 -0
- data/config/initializers/simple_form.rb +164 -0
- data/config/initializers/simple_form/markdown.rb +21 -0
- data/config/initializers/simple_form/remote.rb +38 -0
- data/config/initializers/simple_form/sortable.rb +28 -0
- data/config/initializers/simple_form_bootstrap.rb +155 -0
- data/config/locales/devise.en.yml +62 -0
- data/config/locales/en.yml +24 -0
- data/config/locales/simple_form.en.yml +31 -0
- data/config/routes.rb +61 -0
- data/db/migrate/20161217191000_devise_create_users.rb +48 -0
- data/db/migrate/20161217200300_create_pages.rb +21 -0
- data/db/migrate/20161217205353_create_menus.rb +12 -0
- data/db/migrate/20161219033747_create_settings.rb +14 -0
- data/db/migrate/20161219231741_create_media_items.rb +18 -0
- data/db/migrate/20161225212203_create_user_groups.rb +10 -0
- data/db/migrate/20161225212258_create_join_table_user_groups_users.rb +8 -0
- data/db/migrate/20170109175932_create_block_kinds.rb +14 -0
- data/db/migrate/20170109180818_create_block_slots.rb +17 -0
- data/db/migrate/20170109185414_create_base_blocks.rb +8 -0
- data/db/migrate/20170818025124_create_block_layouts.rb +13 -0
- data/db/migrate/20170818025229_add_block_layout_to_block_slots.rb +5 -0
- data/db/migrate/20170818025500_remove_layout_from_block_slots.rb +5 -0
- data/db/migrate/20170821161755_add_unique_index_to_block_layouts.rb +6 -0
- data/db/migrate/20170826173346_create_translations.rb +12 -0
- data/db/migrate/20170910204934_index_attachment_content_type_on_media_items.rb +5 -0
- data/db/migrate/20180206035546_create_cache_records.rb +14 -0
- data/db/migrate/20180415034427_add_redirect_to_pages.rb +5 -0
- data/db/migrate/20180618190248_add_index_created_at_to_media_items.rb +5 -0
- data/db/migrate/20180625172226_add_blockable_metadata_to_pages.rb +6 -0
- data/db/migrate/20180626182949_remove_attachable_from_media_items.rb +7 -0
- data/db/migrate/20180712162414_add_media_item_status_to_media_items.rb +6 -0
- data/db/migrate/20190223155013_add_type_to_block_kinds.rb +6 -0
- data/db/migrate/20190423173909_add_seo_title_to_pages.rb +5 -0
- data/lib/forest.rb +9 -0
- data/lib/forest/engine.rb +51 -0
- data/lib/forest/migrations.rb +86 -0
- data/lib/forest/rails/active_record/has_many_ordered.rb +30 -0
- data/lib/forest/rails/active_record/has_repeatable.rb +19 -0
- data/lib/forest/rails/core_ext/enumerable.rb +17 -0
- data/lib/forest/version.rb +3 -0
- data/lib/generators/forest/block/USAGE +8 -0
- data/lib/generators/forest/block/block_generator.rb +103 -0
- data/lib/generators/forest/block/templates/_block.html.erb +2 -0
- data/lib/generators/forest/block/templates/_block.scss.erb +5 -0
- data/lib/generators/forest/block/templates/_block_edit_fields.html.erb +21 -0
- data/lib/generators/forest/block/templates/create_table_migration.rb +31 -0
- data/lib/generators/forest/block/templates/model.rb +41 -0
- data/lib/generators/forest/install/USAGE +2 -0
- data/lib/generators/forest/install/install_generator.rb +72 -0
- data/lib/generators/forest/scaffold/USAGE +8 -0
- data/lib/generators/forest/scaffold/scaffold_generator.rb +133 -0
- data/lib/generators/forest/scaffold/templates/admin_controller.rb +67 -0
- data/lib/generators/forest/scaffold/templates/controller.rb +20 -0
- data/lib/generators/forest/scaffold/templates/create_table_migration.rb +35 -0
- data/lib/generators/forest/scaffold/templates/model.rb +21 -0
- data/lib/generators/forest/scaffold/templates/policy.rb +2 -0
- data/lib/generators/forest/scaffold/templates/views/admin/_form.html.erb +56 -0
- data/lib/generators/forest/scaffold/templates/views/admin/edit.html.erb +3 -0
- data/lib/generators/forest/scaffold/templates/views/admin/index.html.erb +58 -0
- data/lib/generators/forest/scaffold/templates/views/admin/index.json.jbuilder +2 -0
- data/lib/generators/forest/scaffold/templates/views/admin/new.html.erb +3 -0
- data/lib/generators/forest/scaffold/templates/views/admin/show.html.erb +12 -0
- data/lib/generators/forest/scaffold/templates/views/public/index.html.erb +1 -0
- data/lib/generators/forest/scaffold/templates/views/public/show.html.erb +17 -0
- data/lib/tasks/forest_db_tasks.rake +176 -0
- data/lib/tasks/forest_elasticsearch_tasks.rake +22 -0
- metadata +719 -0
@@ -0,0 +1 @@
|
|
1
|
+
<%= yield %>
|
@@ -0,0 +1,29 @@
|
|
1
|
+
<%= link_to @media_item.attachment.url do %>
|
2
|
+
<%# TODO: handle non-image file types %>
|
3
|
+
<%= responsive_image @media_item %>
|
4
|
+
<% end %>
|
5
|
+
|
6
|
+
<p>
|
7
|
+
<strong>Title:</strong>
|
8
|
+
<%= @media_item.title %>
|
9
|
+
</p>
|
10
|
+
|
11
|
+
<p>
|
12
|
+
<strong>Slug:</strong>
|
13
|
+
<%= @media_item.slug %>
|
14
|
+
</p>
|
15
|
+
|
16
|
+
<p>
|
17
|
+
<strong>Caption:</strong>
|
18
|
+
<%= @media_item.caption %>
|
19
|
+
</p>
|
20
|
+
|
21
|
+
<p>
|
22
|
+
<strong>Alternative text:</strong>
|
23
|
+
<%= @media_item.alternative_text %>
|
24
|
+
</p>
|
25
|
+
|
26
|
+
<p>
|
27
|
+
<strong>Description:</strong>
|
28
|
+
<%= @media_item.description %>
|
29
|
+
</p>
|
@@ -0,0 +1 @@
|
|
1
|
+
<%= render_blocks @page %>
|
@@ -0,0 +1,30 @@
|
|
1
|
+
<%# TODO: refactor this logic to exist in a MenuItem class -%>
|
2
|
+
<% item_name = item['name'] %>
|
3
|
+
<% if item['url'].present? %>
|
4
|
+
<% item_url = item['url'] %>
|
5
|
+
<% else %>
|
6
|
+
<% item_url = '' %>
|
7
|
+
<% end %>
|
8
|
+
<% classes = ['menu__item'] %>
|
9
|
+
<% classes.push 'menu__item--with-children' if item['children'].present? %>
|
10
|
+
<% classes.push "menu__item--#{item_name.parameterize}" if item_name %>
|
11
|
+
<% classes.push 'menu__item--active' if item_url.sub(/^\//, '') == request.path.sub(/^\//, '') %>
|
12
|
+
<% classes.push 'menu__item--active' if item_url == '/' && request.path == '' %>
|
13
|
+
<% classes.push 'menu__item--active-child' if item_url.sub(/^\//, '') == request.path.split('/').reject(&:blank?).first %>
|
14
|
+
<%= content_tag :li, class: classes.join(' ') do -%>
|
15
|
+
<% if item_url.present? %>
|
16
|
+
<% link = item_url %>
|
17
|
+
<% else %>
|
18
|
+
<% link = nil %>
|
19
|
+
<% end %>
|
20
|
+
<% if link.present? %>
|
21
|
+
<%= link_to md(item_name), link, class: 'menu__item__link' -%>
|
22
|
+
<% else %>
|
23
|
+
<%= content_tag :span, md(item_name), class: 'menu__item__link menu__item__link--no-link' -%>
|
24
|
+
<% end %>
|
25
|
+
<% if item['children'].present? %>
|
26
|
+
<%= content_tag :ul, class: "menu__sub-menu" do -%>
|
27
|
+
<%= render partial: 'shared/menu_item', collection: item['children'], as: 'item' -%>
|
28
|
+
<% end %>
|
29
|
+
<% end %>
|
30
|
+
<% end %>
|
@@ -0,0 +1,7 @@
|
|
1
|
+
<ul class="subnav">
|
2
|
+
<% items.each do |item| %>
|
3
|
+
<%= content_tag :li, class: "subnav__item subnav__item--#{item.slug}" do %>
|
4
|
+
<%= link_to md(item.title), page_path(item.to_friendly_param), class: "subnav__item__link subnav__item__link--#{item.slug}" %>
|
5
|
+
<% end %>
|
6
|
+
<% end %>
|
7
|
+
</ul>
|
@@ -0,0 +1,17 @@
|
|
1
|
+
aws_access_key_id = ENV['AWS_ACCESS_KEY_ID'].presence || Rails.application.credentials&.dig(:aws, :aws_access_key_id)
|
2
|
+
aws_secret_key_id = ENV['AWS_SECRET_KEY_ID'].presence || Rails.application.credentials&.dig(:aws, :aws_secret_key_id)
|
3
|
+
s3_bucket_name = ENV['S3_BUCKET_NAME'].presence || Rails.application.credentials&.dig(:aws, :s3_bucket_name)
|
4
|
+
aws_region = ENV['AWS_REGION'].presence || Rails.application.credentials&.dig(:aws, :aws_region)
|
5
|
+
|
6
|
+
if aws_access_key_id.present? &&
|
7
|
+
aws_secret_key_id.present? &&
|
8
|
+
s3_bucket_name.present? &&
|
9
|
+
aws_region.present?
|
10
|
+
|
11
|
+
Aws.config.update({
|
12
|
+
region: aws_region,
|
13
|
+
credentials: Aws::Credentials.new(aws_access_key_id, aws_secret_key_id),
|
14
|
+
})
|
15
|
+
|
16
|
+
S3_BUCKET = Aws::S3::Resource.new.bucket(s3_bucket_name)
|
17
|
+
end
|
@@ -0,0 +1,275 @@
|
|
1
|
+
# Use this hook to configure devise mailer, warden hooks and so forth.
|
2
|
+
# Many of these configuration options can be set straight in your model.
|
3
|
+
Devise.setup do |config|
|
4
|
+
# The secret key used by Devise. Devise uses this key to generate
|
5
|
+
# random tokens. Changing this key will render invalid all existing
|
6
|
+
# confirmation, reset password and unlock tokens in the database.
|
7
|
+
# Devise will use the `secret_key_base` as its `secret_key`
|
8
|
+
# by default. You can change it below and use your own secret key.
|
9
|
+
# config.secret_key = 'c243e7d563444a28e727cdab0f01f103a9e9cad1ba699f6788a3544655075cc9d5def261d7f1d4d6dac1d75e7427f081820bec99d433629225f1d5f049258a4b'
|
10
|
+
|
11
|
+
# ==> Mailer Configuration
|
12
|
+
# Configure the e-mail address which will be shown in Devise::Mailer,
|
13
|
+
# note that it will be overwritten if you use your own mailer class
|
14
|
+
# with default "from" parameter.
|
15
|
+
config.mailer_sender = 'please-change-me-at-config-initializers-devise@example.com'
|
16
|
+
|
17
|
+
# Configure the class responsible to send e-mails.
|
18
|
+
# config.mailer = 'Devise::Mailer'
|
19
|
+
|
20
|
+
# Configure the parent class responsible to send e-mails.
|
21
|
+
# config.parent_mailer = 'ActionMailer::Base'
|
22
|
+
|
23
|
+
# ==> ORM configuration
|
24
|
+
# Load and configure the ORM. Supports :active_record (default) and
|
25
|
+
# :mongoid (bson_ext recommended) by default. Other ORMs may be
|
26
|
+
# available as additional gems.
|
27
|
+
require 'devise/orm/active_record'
|
28
|
+
|
29
|
+
# ==> Configuration for any authentication mechanism
|
30
|
+
# Configure which keys are used when authenticating a user. The default is
|
31
|
+
# just :email. You can configure it to use [:username, :subdomain], so for
|
32
|
+
# authenticating a user, both parameters are required. Remember that those
|
33
|
+
# parameters are used only when authenticating and not when retrieving from
|
34
|
+
# session. If you need permissions, you should implement that in a before filter.
|
35
|
+
# You can also supply a hash where the value is a boolean determining whether
|
36
|
+
# or not authentication should be aborted when the value is not present.
|
37
|
+
# config.authentication_keys = [:email]
|
38
|
+
|
39
|
+
# Configure parameters from the request object used for authentication. Each entry
|
40
|
+
# given should be a request method and it will automatically be passed to the
|
41
|
+
# find_for_authentication method and considered in your model lookup. For instance,
|
42
|
+
# if you set :request_keys to [:subdomain], :subdomain will be used on authentication.
|
43
|
+
# The same considerations mentioned for authentication_keys also apply to request_keys.
|
44
|
+
# config.request_keys = []
|
45
|
+
|
46
|
+
# Configure which authentication keys should be case-insensitive.
|
47
|
+
# These keys will be downcased upon creating or modifying a user and when used
|
48
|
+
# to authenticate or find a user. Default is :email.
|
49
|
+
config.case_insensitive_keys = [:email]
|
50
|
+
|
51
|
+
# Configure which authentication keys should have whitespace stripped.
|
52
|
+
# These keys will have whitespace before and after removed upon creating or
|
53
|
+
# modifying a user and when used to authenticate or find a user. Default is :email.
|
54
|
+
config.strip_whitespace_keys = [:email]
|
55
|
+
|
56
|
+
# Tell if authentication through request.params is enabled. True by default.
|
57
|
+
# It can be set to an array that will enable params authentication only for the
|
58
|
+
# given strategies, for example, `config.params_authenticatable = [:database]` will
|
59
|
+
# enable it only for database (email + password) authentication.
|
60
|
+
# config.params_authenticatable = true
|
61
|
+
|
62
|
+
# Tell if authentication through HTTP Auth is enabled. False by default.
|
63
|
+
# It can be set to an array that will enable http authentication only for the
|
64
|
+
# given strategies, for example, `config.http_authenticatable = [:database]` will
|
65
|
+
# enable it only for database authentication. The supported strategies are:
|
66
|
+
# :database = Support basic authentication with authentication key + password
|
67
|
+
# config.http_authenticatable = false
|
68
|
+
|
69
|
+
# If 401 status code should be returned for AJAX requests. True by default.
|
70
|
+
# config.http_authenticatable_on_xhr = true
|
71
|
+
|
72
|
+
# The realm used in Http Basic Authentication. 'Application' by default.
|
73
|
+
# config.http_authentication_realm = 'Application'
|
74
|
+
|
75
|
+
# It will change confirmation, password recovery and other workflows
|
76
|
+
# to behave the same regardless if the e-mail provided was right or wrong.
|
77
|
+
# Does not affect registerable.
|
78
|
+
# config.paranoid = true
|
79
|
+
|
80
|
+
# By default Devise will store the user in session. You can skip storage for
|
81
|
+
# particular strategies by setting this option.
|
82
|
+
# Notice that if you are skipping storage for all authentication paths, you
|
83
|
+
# may want to disable generating routes to Devise's sessions controller by
|
84
|
+
# passing skip: :sessions to `devise_for` in your config/routes.rb
|
85
|
+
config.skip_session_storage = [:http_auth]
|
86
|
+
|
87
|
+
# By default, Devise cleans up the CSRF token on authentication to
|
88
|
+
# avoid CSRF token fixation attacks. This means that, when using AJAX
|
89
|
+
# requests for sign in and sign up, you need to get a new CSRF token
|
90
|
+
# from the server. You can disable this option at your own risk.
|
91
|
+
# config.clean_up_csrf_token_on_authentication = true
|
92
|
+
|
93
|
+
# When false, Devise will not attempt to reload routes on eager load.
|
94
|
+
# This can reduce the time taken to boot the app but if your application
|
95
|
+
# requires the Devise mappings to be loaded during boot time the application
|
96
|
+
# won't boot properly.
|
97
|
+
# config.reload_routes = true
|
98
|
+
|
99
|
+
# ==> Configuration for :database_authenticatable
|
100
|
+
# For bcrypt, this is the cost for hashing the password and defaults to 11. If
|
101
|
+
# using other algorithms, it sets how many times you want the password to be hashed.
|
102
|
+
#
|
103
|
+
# Limiting the stretches to just one in testing will increase the performance of
|
104
|
+
# your test suite dramatically. However, it is STRONGLY RECOMMENDED to not use
|
105
|
+
# a value less than 10 in other environments. Note that, for bcrypt (the default
|
106
|
+
# algorithm), the cost increases exponentially with the number of stretches (e.g.
|
107
|
+
# a value of 20 is already extremely slow: approx. 60 seconds for 1 calculation).
|
108
|
+
config.stretches = Rails.env.test? ? 1 : 11
|
109
|
+
|
110
|
+
# Set up a pepper to generate the hashed password.
|
111
|
+
# config.pepper = 'fba61035d011026566ec6cfb43f9502b20b8e2986db9deccdeb14620ce1903e85f19f6aa87423b92d1ddbdfb7764b380df386f7d8a2fc1e3db55f2b23dc65f42'
|
112
|
+
|
113
|
+
# Send a notification email when the user's password is changed
|
114
|
+
# config.send_password_change_notification = false
|
115
|
+
|
116
|
+
# ==> Configuration for :confirmable
|
117
|
+
# A period that the user is allowed to access the website even without
|
118
|
+
# confirming their account. For instance, if set to 2.days, the user will be
|
119
|
+
# able to access the website for two days without confirming their account,
|
120
|
+
# access will be blocked just in the third day. Default is 0.days, meaning
|
121
|
+
# the user cannot access the website without confirming their account.
|
122
|
+
# config.allow_unconfirmed_access_for = 2.days
|
123
|
+
|
124
|
+
# A period that the user is allowed to confirm their account before their
|
125
|
+
# token becomes invalid. For example, if set to 3.days, the user can confirm
|
126
|
+
# their account within 3 days after the mail was sent, but on the fourth day
|
127
|
+
# their account can't be confirmed with the token any more.
|
128
|
+
# Default is nil, meaning there is no restriction on how long a user can take
|
129
|
+
# before confirming their account.
|
130
|
+
# config.confirm_within = 3.days
|
131
|
+
|
132
|
+
# If true, requires any email changes to be confirmed (exactly the same way as
|
133
|
+
# initial account confirmation) to be applied. Requires additional unconfirmed_email
|
134
|
+
# db field (see migrations). Until confirmed, new email is stored in
|
135
|
+
# unconfirmed_email column, and copied to email column on successful confirmation.
|
136
|
+
config.reconfirmable = true
|
137
|
+
|
138
|
+
# Defines which key will be used when confirming an account
|
139
|
+
# config.confirmation_keys = [:email]
|
140
|
+
|
141
|
+
# ==> Configuration for :rememberable
|
142
|
+
# The time the user will be remembered without asking for credentials again.
|
143
|
+
# config.remember_for = 2.weeks
|
144
|
+
|
145
|
+
# Invalidates all the remember me tokens when the user signs out.
|
146
|
+
config.expire_all_remember_me_on_sign_out = true
|
147
|
+
|
148
|
+
# If true, extends the user's remember period when remembered via cookie.
|
149
|
+
# config.extend_remember_period = false
|
150
|
+
|
151
|
+
# Options to be passed to the created cookie. For instance, you can set
|
152
|
+
# secure: true in order to force SSL only cookies.
|
153
|
+
# config.rememberable_options = {}
|
154
|
+
|
155
|
+
# ==> Configuration for :validatable
|
156
|
+
# Range for password length.
|
157
|
+
config.password_length = 6..128
|
158
|
+
|
159
|
+
# Email regex used to validate email formats. It simply asserts that
|
160
|
+
# one (and only one) @ exists in the given string. This is mainly
|
161
|
+
# to give user feedback and not to assert the e-mail validity.
|
162
|
+
config.email_regexp = /\A[^@\s]+@[^@\s]+\z/
|
163
|
+
|
164
|
+
# ==> Configuration for :timeoutable
|
165
|
+
# The time you want to timeout the user session without activity. After this
|
166
|
+
# time the user will be asked for credentials again. Default is 30 minutes.
|
167
|
+
# config.timeout_in = 30.minutes
|
168
|
+
|
169
|
+
# ==> Configuration for :lockable
|
170
|
+
# Defines which strategy will be used to lock an account.
|
171
|
+
# :failed_attempts = Locks an account after a number of failed attempts to sign in.
|
172
|
+
# :none = No lock strategy. You should handle locking by yourself.
|
173
|
+
# config.lock_strategy = :failed_attempts
|
174
|
+
|
175
|
+
# Defines which key will be used when locking and unlocking an account
|
176
|
+
# config.unlock_keys = [:email]
|
177
|
+
|
178
|
+
# Defines which strategy will be used to unlock an account.
|
179
|
+
# :email = Sends an unlock link to the user email
|
180
|
+
# :time = Re-enables login after a certain amount of time (see :unlock_in below)
|
181
|
+
# :both = Enables both strategies
|
182
|
+
# :none = No unlock strategy. You should handle unlocking by yourself.
|
183
|
+
# config.unlock_strategy = :both
|
184
|
+
|
185
|
+
# Number of authentication tries before locking an account if lock_strategy
|
186
|
+
# is failed attempts.
|
187
|
+
# config.maximum_attempts = 20
|
188
|
+
|
189
|
+
# Time interval to unlock the account if :time is enabled as unlock_strategy.
|
190
|
+
# config.unlock_in = 1.hour
|
191
|
+
|
192
|
+
# Warn on the last attempt before the account is locked.
|
193
|
+
# config.last_attempt_warning = true
|
194
|
+
|
195
|
+
# ==> Configuration for :recoverable
|
196
|
+
#
|
197
|
+
# Defines which key will be used when recovering the password for an account
|
198
|
+
# config.reset_password_keys = [:email]
|
199
|
+
|
200
|
+
# Time interval you can reset your password with a reset password key.
|
201
|
+
# Don't put a too small interval or your users won't have the time to
|
202
|
+
# change their passwords.
|
203
|
+
config.reset_password_within = 6.hours
|
204
|
+
|
205
|
+
# When set to false, does not sign a user in automatically after their password is
|
206
|
+
# reset. Defaults to true, so a user is signed in automatically after a reset.
|
207
|
+
# config.sign_in_after_reset_password = true
|
208
|
+
|
209
|
+
# ==> Configuration for :encryptable
|
210
|
+
# Allow you to use another hashing or encryption algorithm besides bcrypt (default).
|
211
|
+
# You can use :sha1, :sha512 or algorithms from others authentication tools as
|
212
|
+
# :clearance_sha1, :authlogic_sha512 (then you should set stretches above to 20
|
213
|
+
# for default behavior) and :restful_authentication_sha1 (then you should set
|
214
|
+
# stretches to 10, and copy REST_AUTH_SITE_KEY to pepper).
|
215
|
+
#
|
216
|
+
# Require the `devise-encryptable` gem when using anything other than bcrypt
|
217
|
+
# config.encryptor = :sha512
|
218
|
+
|
219
|
+
# ==> Scopes configuration
|
220
|
+
# Turn scoped views on. Before rendering "sessions/new", it will first check for
|
221
|
+
# "users/sessions/new". It's turned off by default because it's slower if you
|
222
|
+
# are using only default views.
|
223
|
+
# config.scoped_views = false
|
224
|
+
|
225
|
+
# Configure the default scope given to Warden. By default it's the first
|
226
|
+
# devise role declared in your routes (usually :user).
|
227
|
+
# config.default_scope = :user
|
228
|
+
|
229
|
+
# Set this configuration to false if you want /users/sign_out to sign out
|
230
|
+
# only the current scope. By default, Devise signs out all scopes.
|
231
|
+
# config.sign_out_all_scopes = true
|
232
|
+
|
233
|
+
# ==> Navigation configuration
|
234
|
+
# Lists the formats that should be treated as navigational. Formats like
|
235
|
+
# :html, should redirect to the sign in page when the user does not have
|
236
|
+
# access, but formats like :xml or :json, should return 401.
|
237
|
+
#
|
238
|
+
# If you have any extra navigational formats, like :iphone or :mobile, you
|
239
|
+
# should add them to the navigational formats lists.
|
240
|
+
#
|
241
|
+
# The "*/*" below is required to match Internet Explorer requests.
|
242
|
+
# config.navigational_formats = ['*/*', :html]
|
243
|
+
|
244
|
+
# The default HTTP method used to sign out a resource. Default is :delete.
|
245
|
+
config.sign_out_via = :delete
|
246
|
+
|
247
|
+
# ==> OmniAuth
|
248
|
+
# Add a new OmniAuth provider. Check the wiki for more information on setting
|
249
|
+
# up on your models and hooks.
|
250
|
+
# config.omniauth :github, 'APP_ID', 'APP_SECRET', scope: 'user,public_repo'
|
251
|
+
|
252
|
+
# ==> Warden configuration
|
253
|
+
# If you want to use other strategies, that are not supported by Devise, or
|
254
|
+
# change the failure app, you can configure them inside the config.warden block.
|
255
|
+
#
|
256
|
+
# config.warden do |manager|
|
257
|
+
# manager.intercept_401 = false
|
258
|
+
# manager.default_strategies(scope: :user).unshift :some_external_strategy
|
259
|
+
# end
|
260
|
+
|
261
|
+
# ==> Mountable engine configurations
|
262
|
+
# When using Devise inside an engine, let's call it `MyEngine`, and this engine
|
263
|
+
# is mountable, there are some extra configurations to be taken into account.
|
264
|
+
# The following options are available, assuming the engine is mounted as:
|
265
|
+
#
|
266
|
+
# mount MyEngine, at: '/my_engine'
|
267
|
+
#
|
268
|
+
# The router that invoked `devise_for`, in the example above, would be:
|
269
|
+
# config.router_name = :forest
|
270
|
+
config.parent_controller = 'ForestController'
|
271
|
+
|
272
|
+
# When using OmniAuth, Devise cannot automatically set OmniAuth path,
|
273
|
+
# so you need to do it manually. For the users scope, it would be:
|
274
|
+
# config.omniauth_path_prefix = '/my_engine/users/auth'
|
275
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
Paperclip::Attachment.default_options[:use_timestamp] = false
|
@@ -0,0 +1,164 @@
|
|
1
|
+
# Use this setup block to configure all options available in SimpleForm.
|
2
|
+
SimpleForm.setup do |config|
|
3
|
+
# Wrappers are used by the form builder to generate a
|
4
|
+
# complete input. You can remove any component from the
|
5
|
+
# wrapper, change the order or even add your own to the
|
6
|
+
# stack. The options given below are used to wrap the
|
7
|
+
# whole input.
|
8
|
+
config.wrappers :default, class: :input, hint_class: :field_with_hint, error_class: :field_with_errors do |b|
|
9
|
+
## Extensions enabled by default
|
10
|
+
# Any of these extensions can be disabled for a
|
11
|
+
# given input by passing: `f.input EXTENSION_NAME => false`.
|
12
|
+
# You can make any of these extensions optional by
|
13
|
+
# renaming `b.use` to `b.optional`.
|
14
|
+
|
15
|
+
# Determines whether to use HTML5 (:email, :url, ...)
|
16
|
+
# and required attributes
|
17
|
+
b.use :html5
|
18
|
+
|
19
|
+
# Calculates placeholders automatically from I18n
|
20
|
+
# You can also pass a string as f.input placeholder: "Placeholder"
|
21
|
+
b.use :placeholder
|
22
|
+
|
23
|
+
## Optional extensions
|
24
|
+
# They are disabled unless you pass `f.input EXTENSION_NAME => true`
|
25
|
+
# to the input. If so, they will retrieve the values from the model
|
26
|
+
# if any exists. If you want to enable any of those
|
27
|
+
# extensions by default, you can change `b.optional` to `b.use`.
|
28
|
+
|
29
|
+
# Calculates maxlength from length validations for string inputs
|
30
|
+
b.optional :maxlength
|
31
|
+
|
32
|
+
# Calculates pattern from format validations for string inputs
|
33
|
+
b.optional :pattern
|
34
|
+
|
35
|
+
# Calculates min and max from length validations for numeric inputs
|
36
|
+
b.optional :min_max
|
37
|
+
|
38
|
+
# Calculates readonly automatically from readonly attributes
|
39
|
+
b.optional :readonly
|
40
|
+
|
41
|
+
## Inputs
|
42
|
+
b.use :label_input
|
43
|
+
b.use :hint, wrap_with: { tag: :span, class: :hint }
|
44
|
+
b.use :error, wrap_with: { tag: :span, class: :error }
|
45
|
+
|
46
|
+
## full_messages_for
|
47
|
+
# If you want to display the full error message for the attribute, you can
|
48
|
+
# use the component :full_error, like:
|
49
|
+
#
|
50
|
+
# b.use :full_error, wrap_with: { tag: :span, class: :error }
|
51
|
+
end
|
52
|
+
|
53
|
+
# The default wrapper to be used by the FormBuilder.
|
54
|
+
config.default_wrapper = :default
|
55
|
+
|
56
|
+
# Define the way to render check boxes / radio buttons with labels.
|
57
|
+
# Defaults to :nested for bootstrap config.
|
58
|
+
# inline: input + label
|
59
|
+
# nested: label > input
|
60
|
+
config.boolean_style = :nested
|
61
|
+
|
62
|
+
# Default class for buttons
|
63
|
+
config.button_class = 'btn'
|
64
|
+
|
65
|
+
# Method used to tidy up errors. Specify any Rails Array method.
|
66
|
+
# :first lists the first message for each field.
|
67
|
+
# Use :to_sentence to list all errors for each field.
|
68
|
+
# config.error_method = :first
|
69
|
+
|
70
|
+
# Default tag used for error notification helper.
|
71
|
+
config.error_notification_tag = :div
|
72
|
+
|
73
|
+
# CSS class to add for error notification helper.
|
74
|
+
config.error_notification_class = 'error_notification'
|
75
|
+
|
76
|
+
# ID to add for error notification helper.
|
77
|
+
# config.error_notification_id = nil
|
78
|
+
|
79
|
+
# Series of attempts to detect a default label method for collection.
|
80
|
+
# config.collection_label_methods = [ :to_label, :name, :title, :to_s ]
|
81
|
+
|
82
|
+
# Series of attempts to detect a default value method for collection.
|
83
|
+
# config.collection_value_methods = [ :id, :to_s ]
|
84
|
+
|
85
|
+
# You can wrap a collection of radio/check boxes in a pre-defined tag, defaulting to none.
|
86
|
+
# config.collection_wrapper_tag = nil
|
87
|
+
|
88
|
+
# You can define the class to use on all collection wrappers. Defaulting to none.
|
89
|
+
# config.collection_wrapper_class = nil
|
90
|
+
|
91
|
+
# You can wrap each item in a collection of radio/check boxes with a tag,
|
92
|
+
# defaulting to :span.
|
93
|
+
# config.item_wrapper_tag = :span
|
94
|
+
|
95
|
+
# You can define a class to use in all item wrappers. Defaulting to none.
|
96
|
+
# config.item_wrapper_class = nil
|
97
|
+
|
98
|
+
# How the label text should be generated altogether with the required text.
|
99
|
+
# config.label_text = lambda { |label, required, explicit_label| "#{required} #{label}" }
|
100
|
+
|
101
|
+
# You can define the class to use on all labels. Default is nil.
|
102
|
+
# config.label_class = nil
|
103
|
+
|
104
|
+
# You can define the default class to be used on forms. Can be overriden
|
105
|
+
# with `html: { :class }`. Defaulting to none.
|
106
|
+
# config.default_form_class = nil
|
107
|
+
|
108
|
+
# You can define which elements should obtain additional classes
|
109
|
+
# config.generate_additional_classes_for = [:wrapper, :label, :input]
|
110
|
+
|
111
|
+
# Whether attributes are required by default (or not). Default is true.
|
112
|
+
# config.required_by_default = true
|
113
|
+
|
114
|
+
# Tell browsers whether to use the native HTML5 validations (novalidate form option).
|
115
|
+
# These validations are enabled in SimpleForm's internal config but disabled by default
|
116
|
+
# in this configuration, which is recommended due to some quirks from different browsers.
|
117
|
+
# To stop SimpleForm from generating the novalidate option, enabling the HTML5 validations,
|
118
|
+
# change this configuration to true.
|
119
|
+
config.browser_validations = false
|
120
|
+
|
121
|
+
# Collection of methods to detect if a file type was given.
|
122
|
+
# config.file_methods = [ :mounted_as, :file?, :public_filename ]
|
123
|
+
|
124
|
+
# Custom mappings for input types. This should be a hash containing a regexp
|
125
|
+
# to match as key, and the input type that will be used when the field name
|
126
|
+
# matches the regexp as value.
|
127
|
+
# config.input_mappings = { /count/ => :integer }
|
128
|
+
|
129
|
+
# Custom wrappers for input types. This should be a hash containing an input
|
130
|
+
# type as key and the wrapper that will be used for all inputs with specified type.
|
131
|
+
# config.wrapper_mappings = { string: :prepend }
|
132
|
+
|
133
|
+
# Namespaces where SimpleForm should look for custom input classes that
|
134
|
+
# override default inputs.
|
135
|
+
# config.custom_inputs_namespaces << "CustomInputs"
|
136
|
+
|
137
|
+
# Default priority for time_zone inputs.
|
138
|
+
# config.time_zone_priority = nil
|
139
|
+
|
140
|
+
# Default priority for country inputs.
|
141
|
+
# config.country_priority = nil
|
142
|
+
|
143
|
+
# When false, do not use translations for labels.
|
144
|
+
# config.translate_labels = true
|
145
|
+
|
146
|
+
# Automatically discover new inputs in Rails' autoload path.
|
147
|
+
# config.inputs_discovery = true
|
148
|
+
|
149
|
+
# Cache SimpleForm inputs discovery
|
150
|
+
# config.cache_discovery = !Rails.env.development?
|
151
|
+
|
152
|
+
# Default class for inputs
|
153
|
+
# config.input_class = nil
|
154
|
+
|
155
|
+
# Define the default class of the input wrapper of the boolean input.
|
156
|
+
config.boolean_label_class = 'checkbox'
|
157
|
+
|
158
|
+
# Defines if the default input wrapper class should be included in radio
|
159
|
+
# collection wrappers.
|
160
|
+
# config.include_default_input_wrapper_class = true
|
161
|
+
|
162
|
+
# Defines which i18n scope will be used in Simple Form.
|
163
|
+
# config.i18n_scope = 'simple_form'
|
164
|
+
end
|