├── .browserslistrc ├── .codecov.yml ├── .docker ├── bin │ ├── check-versions.sh │ └── make-buildpacks-test-file.sh ├── dev-docker-entrypoint-migrate.sh ├── dev-docker-entrypoint.sh ├── docker-entrypoint-migrate.sh ├── docker-entrypoint.sh ├── images │ └── dev-base │ │ └── Dockerfile └── services │ ├── mongo │ ├── mongo.yml │ └── setup-mongodb.js │ ├── outpost-api-service │ └── outpost-api-service.yml │ └── postgres │ └── postgres.yml ├── .dockerignore ├── .github └── workflows │ ├── publish-dev-base.yml │ ├── publish-outpost-image.yml │ ├── test-docker-build.yml │ ├── test-in-herokuish.yml │ └── test.yml ├── .gitignore ├── .nvmrc ├── .rspec ├── .ruby-version ├── .yarn └── releases │ └── yarn-1.22.19.cjs ├── .yarnrc ├── Dockerfile ├── Dockerfile.production ├── Dockerfile.test ├── Gemfile ├── Gemfile.lock ├── LICENSE ├── Makefile ├── Procfile ├── README.md ├── Rakefile ├── app.json ├── app ├── assets │ ├── config │ │ └── manifest.js │ ├── images │ │ ├── .keep │ │ ├── admin-black.svg │ │ ├── admin.svg │ │ ├── asc-active.svg │ │ ├── back.svg │ │ ├── clear.svg │ │ ├── cross-circle.svg │ │ ├── cross-stepper.svg │ │ ├── desc-active.svg │ │ ├── down-arrow-white.svg │ │ ├── down-arrow.svg │ │ ├── exclamation-circle.svg │ │ ├── favicon.ico │ │ ├── level-up-alt-solid.svg │ │ ├── location-icon.svg │ │ ├── logo-outpost.svg │ │ ├── note-icon.svg │ │ ├── ogl.svg │ │ ├── organisation-icon.svg │ │ ├── outpost.png │ │ ├── pending-circle.svg │ │ ├── plus-white.svg │ │ ├── plus.svg │ │ ├── search.svg │ │ ├── select-down.svg │ │ ├── service-icon.svg │ │ ├── tick-black.svg │ │ ├── tick-circle.svg │ │ ├── tick-white.svg │ │ ├── tick.svg │ │ ├── up-arrow.svg │ │ ├── user-icon.svg │ │ └── watch-icon.svg │ └── stylesheets │ │ ├── _env-banner.scss │ │ ├── _settings-preview.scss │ │ ├── application.scss │ │ └── outpost-design-library │ │ ├── README.md │ │ ├── _alerts.scss │ │ ├── _app-switcher.scss │ │ ├── _beta-banner.scss │ │ ├── _big-list.scss │ │ ├── _big-numbers.scss │ │ ├── _breadcrumbs.scss │ │ ├── _buttons.scss │ │ ├── _choices.scss │ │ ├── _collapsibles.scss │ │ ├── _confirmation.scss │ │ ├── _errors.scss │ │ ├── _feedback.scss │ │ ├── _filters.scss │ │ ├── _footer.scss │ │ ├── _forms.scss │ │ ├── _globals.scss │ │ ├── _go-back.scss │ │ ├── _header.scss │ │ ├── _help-tips.scss │ │ ├── _layout.scss │ │ ├── _maps.scss │ │ ├── _mini-search.scss │ │ ├── _mixins.scss │ │ ├── _nav.scss │ │ ├── _notes.scss │ │ ├── _notices.scss │ │ ├── _page-header.scss │ │ ├── _pagination.scss │ │ ├── _poppables.scss │ │ ├── _radios.scss │ │ ├── _read-only-field.scss │ │ ├── _repeaters.scss │ │ ├── _shortcut-nav.scss │ │ ├── _snapshots.scss │ │ ├── _stepper.scss │ │ ├── _tables.scss │ │ ├── _tabs.scss │ │ ├── _tagify.scss │ │ ├── _tags.scss │ │ ├── _task-list.scss │ │ ├── _taxonomy-tree.scss │ │ ├── _todo.scss │ │ ├── _user-circles.scss │ │ ├── _vars.scss │ │ ├── _wysiwyg.scss │ │ ├── package-lock.json │ │ ├── package.json │ │ └── vendor │ │ ├── choices.css │ │ ├── diff.css │ │ ├── tagify.css │ │ ├── tippy.css │ │ └── trix.css ├── controllers │ ├── admin │ │ ├── accessibilities_controller.rb │ │ ├── activity_controller.rb │ │ ├── archive_controller.rb │ │ ├── base_controller.rb │ │ ├── custom_field_sections_controller.rb │ │ ├── dashboard_controller.rb │ │ ├── feedbacks_controller.rb │ │ ├── labels_controller.rb │ │ ├── locations_controller.rb │ │ ├── notes_controller.rb │ │ ├── ofsted_controller.rb │ │ ├── organisations_controller.rb │ │ ├── requests_controller.rb │ │ ├── send_needs_controller.rb │ │ ├── services_controller.rb │ │ ├── settings_controller.rb │ │ ├── suitabilities_controller.rb │ │ ├── taxonomies_controller.rb │ │ ├── tools │ │ │ └── bulk_add_taxonomies_controller.rb │ │ ├── users_controller.rb │ │ ├── versions_controller.rb │ │ └── watch_controller.rb │ ├── api │ │ └── v1 │ │ │ ├── accessibilities_controller.rb │ │ │ ├── custom_fields_controller.rb │ │ │ ├── me_controller.rb │ │ │ ├── send_needs_controller.rb │ │ │ ├── services_controller.rb │ │ │ ├── suitabilities_controller.rb │ │ │ └── taxonomies_controller.rb │ ├── application_controller.rb │ ├── concerns │ │ ├── .keep │ │ └── service_preprocessing.rb │ ├── feedback_controller.rb │ ├── members_controller.rb │ ├── organisations_controller.rb │ ├── registrations_controller.rb │ └── services_controller.rb ├── helpers │ ├── activity_helper.rb │ ├── application_helper.rb │ ├── cost_options_helper.rb │ ├── feedbacks_helper.rb │ ├── ofsted_items_helper.rb │ ├── outpost_form_builder.rb │ ├── regular_schedule_helper.rb │ ├── services_helper.rb │ ├── task_list_helper.rb │ ├── taxonomies_helper.rb │ ├── users_helper.rb │ └── versions_helper.rb ├── javascript │ └── packs │ │ ├── _custom-fields.js │ │ ├── _fix-ajax-forms.js │ │ ├── application.js │ │ ├── bulk-taxonomies-actions.js │ │ ├── choices.js │ │ ├── clear-visible-from-to.js │ │ ├── collapsible.js │ │ ├── filters.js │ │ ├── google.js │ │ ├── help-tips.js │ │ ├── labels.js │ │ ├── local-offer.js │ │ ├── main.js │ │ ├── maps.js │ │ ├── open-close-all.js │ │ ├── regular-schedule.js │ │ ├── repeater.js │ │ ├── show-if-checked.js │ │ ├── snapshots.js │ │ ├── tabs.js │ │ ├── warn-unsaved-changes.js │ │ ├── word-count.js │ │ └── wysiwyg.js ├── jobs │ ├── application_job.rb │ ├── update_index_locations_job.rb │ ├── update_index_organisations_job.rb │ ├── update_index_services_job.rb │ └── update_index_taxonomies_job.rb ├── mailers │ ├── application_mailer.rb │ ├── devise_mailer.rb │ ├── service_mailer.rb │ └── user_mailer.rb ├── models │ ├── accessibility.rb │ ├── application_record.rb │ ├── concerns │ │ ├── .keep │ │ ├── mongo_index_callbacks.rb │ │ └── normalize_blank_values.rb │ ├── contact.rb │ ├── cost_option.rb │ ├── custom_field.rb │ ├── custom_field_section.rb │ ├── directory.rb │ ├── directory_service.rb │ ├── directory_taxonomy.rb │ ├── feedback.rb │ ├── file_upload.rb │ ├── form │ │ └── admin_settings.rb │ ├── link.rb │ ├── local_offer.rb │ ├── location.rb │ ├── note.rb │ ├── ofsted_item.rb │ ├── organisation.rb │ ├── planning_area.rb │ ├── regular_schedule.rb │ ├── report_postcode.rb │ ├── send_need.rb │ ├── service.rb │ ├── service_at_location.rb │ ├── service_meta.rb │ ├── service_taxonomy.rb │ ├── service_version.rb │ ├── setting.rb │ ├── suitability.rb │ ├── taxonomy.rb │ ├── user.rb │ ├── version.rb │ └── watch.rb ├── serializers │ ├── accessibility_serializer.rb │ ├── contact_serializer.rb │ ├── cost_option_serializer.rb │ ├── directory_serializer.rb │ ├── indexed_services_serializer.rb │ ├── link_serializer.rb │ ├── local_offer_serializer.rb │ ├── location_serializer.rb │ ├── organisation_serializer.rb │ ├── regular_schedule_serializer.rb │ ├── regular_schedule_service_at_location_serializer.rb │ ├── send_need_serializer.rb │ ├── service_at_location_serializer.rb │ ├── service_meta_serializer.rb │ ├── suitability_serializer.rb │ └── taxonomy_serializer.rb └── views │ ├── admin │ ├── accessibilities │ │ ├── _fields.html.erb │ │ ├── index.html.erb │ │ └── new.html.erb │ ├── activity │ │ └── index.html.erb │ ├── custom_field_sections │ │ ├── _fields.html.erb │ │ ├── _repeatable-fields.html.erb │ │ ├── index.html.erb │ │ ├── new.html.erb │ │ └── show.html.erb │ ├── dashboard │ │ ├── _recent-activity-table.html.erb │ │ ├── _watch-table.html.erb │ │ └── index.html.erb │ ├── feedbacks │ │ └── index.html.erb │ ├── labels │ │ └── index.html.erb │ ├── locations │ │ ├── _fields.html.erb │ │ ├── _filters.html.erb │ │ ├── index.html.erb │ │ └── show.html.erb │ ├── ofsted │ │ ├── _field.html.erb │ │ ├── _filters.html.erb │ │ ├── _mini-table-child-services-register.html.erb │ │ ├── _mini-table-childcare-age.html.erb │ │ ├── _mini-table-inspections.html.erb │ │ ├── _mini-table-registration-status-history.html.erb │ │ ├── _mini-table-welfare-notice-history.html.erb │ │ ├── _mini-table.html.erb │ │ ├── _notices.html.erb │ │ ├── _shortcut-nav.html.erb │ │ ├── index.html.erb │ │ ├── pending.html.erb │ │ ├── show.html.erb │ │ └── versions.html.erb │ ├── organisations │ │ ├── _fields.html.erb │ │ ├── _filters.html.erb │ │ ├── index.html.erb │ │ ├── new.html.erb │ │ ├── show.html.erb │ │ └── timetable.html.erb │ ├── requests │ │ └── index.html.erb │ ├── send_needs │ │ ├── _fields.html.erb │ │ ├── index.html.erb │ │ └── new.html.erb │ ├── services │ │ ├── _feedback.html.erb │ │ ├── _filters.html.erb │ │ ├── _list.html.erb │ │ ├── _notes.html.erb │ │ ├── _notices.html.erb │ │ ├── _permenant-deletion.html.erb │ │ ├── editors │ │ │ ├── _ages.html.erb │ │ │ ├── _basics.html.erb │ │ │ ├── _contacts-fields.html.erb │ │ │ ├── _contacts.html.erb │ │ │ ├── _cost-options-fields.html.erb │ │ │ ├── _cost-options.html.erb │ │ │ ├── _custom-fields.html.erb │ │ │ ├── _dates.html.erb │ │ │ ├── _directories.html.erb │ │ │ ├── _labels.html.erb │ │ │ ├── _links-fields.html.erb │ │ │ ├── _links.html.erb │ │ │ ├── _local-offer-fields.html.erb │ │ │ ├── _local-offer.html.erb │ │ │ ├── _location-fields.html.erb │ │ │ ├── _locations.html.erb │ │ │ ├── _regular-schedule-fields.html.erb │ │ │ ├── _regular-schedule.html.erb │ │ │ ├── _suitabilities.html.erb │ │ │ └── _taxonomies.html.erb │ │ ├── index.html.erb │ │ ├── new.html.erb │ │ └── show.html.erb │ ├── settings │ │ ├── edit.html.erb │ │ ├── editors │ │ │ ├── _application.html.erb │ │ │ ├── _features.html.erb │ │ │ └── _theming.html.erb │ │ └── show.html.erb │ ├── suitabilities │ │ ├── _fields.html.erb │ │ ├── index.html.erb │ │ └── new.html.erb │ ├── taxonomies │ │ ├── _fields.html.erb │ │ ├── index.html.erb │ │ └── show.html.erb │ ├── tools │ │ └── bulk_add_taxonomies │ │ │ └── show.html.erb │ ├── users │ │ ├── _fields.html.erb │ │ ├── _filters.html.erb │ │ ├── _labels.html.erb │ │ ├── _permanent-deletion.html.erb │ │ ├── index.html.erb │ │ ├── new.html.erb │ │ └── show.html.erb │ └── versions │ │ └── index.html.erb │ ├── devise │ ├── confirmations │ │ └── new.html.erb │ ├── mailer │ │ ├── confirmation_instructions.text.erb │ │ ├── email_changed.text.erb │ │ ├── password_change.text.erb │ │ ├── reset_password_instructions.text.erb │ │ └── unlock_instructions.text.erb │ ├── passwords │ │ ├── edit.html.erb │ │ └── new.html.erb │ ├── registrations │ │ ├── edit.html.erb │ │ └── new.html.erb │ ├── sessions │ │ └── new.html.erb │ ├── shared │ │ └── _links.html.erb │ └── unlocks │ │ └── new.html.erb │ ├── doorkeeper │ └── authorizations │ │ └── new.html.erb │ ├── feedback │ ├── create.html.erb │ └── index.html.erb │ ├── layouts │ ├── application.html.erb │ ├── doorkeeper │ │ └── application.html.erb │ ├── full-width.html.erb │ ├── mailer.text.erb │ └── printable.html.erb │ ├── members │ ├── _form.html.erb │ └── new.html.erb │ ├── organisations │ ├── _form.html.erb │ ├── edit.html.erb │ ├── index.html.erb │ └── new.html.erb │ ├── service_mailer │ ├── notify_owner_email.text.erb │ ├── notify_owner_of_feedback_email.text.erb │ └── notify_watcher_email.text.erb │ ├── services │ ├── _edit_ages.html.erb │ ├── _edit_categories.html.erb │ ├── _edit_contacts.html.erb │ ├── _edit_extra_questions.html.erb │ ├── _edit_fees.html.erb │ ├── _edit_locations.html.erb │ ├── _edit_name_and_description.html.erb │ ├── _edit_opening_times.html.erb │ ├── _edit_special_educational_needs_and_disabilities.html.erb │ ├── _edit_suitable_for.html.erb │ ├── _edit_visibility.html.erb │ ├── _edit_website_and_social_media.html.erb │ ├── _task_list_item.html.erb │ ├── confirmation.html.erb │ ├── new.html.erb │ └── show.html.erb │ ├── shared │ ├── _app-switcher.html.erb │ ├── _collapsible.html.erb │ ├── _directory-shortcuts.html.erb │ ├── _dynamic-back-link.html.erb │ ├── _env-banner.html.erb │ ├── _errors.html.erb │ ├── _footer.html.erb │ ├── _google.html.erb │ ├── _head.html.erb │ ├── _header.html.erb │ ├── _navigation.html.erb │ ├── _preview-canvas.html.erb │ ├── _services-nav.html.erb │ ├── _settings.html.erb │ ├── _shortcuts_item.erb │ ├── _taxonomies-nav.html.erb │ ├── _user-circle.html.erb │ ├── _users-nav.html.erb │ ├── _version-tree.html.erb │ ├── _watch.html.erb │ ├── editors │ │ └── _taxonomies.html.erb │ └── poppables │ │ ├── _deleted_user.html.erb │ │ ├── _organisation.html.erb │ │ ├── _service.html.erb │ │ └── _user.html.erb │ └── user_mailer │ ├── invite_from_admin_email.text.erb │ ├── invite_from_community_email.text.erb │ └── reset_instructions_email.text.erb ├── babel.config.js ├── bin ├── bundle ├── rails ├── rake ├── setup ├── spring ├── webpack ├── webpack-dev-server └── yarn ├── config.ru ├── config ├── app_config.yml ├── application.rb ├── boot.rb ├── cable.yml ├── credentials.yml.enc ├── database.yml ├── environment.rb ├── environments │ ├── development.rb │ ├── production.rb │ └── test.rb ├── initializers │ ├── active_model_serializers.rb │ ├── app_config.rb │ ├── application_controller_renderer.rb │ ├── assets.rb │ ├── backtrace_silencers.rb │ ├── content_security_policy.rb │ ├── cookies_serializer.rb │ ├── devise-security.rb │ ├── devise.rb │ ├── doorkeeper.rb │ ├── filter_parameter_logging.rb │ ├── geocoder.rb │ ├── inflections.rb │ ├── mime_types.rb │ ├── rack_attack.rb │ └── wrap_parameters.rb ├── locales │ ├── devise.en.yml │ ├── devise.security_extension.de.yml │ ├── devise.security_extension.en.yml │ ├── devise.security_extension.es.yml │ ├── devise.security_extension.fr.yml │ ├── devise.security_extension.it.yml │ ├── devise.security_extension.ja.yml │ ├── devise.security_extension.tr.yml │ ├── doorkeeper.en.yml │ └── en.yml ├── puma.rb ├── routes.rb ├── spring.rb ├── storage.yml ├── webpack │ ├── development.js │ ├── environment.js │ ├── production.js │ └── test.js └── webpacker.yml ├── db ├── _dummy-data.yml ├── migrate │ ├── 20200226163120_create_organisations.rb │ ├── 20200226170500_create_services.rb │ ├── 20200226172537_add_old_external_id_to_organisations.rb │ ├── 20200323141046_create_contacts.rb │ ├── 20200323151357_create_phones.rb │ ├── 20200402190441_devise_create_users.rb │ ├── 20200403152026_create_physical_addresses.rb │ ├── 20200403152335_create_locations.rb │ ├── 20200403160415_service_at_locations.rb │ ├── 20200403215552_add_watch_association.rb │ ├── 20200406120632_drop_physical_addresses_table.rb │ ├── 20200406120701_add_address_fields_to_locations.rb │ ├── 20200407115112_create_taxonomies.rb │ ├── 20200408220453_create_versions.rb │ ├── 20200408220530_add_object_changes_to_versions.rb │ ├── 20200415092246_add_searchable_fields_to_service_at_locations.rb │ ├── 20200416111637_add_parent_id_to_taxonomies.rb │ ├── 20200417001138_add_roles_to_users.rb │ ├── 20200417212827_associate_users_and_organisations.rb │ ├── 20200418184053_no_more_than_one_org_per_user.rb │ ├── 20200418195642_create_approval_tables.approval_engine.rb │ ├── 20200419134231_create_notes.rb │ ├── 20200419153343_add_discarded_at_to_services.rb │ ├── 20200419175240_remove_approval_tables.rb │ ├── 20200419190711_add_approved_to_services.rb │ ├── 20200422132817_add_name_fields_to_users.rb │ ├── 20200422142949_devise_add_lastseenable_user.rb │ ├── 20200424142941_add_type_to_service.rb │ ├── 20200424155112_create_edits.rb │ ├── 20200424180425_create_send_needs.rb │ ├── 20200424181255_create_accessibilities.rb │ ├── 20200424184944_add_discarded_at_to_service_at_locations.rb │ ├── 20200425100452_add_valid_to_from_fields_to_service.rb │ ├── 20200426095612_add_change_column_to_edits.rb │ ├── 20200426100239_rename_edits_to_snapshots.rb │ ├── 20200426164929_make_user_id_nullable_on_snapshots.rb │ ├── 20200428134029_add_google_place_id_column_to_location.rb │ ├── 20200429185209_add_counter_caches_for_organisation.rb │ ├── 20200429191415_add_notes_count_to_services.rb │ ├── 20200502142713_remove_paper_trail.rb │ ├── 20200502185553_add_discarded_at_to_users.rb │ ├── 20200504140413_add_old_external_id_to_users.rb │ ├── 20200505111134_add_ofsted_reference_number_to_services.rb │ ├── 20200505155958_add_old_ofsted_id_to_services.rb │ ├── 20200506124124_create_ofsted_items.rb │ ├── 20200507081917_add_timestamps_to_ofsted_items.rb │ ├── 20200507082550_change_ofsted_reference_number_to_be_int_in_services.rb │ ├── 20200511215418_acts_as_taggable_on_migration.acts_as_taggable_on_engine.rb │ ├── 20200511215419_add_missing_unique_indices.acts_as_taggable_on_engine.rb │ ├── 20200511215420_add_taggings_counter_cache_to_tags.acts_as_taggable_on_engine.rb │ ├── 20200511215421_add_missing_taggable_index.acts_as_taggable_on_engine.rb │ ├── 20200511215422_change_collation_for_tag_names.acts_as_taggable_on_engine.rb │ ├── 20200511215423_add_missing_indexes_on_taggings.acts_as_taggable_on_engine.rb │ ├── 20200512115614_create_feedbacks.rb │ ├── 20200512132140_add_topic_to_feedback.rb │ ├── 20200515105839_add_level_to_taxonomy.rb │ ├── 20200515111854_add_ancestry_to_taxonomies.rb │ ├── 20200515113030_remove_level_column_from_taxa.rb │ ├── 20200517003006_create_taxonomy_hierarchies.rb │ ├── 20200517003342_trash_ancestry.rb │ ├── 20200518220230_add_paper_trail_again.rb │ ├── 20200519122150_drop_send_needs.rb │ ├── 20200519150122_add_report_postcodes_table.rb │ ├── 20200519222812_add_locked_to_taxonomies.rb │ ├── 20200520172953_add_visible_to_services.rb │ ├── 20200520180028_add_order_to_taxonomies.rb │ ├── 20200520184339_services_visible_by_default.rb │ ├── 20200520200727_create_local_offers.rb │ ├── 20200523182249_create_regular_schedules.rb │ ├── 20200524194826_create_cost_options.rb │ ├── 20200524231220_add_visibility_to_contacts.rb │ ├── 20200604182621_add_admin_users_to_users.rb │ ├── 20200608220535_add_visibility_to_locations.rb │ ├── 20200608221257_contacts_and_locations_visible_by_default.rb │ ├── 20200608222006_add_referral_checkbox_to_services.rb │ ├── 20200608222250_move_emails_to_contacts.rb │ ├── 20200609192517_add_social_links_to_services.rb │ ├── 20200609193155_add_mask_field_to_location.rb │ ├── 20200610132403_add_extra_social_links_to_services.rb │ ├── 20200610132957_add_referral_url_to_services.rb │ ├── 20200610182350_add_admin_ofsted_to_users.rb │ ├── 20200612154025_clear_cache_fields_off_service_at_location.rb │ ├── 20200615135522_add_childcare_fields_to_service.rb │ ├── 20200615142458_add_marked_for_deletion_to_services.rb │ ├── 20200617112450_change_ofsted_nested_fields_to_jsonb.rb │ ├── 20200617175918_add_status_to_ofsted_items.rb │ ├── 20200618103747_change_bccn_membership_varchar_to_boolean.rb │ ├── 20200619110237_add_discarded_at_to_ofsted_items.rb │ ├── 20200619164617_add_ofsted_item_id_to_service.rb │ ├── 20200619165342_remove_type_field_from_services.rb │ ├── 20200619224151_add_phones_to_contacts.rb │ ├── 20200622175307_add_survey_questions_to_local_offer.rb │ ├── 20200623122942_rename_childrens_centre_to_family_centre_on_report_postcodes.rb │ ├── 20200624120857_add_free_to_services.rb │ ├── 20200624124100_add_open_objects_external_id_to_ofsted_items.rb │ ├── 20200626144243_age_fields_on_services.rb │ ├── 20200817155203_create_service_meta.rb │ ├── 20200817205135_create_custom_fields.rb │ ├── 20200928124150_create_links.rb │ ├── 20201001081939_create_doorkeeper_tables.rb │ ├── 20201001083411_add_foreign_keys_to_oauth_tables.rb │ ├── 20201007001447_add_flag_to_custom_fields.rb │ ├── 20201007140013_add_service_count_to_taxonomies.rb │ ├── 20201009214941_add_instructions_to_custom_field.rb │ ├── 20201012202649_add_columns_to_versions.rb │ ├── 20201013112151_create_custom_field_sections.rb │ ├── 20201013113037_add_foreign_key_to_custom_fields.rb │ ├── 20201013123405_move_public_onto_custom_field_sections.rb │ ├── 20201013160651_add_sort_to_field_sections.rb │ ├── 20201013185138_add_options_to_custom_fields.rb │ ├── 20201014094218_remove_columns_from_services.rb │ ├── 20201015153808_drop_snapshots_table.rb │ ├── 20201020113125_add_send_needs.rb │ ├── 20201029134156_update_ofsted_fields_to_jsonb.rb │ ├── 20201113131026_change_ofsted_item_reference_number_to_string.rb │ ├── 20210111111941_add_type_to_cost_options.rb │ ├── 20210111150052_add_api_visibility_to_custom_field.rb │ ├── 20210111150054_add_api_visibility_to_custom_field_sections.rb │ ├── 20210111161933_rename_type_column_on_cost_options.rb │ ├── 20210112135324_add_age_bands_to_services.rb │ ├── 20210119101711_remove_linked_registration_from_ofsted_items.rb │ ├── 20210120142200_remove_ofsted_reference_number_and_old_ofsted_external_id_from_services.rb │ ├── 20210120142303_add_old_open_objects_external_id_to_services.rb │ ├── 20210120142355_remove_certificate_condition_from_ofsted_items.rb │ ├── 20210202115527_add_postal_preference_to_locations.rb │ ├── 20210202153610_add_status_to_services.rb │ ├── 20210205161846_add_phone_to_users.rb │ ├── 20210223164623_remove_unused_ofsted_fields.rb │ ├── 20210224105438_remove_last_updated_from_ofsted_item.rb │ ├── 20210304225518_enable_trigram_search.rb │ ├── 20210305134944_mark_for_deletion_on_users.rb │ ├── 20210423163044_add_foreign_key_to_contacts.rb │ ├── 20210826091632_add_admin_manage_ofsted_access_to_users.rb │ ├── 20210901090335_create_suitabilities.rb │ ├── 20210902162335_add_directories_column_to_services.rb │ ├── 20210903151205_add_extra_text_field_for_directories.rb │ ├── 20210910115333_create_directories.rb │ ├── 20210910133315_drop_directories_field_from_services.rb │ ├── 20210910164039_create_directory_taxonomies.rb │ ├── 20210914144638_create_planning_areas.rb │ ├── 20220131165720_add_deleted_user_name_to_notes.rb │ ├── 20220620151849_create_settings.rb │ ├── 20220621162403_create_active_storage_tables.active_storage.rb │ ├── 20220623112854_create_file_upload.rb │ ├── 20221005141547_add_superadmin_to_users.rb │ ├── 20230824230543_add_foreign_key_constraint_to_active_storage_attachments_for_blob_id.active_storage.rb │ ├── 20240510133524_add_custom_fields_count_to_custom_field_sections.rb │ ├── 20240510133929_reset_all_custom_field_sections_cache_counters.rb │ ├── 20240510153947_add_service_at_location_id_to_regular_schedules.rb │ ├── 20240830111345_add_i_cal_fields_to_regular_schedules.rb │ ├── 20240918091413_add_cascade_delete_to_regular_schedules.rb │ ├── 20241111163850_add_custom_field_label.rb │ └── 20241111181710_add_service_meta_label.rb ├── schema.rb └── seeds.rb ├── docker-compose.yml ├── docs └── intro-outpost.png ├── lib ├── assets │ └── .keep └── tasks │ ├── build_public_index.rake │ ├── check_public_index.rake │ ├── data_import │ ├── custom_fields │ │ ├── README.md │ │ ├── custom-fields-sample-data.png │ │ ├── custom-fields-template--with-sample-data.csv │ │ ├── custom-fields-template.csv │ │ └── custom_fields.rake │ ├── ofsted.rake │ ├── organisations.rake │ ├── planning_area_postcodes.rake │ ├── report_postcodes.rake │ ├── services │ │ ├── README.md │ │ ├── import_services.rake │ │ ├── output_service_delimited_fields.rake │ │ ├── services--with-sample-data.csv │ │ └── services.csv │ ├── taxonomy.rake │ └── users.rake │ ├── ofsted.rake │ ├── process_permanent_deletions.rake │ ├── services │ ├── add_parent_taxonomies.rake │ └── map_ofsted_setting_addresses_to_custom_fields.rake │ ├── update_counters.rake │ └── update_public_index.rake ├── log └── .keep ├── package.json ├── postcss.config.js ├── public ├── 404.html ├── 422.html ├── 500.html ├── apple-touch-icon-precomposed.png ├── apple-touch-icon.png ├── favicon.ico └── robots.txt ├── sample.env ├── spec ├── factories │ ├── accessibility.rb │ ├── contact.rb │ ├── cost_option.rb │ ├── custom_field.rb │ ├── custom_field_section.rb │ ├── directory.rb │ ├── feedback.rb │ ├── link.rb │ ├── local_offer.rb │ ├── location.rb │ ├── note.rb │ ├── ofsted_item.rb │ ├── organisation.rb │ ├── regular_schedule.rb │ ├── send_need.rb │ ├── service.rb │ ├── service_at_location.rb │ ├── service_meta.rb │ ├── service_taxonomy.rb │ ├── service_version.rb │ ├── suitability.rb │ ├── taxonomy.rb │ ├── user.rb │ └── watch.rb ├── features │ ├── admin_managing_services_spec.rb │ ├── community_user_adding_regular_schedules_spec.rb │ ├── community_user_managing_services_spec.rb │ ├── editing_site_settings_spec.rb │ ├── filtering_services_spec.rb │ ├── managing_pending_requests_spec.rb │ ├── managing_taxonomies_spec.rb │ ├── managing_users_spec.rb │ ├── using_custom_fields_spec.rb │ ├── viewing_deleted_user_notes_spec.rb │ ├── viewing_feedback_spec.rb │ ├── viewing_ofsted_items_spec.rb │ └── viewing_service_versions_spec.rb ├── fixtures │ ├── data_import │ │ ├── custom_fields_valid.csv │ │ └── services_valid.csv │ ├── ofsted_response_added_item.json │ ├── ofsted_response_changed_name.json │ ├── ofsted_response_deleted_item.json │ └── ofsted_response_start.json ├── mailers │ └── previews │ │ ├── service_mailer_preview.rb │ │ └── user_mailer_preview.rb ├── models │ ├── accessibility_spec.rb │ ├── cost_option_spec.rb │ ├── custom_field_section_spec.rb │ ├── custom_field_spec.rb │ ├── directory_spec.rb │ ├── feedback_spec.rb │ ├── link_spec.rb │ ├── local_offer_spec.rb │ ├── organisation_spec.rb │ ├── regular_schedule_spec.rb │ ├── send_need_spec.rb │ ├── service_meta_spec.rb │ ├── service_spec.rb │ ├── taxonomy_spec.rb │ └── user_spec.rb ├── rails_helper.rb ├── requests │ ├── api │ │ ├── get_accessibilities_spec.rb │ │ ├── get_send_needs_spec.rb │ │ ├── get_suitabilities_spec.rb │ │ └── get_taxonomies_spec.rb │ └── suggesting_feedback_spec.rb ├── serializers │ ├── contact_serializer_spec.rb │ ├── cost_option_serializer_spec.rb │ ├── regular_schedule_serializer_spec.rb │ └── taxonomy_serializer_spec.rb ├── spec_helper.rb ├── support │ ├── devise.rb │ └── matchers │ │ └── appear_before.rb └── tasks │ ├── data_import │ ├── custom_fields_spec.rb │ └── services_spec.rb │ ├── ofsted_feed_synchronisation_spec.rb │ ├── process_permanent_deletions_spec.rb │ └── update_public_index_spec.rb ├── storage └── .keep ├── vendor └── .keep └── yarn.lock /.browserslistrc: -------------------------------------------------------------------------------- 1 | defaults 2 | -------------------------------------------------------------------------------- /.codecov.yml: -------------------------------------------------------------------------------- 1 | github_checks: 2 | annotations: false 3 | ignore: 4 | - bin/* 5 | - spec/* 6 | -------------------------------------------------------------------------------- /.docker/bin/check-versions.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | echo "NODE Version: $(node --version) (should be: $(node -p "require('./package.json').engines.node"))" 4 | echo "NPM Version: $(npm --version)" 5 | echo "Yarn Version: $(yarn --version) (should be: $(node -p "require('./package.json').engines.yarn"))" 6 | echo "Ruby Version: $(ruby --version) (should be: $(cat .ruby-version))" 7 | echo "Bundler Version: $(bundler --version) (should be: $(awk '/BUNDLED WITH/{getline; print}' Gemfile.lock))" 8 | -------------------------------------------------------------------------------- /.docker/bin/make-buildpacks-test-file.sh: -------------------------------------------------------------------------------- 1 | (cat app.json || echo '{}') | jq -r '.environments.test.buildpacks[].url' >.buildpacks && 2 | (test -s .buildpacks || rm .buildpacks) 3 | -------------------------------------------------------------------------------- /.docker/dev-docker-entrypoint-migrate.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # https://stackoverflow.com/a/38732187/1935918 3 | set -e 4 | 5 | if [ -f ./tmp/pids/server.pid ]; then 6 | rm ./tmp/pids/server.pid 7 | fi 8 | 9 | bin/bundle exec rake db:migrate 10 | 11 | exec bin/bundle exec "$@" 12 | -------------------------------------------------------------------------------- /.docker/dev-docker-entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | if [ -f ./tmp/pids/server.pid ]; then 5 | rm ./tmp/pids/server.pid 6 | fi 7 | 8 | exec bin/bundle exec "$@" 9 | -------------------------------------------------------------------------------- /.docker/docker-entrypoint-migrate.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # https://stackoverflow.com/a/38732187/1935918 3 | set -e 4 | 5 | /bin/herokuish procfile exec bin/bundle exec rake db:migrate 6 | 7 | # not sure this is needed on this image 8 | # if [ -f /app/tmp/pids/server.pid ]; then 9 | # rm /app/tmp/pids/server.pid 10 | # fi 11 | 12 | # put things sort of back to default 13 | # default entrypoint is /start 14 | # pass cmd to /start 15 | exec /start "$@" 16 | -------------------------------------------------------------------------------- /.docker/docker-entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # https://stackoverflow.com/a/38732187/1935918 3 | set -e 4 | 5 | # not sure this is needed on this image 6 | # if [ -f /app/tmp/pids/server.pid ]; then 7 | # rm /app/tmp/pids/server.pid 8 | # fi 9 | 10 | # put things sort of back to default 11 | # default entrypoint is /start 12 | # pass cmd to /start (commands are defined in Proc file) 13 | # set entrypoint to /exec to run custom commands 14 | exec /start "$@" 15 | -------------------------------------------------------------------------------- /.docker/services/mongo/mongo.yml: -------------------------------------------------------------------------------- 1 | version: "3.7" 2 | services: 3 | mongo: 4 | image: mongo:latest 5 | platform: linux/arm64 6 | ports: 7 | - 27018:27017 8 | volumes: 9 | - mongo-volume:/data/db 10 | - ./setup-mongodb.js:/docker-entrypoint-initdb.d/mongo-init.js:ro 11 | environment: 12 | MONGO_INITDB_ROOT_USERNAME: ${MONGO_INITDB_ROOT_USERNAME:-admin} 13 | MONGO_INITDB_ROOT_PASSWORD: ${MONGO_INITDB_ROOT_PASSWORD:-password} 14 | MONGO_INITDB_USERNAME: ${MONGO_INITDB_USERNAME:-outpost} 15 | MONGO_INITDB_PASSWORD: ${MONGO_INITDB_PASSWORD:-password} 16 | MONGO_INITDB_DATABASE: ${MONGO_INITDB_DATABASE:-outpost_api_development} 17 | networks: 18 | - internal_network 19 | 20 | volumes: 21 | mongo-volume: 22 | -------------------------------------------------------------------------------- /.docker/services/outpost-api-service/outpost-api-service.yml: -------------------------------------------------------------------------------- 1 | version: "3.7" 2 | services: 3 | outpost-api-service: 4 | image: ghcr.io/wearefuturegov/outpost-api-service:latest 5 | platform: linux/amd64 6 | environment: 7 | NODE_ENV: development 8 | FORCE_SSL: false 9 | DB_URI: mongodb://${MONGO_INITDB_ROOT_USERNAME:-outpost}:${MONGO_INITDB_ROOT_PASSWORD:-password}@mongo/${MONGO_INITDB_DATABASE:-outpost_api_development}?retryWrites=true&w=majority 10 | ports: 11 | - 3001:3001 12 | networks: 13 | - internal_network 14 | - external_network 15 | -------------------------------------------------------------------------------- /.docker/services/postgres/postgres.yml: -------------------------------------------------------------------------------- 1 | version: "3.7" 2 | services: 3 | postgres: 4 | image: postgres:13.7-alpine 5 | environment: 6 | POSTGRES_USER: ${POSTGRES_USER:-outpost} 7 | POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-password} 8 | POSTGRES_DB: ${POSTGRES_DB:-outpost_development} 9 | ports: 10 | - 5433:5432 11 | volumes: 12 | - postgres-volume:/var/lib/postgresql/data 13 | networks: 14 | - internal_network 15 | 16 | volumes: 17 | postgres-volume: 18 | -------------------------------------------------------------------------------- /.nvmrc: -------------------------------------------------------------------------------- 1 | 20.9.0 -------------------------------------------------------------------------------- /.rspec: -------------------------------------------------------------------------------- 1 | --require spec_helper 2 | -------------------------------------------------------------------------------- /.ruby-version: -------------------------------------------------------------------------------- 1 | 3.0.3 2 | -------------------------------------------------------------------------------- /.yarnrc: -------------------------------------------------------------------------------- 1 | # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. 2 | # yarn lockfile v1 3 | 4 | 5 | yarn-path ".yarn/releases/yarn-1.22.19.cjs" 6 | -------------------------------------------------------------------------------- /Procfile: -------------------------------------------------------------------------------- 1 | release: rails db:migrate 2 | web: bundle exec puma -C config/puma.rb 3 | rake: bundle exec rake 4 | console: bin/rails console 5 | migrate_web: rails db:migrate && bundle exec puma -C config/puma.rb 6 | cleanup: rm tmp/pids/server.pid -------------------------------------------------------------------------------- /Rakefile: -------------------------------------------------------------------------------- 1 | # Add your own tasks in files placed in lib/tasks ending in .rake, 2 | # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. 3 | 4 | require_relative 'config/application' 5 | 6 | Rails.application.load_tasks 7 | -------------------------------------------------------------------------------- /app/assets/config/manifest.js: -------------------------------------------------------------------------------- 1 | //= link_tree ../images 2 | //= link_directory ../stylesheets .scss 3 | 4 | //= link application.scss 5 | //= link application.css 6 | 7 | //= link filterrific/filterrific-spinner.gif -------------------------------------------------------------------------------- /app/assets/images/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wearefuturegov/outpost/fd18756b7a476f414c297333dd28640fb8875c44/app/assets/images/.keep -------------------------------------------------------------------------------- /app/assets/images/asc-active.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /app/assets/images/back.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /app/assets/images/clear.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/assets/images/cross-circle.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/assets/images/cross-stepper.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/assets/images/desc-active.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /app/assets/images/down-arrow-white.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /app/assets/images/down-arrow.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /app/assets/images/exclamation-circle.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/assets/images/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wearefuturegov/outpost/fd18756b7a476f414c297333dd28640fb8875c44/app/assets/images/favicon.ico -------------------------------------------------------------------------------- /app/assets/images/level-up-alt-solid.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/assets/images/location-icon.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /app/assets/images/organisation-icon.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /app/assets/images/outpost.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wearefuturegov/outpost/fd18756b7a476f414c297333dd28640fb8875c44/app/assets/images/outpost.png -------------------------------------------------------------------------------- /app/assets/images/pending-circle.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /app/assets/images/plus-white.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/assets/images/plus.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/assets/images/search.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/assets/images/select-down.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/assets/images/service-icon.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/assets/images/tick-black.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /app/assets/images/tick-circle.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/assets/images/tick-white.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /app/assets/images/tick.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /app/assets/images/up-arrow.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /app/assets/images/user-icon.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/assets/images/watch-icon.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/assets/stylesheets/_env-banner.scss: -------------------------------------------------------------------------------- 1 | .env-banner { 2 | text-align: center; 3 | padding: 10px; 4 | background: $focus; 5 | } 6 | -------------------------------------------------------------------------------- /app/assets/stylesheets/_settings-preview.scss: -------------------------------------------------------------------------------- 1 | .settings-logo-preview { 2 | padding: 10px; 3 | text-align: center; 4 | } -------------------------------------------------------------------------------- /app/assets/stylesheets/outpost-design-library/_alerts.scss: -------------------------------------------------------------------------------- 1 | .alert{ 2 | background: transparentize($focus, 0.9); 3 | padding: 25px; 4 | border-left: 5px solid $focus; 5 | margin-bottom: 40px; 6 | 7 | @media screen and (min-width: $breakpoint-m) { 8 | font-size: 1.1rem; 9 | } 10 | } -------------------------------------------------------------------------------- /app/assets/stylesheets/outpost-design-library/_beta-banner.scss: -------------------------------------------------------------------------------- 1 | .beta-banner{ 2 | padding: 10px 15px; 3 | font-size: 0.9rem; 4 | 5 | &__inner{ 6 | display: flex; 7 | flex-direction: row; 8 | align-items: flex-start; 9 | } 10 | 11 | &__tag{ 12 | background: $focus; 13 | color: $grey1; 14 | text-transform: uppercase; 15 | padding: 3px 7px; 16 | margin-right: 10px; 17 | } 18 | 19 | &__message{ 20 | font-size: 1rem; 21 | margin: 0; 22 | } 23 | } -------------------------------------------------------------------------------- /app/assets/stylesheets/outpost-design-library/_big-list.scss: -------------------------------------------------------------------------------- 1 | .big-list{ 2 | margin: 0px; 3 | padding: 0; 4 | 5 | &__item{ 6 | padding: 0px; 7 | margin-bottom: 10px; 8 | display: block; 9 | 10 | @media screen and (min-width: $breakpoint-m){ 11 | font-size: 1.1rem; 12 | } 13 | } 14 | } -------------------------------------------------------------------------------- /app/assets/stylesheets/outpost-design-library/_big-numbers.scss: -------------------------------------------------------------------------------- 1 | .big-numbers{ 2 | @media screen and (min-width: $breakpoint-m){ 3 | display: grid; 4 | grid-template-columns: 1fr 1fr; 5 | column-gap: 45px; 6 | } 7 | @media screen and (min-width: $breakpoint-l){ 8 | grid-template-columns: 1fr 1fr 1fr 1fr; 9 | column-gap: 85px; 10 | } 11 | } 12 | 13 | .big-number{ 14 | margin-bottom: 25px; 15 | 16 | &__number{ 17 | font-weight: bold; 18 | font-size: 2.5rem; 19 | margin-left: 0; 20 | margin-bottom: 5px; 21 | @media screen and (min-width: $breakpoint-m){ 22 | font-size: 3rem; 23 | } 24 | } 25 | &__caption{ 26 | font-size: 1.1rem; 27 | line-height: 1.5; 28 | } 29 | } -------------------------------------------------------------------------------- /app/assets/stylesheets/outpost-design-library/_confirmation.scss: -------------------------------------------------------------------------------- 1 | .confirmation-panel{ 2 | border: 3px solid $green; 3 | text-align: center; 4 | padding: 35px; 5 | @media screen and (min-width: $breakpoint-m) { 6 | padding: 45px 65px; 7 | } 8 | 9 | &__heading{ 10 | margin-top: 0px; 11 | margin-bottom: 0px; 12 | font-size: 2rem; 13 | @media screen and (min-width: $breakpoint-m) { 14 | font-size: 2.5rem; 15 | } 16 | } 17 | 18 | &__caption{ 19 | margin-top: 10px; 20 | margin-bottom: 0px; 21 | font-size: 1.7rem; 22 | } 23 | } 24 | 25 | .confirmation-body{ 26 | & *:first-child{ 27 | margin-top: 0px; 28 | } 29 | } -------------------------------------------------------------------------------- /app/assets/stylesheets/outpost-design-library/_errors.scss: -------------------------------------------------------------------------------- 1 | .error { 2 | padding: 25px; 3 | margin-bottom: 40px; 4 | background: transparentize($error, 0.9); 5 | border-left: 5px solid $error; 6 | 7 | @media screen and (min-width: $breakpoint-m) { 8 | margin-bottom: 50px; 9 | } 10 | 11 | &__title { 12 | margin-top: 0px; 13 | margin-bottom: 0px; 14 | line-height: 1.1; 15 | } 16 | 17 | &__list { 18 | list-style: none; 19 | margin-bottom: 0px; 20 | margin-top: 20px; 21 | padding-left: 0; 22 | 23 | li { 24 | padding-left: 0; 25 | margin-bottom: 10px; 26 | } 27 | * { 28 | @media screen and (min-width: $breakpoint-m) { 29 | font-size: 1.1rem; 30 | } 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /app/assets/stylesheets/outpost-design-library/_feedback.scss: -------------------------------------------------------------------------------- 1 | .feedback-list{ 2 | @media screen and (min-width: $breakpoint-m) { 3 | display: grid; 4 | grid-template-columns: 1fr 1fr; 5 | column-gap: 25px; 6 | } 7 | } 8 | 9 | .feedback-card{ 10 | background: $pale; 11 | padding: 25px; 12 | margin-bottom: 15px; 13 | @media screen and (min-width: $breakpoint-m) { 14 | margin-bottom: 25px; 15 | } 16 | 17 | &__meta{ 18 | color: $grey2; 19 | } 20 | } -------------------------------------------------------------------------------- /app/assets/stylesheets/outpost-design-library/_footer.scss: -------------------------------------------------------------------------------- 1 | .site-footer { 2 | background: $grey1; 3 | padding: 30px $outer-spacing 50px $outer-spacing; 4 | font-size: 0.85rem; 5 | 6 | @media screen and (min-width: $breakpoint-m) { 7 | padding: 30px $outer-spacing 60px $outer-spacing; 8 | } 9 | 10 | * { 11 | color: $white; 12 | font-size: 0.85rem; 13 | } 14 | 15 | a { 16 | text-decoration: underline; 17 | &:hover { 18 | text-decoration: none; 19 | } 20 | } 21 | 22 | &__menu { 23 | line-height: 2; 24 | } 25 | 26 | &__link { 27 | display: inline-block; 28 | margin-right: 15px; 29 | } 30 | 31 | &__license { 32 | margin: 40px 0px; 33 | img { 34 | display: block; 35 | margin-bottom: 10px; 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /app/assets/stylesheets/outpost-design-library/_maps.scss: -------------------------------------------------------------------------------- 1 | .map-holder{ 2 | width: 100%; 3 | min-height: 400px; 4 | } -------------------------------------------------------------------------------- /app/assets/stylesheets/outpost-design-library/_notes.scss: -------------------------------------------------------------------------------- 1 | .notes-list{ 2 | 3 | &__note{ 4 | word-break: break-word; 5 | margin-bottom: 25px; 6 | } 7 | 8 | &__note-header{ 9 | font-size: 0.9rem; 10 | color: $grey2; 11 | margin-bottom: 7px; 12 | } 13 | } -------------------------------------------------------------------------------- /app/assets/stylesheets/outpost-design-library/_page-header.scss: -------------------------------------------------------------------------------- 1 | .page-header{ 2 | padding-bottom: 20px; 3 | @media screen and (min-width: $breakpoint-m){ 4 | padding-bottom: 30px; 5 | } 6 | 7 | &__title{ 8 | margin-top: 0; 9 | font-size: 2.5rem; 10 | @media screen and (min-width: $breakpoint-m){ 11 | font-size: 3.5rem; 12 | } 13 | } 14 | 15 | &__lede{ 16 | font-size: 1.2rem; 17 | margin-bottom: 25px; 18 | @media screen and (min-width: $breakpoint-m){ 19 | font-size: 1.3rem; 20 | } 21 | } 22 | 23 | &--full-width{ 24 | padding: 30px 20px; 25 | 26 | .page-header__title{ 27 | font-size: 2.5rem; 28 | margin-bottom: 0px; 29 | } 30 | 31 | } 32 | 33 | } -------------------------------------------------------------------------------- /app/assets/stylesheets/outpost-design-library/_pagination.scss: -------------------------------------------------------------------------------- 1 | .pagination{ 2 | margin-top: 40px; 3 | display: flex; 4 | flex-direction: row; 5 | justify-content: center; 6 | 7 | span{ 8 | margin-right: 10px; 9 | 10 | @media screen and (min-width: $breakpoint-m) { 11 | font-size: 1.1rem; 12 | margin-right: 15px; 13 | } 14 | 15 | &:last-of-type{ 16 | margin-right: 0px; 17 | } 18 | } 19 | } -------------------------------------------------------------------------------- /app/assets/stylesheets/outpost-design-library/_read-only-field.scss: -------------------------------------------------------------------------------- 1 | .read-only-field{ 2 | margin-bottom: 25px; 3 | @media screen and (min-width: $breakpoint-m){ 4 | margin-bottom: 35px; 5 | } 6 | 7 | &__label{ 8 | margin: 0px; 9 | margin-bottom: 5px; 10 | color: $grey2; 11 | } 12 | 13 | &__value{ 14 | margin: 0px; 15 | font-size: 1.3rem; 16 | word-wrap: anywhere; 17 | @media screen and (min-width: $breakpoint-m){ 18 | font-size: 1.5rem; 19 | } 20 | } 21 | } -------------------------------------------------------------------------------- /app/assets/stylesheets/outpost-design-library/_tagify.scss: -------------------------------------------------------------------------------- 1 | @import "vendor/tagify"; 2 | 3 | // the flexible multiple select field used for labels 4 | 5 | .tagify{ 6 | border-color: $grey1 !important; 7 | transition: 0s !important; 8 | @include input; 9 | 10 | &:focus-within{ 11 | outline: 3px solid $focus; 12 | } 13 | 14 | .tagify--focus{ 15 | border-color: $grey1 !important; 16 | } 17 | 18 | &__input, 19 | &__tag-text{ 20 | color: $grey1; 21 | } 22 | 23 | &__tag > div::before{ 24 | box-shadow: 0 0 0 1.1em $pale inset; 25 | border-radius: 0px; 26 | } 27 | } -------------------------------------------------------------------------------- /app/assets/stylesheets/outpost-design-library/_tags.scss: -------------------------------------------------------------------------------- 1 | .tag{ 2 | display: inline-block; 3 | border: 1px solid $outpostBlue; 4 | background: transparentize($outpostBlue, 0.9); 5 | font-size: 0.8rem; 6 | padding: 5px 7px; 7 | color: $outpostBlue; 8 | border-radius: 2px; 9 | margin-right: 7px; 10 | 11 | &--yellow{ 12 | color: darken($focus, 30); 13 | border-color: darken($focus, 30); 14 | background: transparentize($focus, 0.9); 15 | } 16 | 17 | &--red{ 18 | color: $error; 19 | border-color: $error; 20 | background: transparentize($error, 0.9); 21 | } 22 | 23 | &--grey{ 24 | color: $grey2; 25 | border-color: $grey2; 26 | background: transparentize($grey2, 0.9); 27 | } 28 | } -------------------------------------------------------------------------------- /app/assets/stylesheets/outpost-design-library/_taxonomy-tree.scss: -------------------------------------------------------------------------------- 1 | .taxonomy-tree { 2 | list-style: none; 3 | margin: 20px 0px; 4 | } 5 | 6 | .panel > .taxonomy-tree { 7 | padding-left: 0px; 8 | margin-left: 0px; 9 | } 10 | -------------------------------------------------------------------------------- /app/assets/stylesheets/outpost-design-library/_user-circles.scss: -------------------------------------------------------------------------------- 1 | .user-circle{ 2 | background: $outpostBlack; 3 | height: 35px; 4 | width: 35px; 5 | border-radius: 100%; 6 | color: $white; 7 | font-weight: bold; 8 | display: inline-flex; 9 | align-items: center; 10 | justify-content: center; 11 | font-size: 0.8rem; 12 | position: relative; 13 | } -------------------------------------------------------------------------------- /app/assets/stylesheets/outpost-design-library/_wysiwyg.scss: -------------------------------------------------------------------------------- 1 | @import "vendor/trix"; 2 | 3 | trix-editor { 4 | @include input; 5 | 6 | min-height: 150px; 7 | } 8 | 9 | trix-toolbar { 10 | .trix-button-group { 11 | border: 0; 12 | } 13 | .trix-button { 14 | @include secondary-button; 15 | 16 | font-size: 0.9rem; 17 | margin-bottom: 0; 18 | padding: 6px 25px; 19 | 20 | @media screen and (min-width: $breakpoint-m) { 21 | margin-right: 5px; 22 | } 23 | 24 | &:not(:first-child) { 25 | border-left: 0; 26 | } 27 | 28 | &.trix-active { 29 | background-color: transparentize($outpostBlue, 0.8); 30 | 31 | box-shadow: 0px 4px 0px $outpostBlue; 32 | color: $white; 33 | } 34 | } 35 | 36 | .trix-button--icon::before { 37 | background-size: 40%; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /app/assets/stylesheets/outpost-design-library/package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "outpost-design-library", 3 | "version": "1.0.7", 4 | "lockfileVersion": 1 5 | } 6 | -------------------------------------------------------------------------------- /app/assets/stylesheets/outpost-design-library/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@outpost-platform/outpost-design-library", 3 | "version": "1.0.11", 4 | "author": "TPXimpact (https://tpximpact.com)", 5 | "description": "A simple sass library for Outpost", 6 | "keywords": [ 7 | "sass", 8 | "design system", 9 | "style guide" 10 | ], 11 | "repository": { 12 | "type": "git", 13 | "url": "git+https://github.com/wearefuturegov/outpost.git" 14 | }, 15 | "homepage": "https://outpost-platform.wearefuturegov.com/" 16 | } 17 | -------------------------------------------------------------------------------- /app/controllers/admin/activity_controller.rb: -------------------------------------------------------------------------------- 1 | class Admin::ActivityController < Admin::BaseController 2 | def index 3 | @activities = Version.includes(:item, user: :watches).order("created_at DESC").page(params[:page]) 4 | @activities = @activities.where(whodunnit: params[:user]) if params[:user] 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /app/controllers/admin/archive_controller.rb: -------------------------------------------------------------------------------- 1 | class Admin::ArchiveController < Admin::BaseController 2 | def update 3 | @service = Service.find(params[:id]) 4 | @service.restore 5 | redirect_to request.referer, notice: "Service has been restored." 6 | end 7 | end -------------------------------------------------------------------------------- /app/controllers/admin/dashboard_controller.rb: -------------------------------------------------------------------------------- 1 | class Admin::DashboardController < Admin::BaseController 2 | 3 | def index 4 | @watches = current_user.watches.includes(:service) 5 | @activities = Version.includes(:item, user: :watches).order(created_at: :desc).limit(5) 6 | 7 | @service_count = Service.count 8 | @user_count = User.count 9 | @org_count = Organisation.count 10 | @taxa_count = Taxonomy.count 11 | end 12 | 13 | end 14 | -------------------------------------------------------------------------------- /app/controllers/admin/feedbacks_controller.rb: -------------------------------------------------------------------------------- 1 | class Admin::FeedbacksController < Admin::BaseController 2 | def index 3 | @feedbacks = Feedback.order(created_at: :desc).includes(:service).page(params[:page]) 4 | end 5 | end -------------------------------------------------------------------------------- /app/controllers/admin/labels_controller.rb: -------------------------------------------------------------------------------- 1 | class Admin::LabelsController < Admin::BaseController 2 | def index 3 | @labels = ActsAsTaggableOn::Tag.order(:name) 4 | end 5 | 6 | def destroy 7 | @label = ActsAsTaggableOn::Tag.find(params[:id]) 8 | @label.destroy 9 | redirect_to admin_labels_path, notice: "That label has been removed." 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /app/controllers/admin/notes_controller.rb: -------------------------------------------------------------------------------- 1 | class Admin::NotesController < Admin::BaseController 2 | before_action :set_service 3 | 4 | def create 5 | @note = @service.notes.new(note_params) 6 | @note.user = current_user 7 | if @note.save 8 | redirect_to admin_service_path(@service) 9 | end 10 | end 11 | 12 | def destroy 13 | @note = current_user.notes.find(params[:id]).destroy 14 | redirect_to admin_service_path(@service) 15 | end 16 | 17 | private 18 | 19 | def set_service 20 | @service = Service.find(params[:service_id]) 21 | end 22 | 23 | def note_params 24 | params.require(:note).permit( 25 | :body 26 | ) 27 | end 28 | end -------------------------------------------------------------------------------- /app/controllers/admin/settings_controller.rb: -------------------------------------------------------------------------------- 1 | class Admin::SettingsController < Admin::BaseController 2 | before_action :require_superadmin! 3 | 4 | def show 5 | # redirect_to edit_admin_settings_path() 6 | end 7 | 8 | def edit 9 | @admin_settings = Form::AdminSettings.new 10 | end 11 | 12 | def update 13 | @admin_settings = Form::AdminSettings.new(setting_params) 14 | 15 | if @admin_settings.save 16 | redirect_to edit_admin_settings_path(@admin_settings), notice: "Settings have been saved." 17 | else 18 | render :edit 19 | end 20 | end 21 | 22 | private 23 | 24 | def setting_params 25 | params.require(:form_admin_settings).permit(*Form::AdminSettings::KEYS) 26 | end 27 | 28 | end 29 | -------------------------------------------------------------------------------- /app/controllers/admin/versions_controller.rb: -------------------------------------------------------------------------------- 1 | class Admin::VersionsController < Admin::BaseController 2 | def index 3 | @service = Service.find(params[:service_id]) 4 | @versions = @service.versions.includes(:user) 5 | render :layout => "full-width" 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /app/controllers/admin/watch_controller.rb: -------------------------------------------------------------------------------- 1 | class Admin::WatchController < Admin::BaseController 2 | def create 3 | current_user.watches.create(service_id: params[:service_id]) 4 | current_user.save 5 | redirect_to admin_service_path(params[:service_id]) 6 | end 7 | 8 | def destroy 9 | current_user.watches.find_by(service_id: params[:id]).destroy 10 | redirect_to admin_service_path 11 | end 12 | end -------------------------------------------------------------------------------- /app/controllers/api/v1/accessibilities_controller.rb: -------------------------------------------------------------------------------- 1 | class API::V1::AccessibilitiesController < ApplicationController 2 | skip_before_action :authenticate_user! 3 | 4 | def index 5 | render json: json_tree(Accessibility.all.order(:name)).to_json 6 | end 7 | 8 | private 9 | 10 | def json_tree(accessibilities) 11 | accessibilities.map do |a| 12 | { 13 | id: a.id, 14 | label: a.name, 15 | slug: a.slug 16 | } 17 | end 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /app/controllers/api/v1/me_controller.rb: -------------------------------------------------------------------------------- 1 | class API::V1::MeController < ApplicationController 2 | skip_before_action :authenticate_user! 3 | before_action :doorkeeper_authorize! 4 | 5 | def show 6 | render json: User.find(doorkeeper_token.resource_owner_id) 7 | .as_json(include: [ 8 | organisation: { 9 | only: [:id, :name], 10 | include: [ 11 | services: {only: [:id, :name]} 12 | ] 13 | } 14 | ]) 15 | end 16 | end -------------------------------------------------------------------------------- /app/controllers/api/v1/send_needs_controller.rb: -------------------------------------------------------------------------------- 1 | class API::V1::SendNeedsController < ApplicationController 2 | skip_before_action :authenticate_user! 3 | 4 | def index 5 | render json: json_tree(SendNeed.all.order(:name)).to_json 6 | end 7 | 8 | private 9 | 10 | def json_tree(send_needs) 11 | send_needs.map do |sn| 12 | { 13 | id: sn.id, 14 | label: sn.name, 15 | slug: sn.slug 16 | } 17 | end 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /app/controllers/api/v1/suitabilities_controller.rb: -------------------------------------------------------------------------------- 1 | class API::V1::SuitabilitiesController < ApplicationController 2 | skip_before_action :authenticate_user! 3 | 4 | def index 5 | render json: json_tree(Suitability.all.order(:name)).to_json 6 | end 7 | 8 | private 9 | 10 | def json_tree(suitabilities) 11 | suitabilities.map do |s| 12 | { 13 | id: s.id, 14 | label: s.name, 15 | slug: s.slug 16 | } 17 | end 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /app/controllers/concerns/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wearefuturegov/outpost/fd18756b7a476f414c297333dd28640fb8875c44/app/controllers/concerns/.keep -------------------------------------------------------------------------------- /app/controllers/feedback_controller.rb: -------------------------------------------------------------------------------- 1 | class FeedbackController < ApplicationController 2 | skip_before_action :authenticate_user! 3 | before_action :set_service 4 | before_action :redirect_if_admin! 5 | 6 | def index 7 | @feedback = @service.feedbacks.new 8 | end 9 | 10 | def create 11 | @feedback = @service.feedbacks.build(feedback_params) 12 | if @feedback.save 13 | render "create" 14 | else 15 | render "index" 16 | end 17 | end 18 | 19 | private 20 | 21 | def set_service 22 | @service = Service.find(params[:service_id]) 23 | end 24 | 25 | def redirect_if_admin! 26 | redirect_to admin_service_path(@service) if current_user&.admin? 27 | end 28 | 29 | def feedback_params 30 | params.require(:feedback).permit( 31 | :body, 32 | :topic 33 | ) 34 | end 35 | end 36 | -------------------------------------------------------------------------------- /app/controllers/registrations_controller.rb: -------------------------------------------------------------------------------- 1 | class RegistrationsController < Devise::RegistrationsController 2 | 3 | private 4 | 5 | def sign_up_params 6 | params.require(:user).permit(:first_name, :last_name, :email, :phone, :password, :password_confirmation) 7 | end 8 | 9 | def account_update_params 10 | params.require(:user).permit(:first_name, :last_name, :email, :phone, :password, :password_confirmation, :current_password) 11 | end 12 | end -------------------------------------------------------------------------------- /app/helpers/activity_helper.rb: -------------------------------------------------------------------------------- 1 | module ActivityHelper 2 | 3 | def ofsted_item_link(id) 4 | if item = OfstedItem.find_by(id: id) 5 | link_to item.display_name, admin_ofsted_path(item) 6 | else 7 | "Not found" 8 | end 9 | end 10 | 11 | 12 | end -------------------------------------------------------------------------------- /app/helpers/cost_options_helper.rb: -------------------------------------------------------------------------------- 1 | module CostOptionsHelper 2 | 3 | def cost_option_types 4 | [ 5 | "per day", 6 | "per half day", 7 | "per hour", 8 | "per hour - after school", 9 | "per hour - before school", 10 | "per hour - before or after school", 11 | "per hour - full time", 12 | "per hour - part time", 13 | "per hour - weekend", 14 | "per meal", 15 | "per month", 16 | "per session", 17 | "per term", 18 | "per week", 19 | "lower rate for second sibling" 20 | ] 21 | 22 | end 23 | 24 | end -------------------------------------------------------------------------------- /app/helpers/ofsted_items_helper.rb: -------------------------------------------------------------------------------- 1 | module OfstedItemsHelper 2 | 3 | def format_if_date date_string 4 | begin 5 | date = date_string&.to_date 6 | return date&.strftime('%d/%m/%Y') 7 | rescue ArgumentError 8 | return date_string 9 | end 10 | end 11 | 12 | end -------------------------------------------------------------------------------- /app/helpers/outpost_form_builder.rb: -------------------------------------------------------------------------------- 1 | class OutpostFormBuilder < ActionView::Helpers::FormBuilder 2 | def text_area_wysiwyg(method, options = {}) 3 | options[:class] = [options[:class], 'wysiwyg-simple'].compact.join(' ') if Setting.feature_wysiwyg 4 | @template.text_area( 5 | @object_name, method, objectify_options(options) 6 | ) 7 | end 8 | end -------------------------------------------------------------------------------- /app/helpers/regular_schedule_helper.rb: -------------------------------------------------------------------------------- 1 | module RegularScheduleHelper 2 | 3 | def pretty_weekday(s) 4 | weekdays.select{ |w| w[:value] === s["weekday"]}.last[:label] 5 | end 6 | 7 | end -------------------------------------------------------------------------------- /app/helpers/services_helper.rb: -------------------------------------------------------------------------------- 1 | module ServicesHelper 2 | 3 | def mark_unapproved_field(attribute) 4 | if @service.unapproved_changes?(attribute) && current_user.admin? 5 | "field--changed" 6 | end 7 | end 8 | 9 | def mark_unapproved_local_offer 10 | if @service.unapproved_changes?("local_offer") && current_user.admin? 11 | content_tag(:div, class: "changed") do 12 | yield 13 | end 14 | else 15 | content_tag(:div) do 16 | yield 17 | end 18 | end 19 | end 20 | 21 | def mark_unapproved_array(attribute) 22 | if @service.unapproved_changes?(attribute) && current_user.admin? 23 | content_tag(:div, class: "changed") do 24 | yield 25 | end 26 | else 27 | content_tag(:div) do 28 | yield 29 | end 30 | end 31 | end 32 | end -------------------------------------------------------------------------------- /app/helpers/users_helper.rb: -------------------------------------------------------------------------------- 1 | module UsersHelper 2 | 3 | def last_seen_helper(value) 4 | if value 5 | [time_ago_in_words(value).humanize, "ago"].join(" ") 6 | else 7 | "Never" 8 | end 9 | end 10 | 11 | end -------------------------------------------------------------------------------- /app/javascript/packs/_custom-fields.js: -------------------------------------------------------------------------------- 1 | let panels = document.querySelectorAll("[data-custom-fields]") 2 | 3 | panels.forEach(panel => { 4 | 5 | 6 | let type = panel.querySelector("[data-type]") 7 | let options = panel.querySelector("[data-options]") 8 | 9 | 10 | if(type.value === "select"){ 11 | options.removeAttribute("hidden") 12 | } else { 13 | options.setAttribute("hidden", "true") 14 | } 15 | 16 | type.addEventListener("change", e => { 17 | if(type.value === "select"){ 18 | options.removeAttribute("hidden") 19 | } else { 20 | options.setAttribute("hidden", "true") 21 | } 22 | }) 23 | 24 | }) -------------------------------------------------------------------------------- /app/javascript/packs/_fix-ajax-forms.js: -------------------------------------------------------------------------------- 1 | // https://github.com/turbolinks/turbolinks/issues/85#issuecomment-338784510 2 | 3 | document.addEventListener("ajax:complete", event => { 4 | 5 | let xhr = event.detail[0] 6 | 7 | if ((xhr.getResponseHeader("Content-Type") || "").substring(0, 9) === "text/html") { 8 | let referrer = window.location.href 9 | 10 | let snapshot = Turbolinks.Snapshot.wrap(xhr.response) 11 | Turbolinks.controller.cache.put(referrer, snapshot) 12 | Turbolinks.visit(referrer, { action: 'restore' }) 13 | } 14 | 15 | }, false) -------------------------------------------------------------------------------- /app/javascript/packs/application.js: -------------------------------------------------------------------------------- 1 | // This file is automatically compiled by Webpack, along with any other files 2 | // present in this directory. You're encouraged to place your actual application logic in 3 | // a relevant structure within app/javascript and only use these pack files to reference 4 | // that code so it'll be compiled. 5 | 6 | require("@rails/ujs").start() 7 | require("turbolinks").start() 8 | 9 | // require("@rails/activestorage").start() 10 | // require("channels") 11 | 12 | // Uncomment to copy all static images under ../images to the output folder and reference 13 | // them with the image_pack_tag helper in views (e.g <%= image_pack_tag 'rails.png' %>) 14 | // or the `imagePath` JavaScript helper below. 15 | // 16 | // const images = require.context('../images', true) 17 | // const imagePath = (name) => images(name, true) -------------------------------------------------------------------------------- /app/javascript/packs/bulk-taxonomies-actions.js: -------------------------------------------------------------------------------- 1 | document.querySelectorAll("[data-taxonomies-select-all") 2 | .forEach(button => button.addEventListener("click", () => { 3 | button.parentElement 4 | .querySelectorAll("input[type='checkbox']") 5 | .forEach(checkbox => checkbox.checked = true) 6 | })) 7 | 8 | document.querySelectorAll("[data-taxonomies-deselect-all") 9 | .forEach(button => button.addEventListener("click", () => { 10 | button.parentElement 11 | .querySelectorAll("input[type='checkbox']") 12 | .forEach(checkbox => checkbox.checked = false) 13 | })) -------------------------------------------------------------------------------- /app/javascript/packs/choices.js: -------------------------------------------------------------------------------- 1 | import Choices from "choices.js" 2 | 3 | let inputs = document.querySelectorAll("[data-choices]") 4 | 5 | inputs.forEach(input => { 6 | let choices = new Choices(input) 7 | }) -------------------------------------------------------------------------------- /app/javascript/packs/clear-visible-from-to.js: -------------------------------------------------------------------------------- 1 | const clearVisibleFromToBtn = document.querySelector( 2 | "[data-clear-visible-from-to]" 3 | ); 4 | 5 | if (clearVisibleFromToBtn) { 6 | clearVisibleFromToBtn.addEventListener("click", function () { 7 | document.querySelector('input[name="service[visible_from]"]').value = ""; 8 | document.querySelector('input[name="service[visible_to]"]').value = ""; 9 | }); 10 | } 11 | -------------------------------------------------------------------------------- /app/javascript/packs/filters.js: -------------------------------------------------------------------------------- 1 | let allFilters = document.querySelectorAll("[data-autosubmit]") 2 | 3 | allFilters.forEach(filter => { 4 | filter.addEventListener("change", () => { 5 | console.log(filter) 6 | filter.form.submit() 7 | }) 8 | }) -------------------------------------------------------------------------------- /app/javascript/packs/google.js: -------------------------------------------------------------------------------- 1 | const GOOGLE_CLIENT_KEY = GOOGLE_CLIENT_KEY ?? ""; 2 | export const googleLoaderOptions = { 3 | apiKey: process.env.GOOGLE_CLIENT_KEY || GOOGLE_CLIENT_KEY || "", 4 | version: "weekly", 5 | }; 6 | -------------------------------------------------------------------------------- /app/javascript/packs/help-tips.js: -------------------------------------------------------------------------------- 1 | import tippy from "tippy.js" 2 | 3 | tippy("[data-tippy-content]") -------------------------------------------------------------------------------- /app/javascript/packs/labels.js: -------------------------------------------------------------------------------- 1 | import "@yaireo/tagify/dist/tagify.polyfills.min.js" 2 | import Tagify from "@yaireo/tagify" 3 | 4 | let inputs = document.querySelectorAll("[data-labels=true]") 5 | 6 | if(inputs){ 7 | inputs.forEach(input => { 8 | if(window.__LABELS__){ 9 | new Tagify(input , { 10 | whitelist: window.__LABELS__.map(label => label.name), 11 | originalInputValueFormat: valuesArr => valuesArr.map(item => item.value).join(',') 12 | }) 13 | } else { 14 | new Tagify(input , { 15 | originalInputValueFormat: valuesArr => valuesArr.map(item => item.value).join(',') 16 | }) 17 | } 18 | }) 19 | } -------------------------------------------------------------------------------- /app/javascript/packs/show-if-checked.js: -------------------------------------------------------------------------------- 1 | const trigger = document.querySelector("[data-show-if-checked-trigger]") 2 | const deTrigger = document.querySelector("[data-hide-if-checked-trigger]") 3 | const result = document.querySelector("[data-show-if-checked-result]") 4 | 5 | if(trigger && deTrigger && result){ 6 | if(!trigger.checked) result.setAttribute("hidden", "true") 7 | 8 | trigger.addEventListener("change", e => { 9 | if(e.target.checked) result.removeAttribute("hidden") 10 | }) 11 | 12 | deTrigger.addEventListener("change", e => { 13 | if(e.target.checked) result.setAttribute("hidden", "true") 14 | }) 15 | 16 | } -------------------------------------------------------------------------------- /app/javascript/packs/snapshots.js: -------------------------------------------------------------------------------- 1 | let snapshots = document.querySelector(".snapshots") 2 | 3 | if(snapshots){ 4 | let controls = snapshots.querySelectorAll(".snapshots-tree__snapshot") 5 | let panels = snapshots.querySelectorAll(".snapshot-preview") 6 | 7 | controls.forEach((control, i) => control.addEventListener("click", e => { 8 | e.preventDefault() 9 | 10 | controls.forEach(c => c.removeAttribute("aria-selected")) 11 | panels.forEach(p => p.setAttribute("hidden", "true")) 12 | 13 | control.setAttribute("aria-selected", "true") 14 | panels[i].removeAttribute("hidden") 15 | })) 16 | } 17 | 18 | -------------------------------------------------------------------------------- /app/jobs/application_job.rb: -------------------------------------------------------------------------------- 1 | class ApplicationJob < ActiveJob::Base 2 | # Automatically retry jobs that encountered a deadlock 3 | # retry_on ActiveRecord::Deadlocked 4 | 5 | # Most jobs are safe to ignore if the underlying records are no longer available 6 | # discard_on ActiveJob::DeserializationError 7 | end 8 | -------------------------------------------------------------------------------- /app/jobs/update_index_locations_job.rb: -------------------------------------------------------------------------------- 1 | class UpdateIndexLocationsJob < ApplicationJob 2 | queue_as :default 3 | 4 | def perform(location) 5 | client = Mongo::Client.new(ENV["DB_URI"] || 'mongodb://root:password@localhost:27017/outpost_development?authSource=admin', { 6 | retry_writes: false 7 | }) 8 | collection = client.database[:indexed_services] 9 | query = collection.find({ "locations.id": { "$eq": location.id } }, { id: 1 }) 10 | services = Service.find(query.map { |d| d['id'] }) 11 | services.each {|s| s.update_this_service_in_index } 12 | client.close 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /app/jobs/update_index_organisations_job.rb: -------------------------------------------------------------------------------- 1 | class UpdateIndexOrganisationsJob < ApplicationJob 2 | queue_as :default 3 | 4 | def perform(organisation) 5 | client = Mongo::Client.new(ENV["DB_URI"] || 'mongodb://root:password@localhost:27017/outpost_development?authSource=admin', { 6 | retry_writes: false 7 | }) 8 | collection = client.database[:indexed_services] 9 | query = collection.find({ "organisation.id": { "$eq": organisation.id } }, { id: 1 }) 10 | services = Service.find(query.map { |d| d['id'] }) 11 | services.each {|s| s.update_this_service_in_index } 12 | client.close 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /app/jobs/update_index_services_job.rb: -------------------------------------------------------------------------------- 1 | class UpdateIndexServicesJob < ApplicationJob 2 | queue_as :default 3 | 4 | def perform(service) 5 | service.update_this_service_in_index 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /app/jobs/update_index_taxonomies_job.rb: -------------------------------------------------------------------------------- 1 | class UpdateIndexTaxonomiesJob < ApplicationJob 2 | queue_as :default 3 | 4 | def perform(taxon) 5 | client = Mongo::Client.new(ENV["DB_URI"] || 'mongodb://127.0.0.1:27017/outpost_development', { 6 | retry_writes: false 7 | }) 8 | collection = client.database[:indexed_services] 9 | query = collection.find({ "taxonomies.id": { "$eq": taxon.id } }, { id: 1 }) 10 | services = Service.find(query.map { |d| d['id'] }) 11 | services.each {|s| s.update_this_service_in_index } 12 | client.close 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /app/mailers/application_mailer.rb: -------------------------------------------------------------------------------- 1 | class ApplicationMailer < Mail::Notify::Mailer 2 | # default from: ENV["MAILER_FROM"] || 'CHANGEME@CHANGEME.com' 3 | # layout 'mailer' 4 | end 5 | -------------------------------------------------------------------------------- /app/mailers/devise_mailer.rb: -------------------------------------------------------------------------------- 1 | class DeviseMailer < Devise::Mailer 2 | def devise_mail(record, action, opts = {}, &block) 3 | initialize_from_record(record) 4 | view_mail(ENV['NOTIFY_TEMPLATE_ID'], headers_for(action, opts)) 5 | end 6 | end -------------------------------------------------------------------------------- /app/models/application_record.rb: -------------------------------------------------------------------------------- 1 | class ApplicationRecord < ActiveRecord::Base 2 | self.abstract_class = true 3 | 4 | def self.from_hash(hash) 5 | h = hash.dup 6 | h.each do |key, value| 7 | case value.class.to_s 8 | when 'Array' 9 | next if key == "directories" # Ignore old array column 'directories' as not using this anymore and may cause errors 10 | next unless Object.const_defined?(key.camelize.singularize) 11 | h[key].map! { |e| 12 | Object.const_get(key.camelize.singularize).from_hash e } 13 | when 'Hash' 14 | next unless Object.const_defined?(key.camelize) 15 | h[key] = Object.const_get(key.camelize).from_hash value 16 | end 17 | end 18 | self.new h.except(*(h.keys - self.attribute_names)) 19 | end 20 | end 21 | -------------------------------------------------------------------------------- /app/models/concerns/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wearefuturegov/outpost/fd18756b7a476f414c297333dd28640fb8875c44/app/models/concerns/.keep -------------------------------------------------------------------------------- /app/models/concerns/normalize_blank_values.rb: -------------------------------------------------------------------------------- 1 | module NormalizeBlankValues 2 | extend ActiveSupport::Concern 3 | 4 | included do 5 | before_save :normalize_blank_values 6 | end 7 | 8 | def normalize_blank_values 9 | attributes.each do |column,_| 10 | self[column] = nil unless self[column].present? 11 | end 12 | end 13 | end -------------------------------------------------------------------------------- /app/models/contact.rb: -------------------------------------------------------------------------------- 1 | class Contact < ApplicationRecord 2 | belongs_to :service 3 | 4 | validate :validate_not_blank 5 | 6 | def validate_not_blank 7 | if name.blank? && email.blank? && phone.blank? 8 | errors.add(:base, :missing_contact_details) 9 | end 10 | end 11 | end -------------------------------------------------------------------------------- /app/models/cost_option.rb: -------------------------------------------------------------------------------- 1 | # Represents the fees for a service 2 | class CostOption < ApplicationRecord 3 | belongs_to :service 4 | 5 | validates_presence_of :amount 6 | 7 | include ActionView::Helpers::NumberHelper 8 | 9 | def amount 10 | number_with_precision(self[:amount], precision: 2) 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /app/models/custom_field.rb: -------------------------------------------------------------------------------- 1 | class CustomField < ApplicationRecord 2 | before_validation :slugify_key 3 | 4 | validates :key, uniqueness: { allow_blank: true }, format: { with: /\A[a-z0-9\-]+\z/, message: "must be lowercase, numbers, and dashes only", allow_blank: true } 5 | validates :label, presence: true, uniqueness: true 6 | validates_presence_of :field_type 7 | belongs_to :custom_field_section, counter_cache: :custom_fields_count 8 | 9 | def self.types 10 | [ 11 | "Text", 12 | "Number", 13 | "Checkbox", 14 | "Select", 15 | "Date" 16 | ] 17 | end 18 | 19 | private 20 | 21 | def slugify_key 22 | self.key = key.to_s.parameterize if key.present? 23 | end 24 | 25 | 26 | end 27 | -------------------------------------------------------------------------------- /app/models/custom_field_section.rb: -------------------------------------------------------------------------------- 1 | class CustomFieldSection < ApplicationRecord 2 | validates :name, presence: true, uniqueness: true 3 | 4 | has_many :custom_fields, -> { order(created_at: :asc) } 5 | accepts_nested_attributes_for :custom_fields, allow_destroy: true, reject_if: :all_blank 6 | 7 | default_scope { order(sort_order: :asc) } 8 | 9 | scope :visible_to, -> (current_user){ current_user.admin ? all : where(public: true) } 10 | 11 | scope :api_public, -> { where(api_public: true) } 12 | end 13 | -------------------------------------------------------------------------------- /app/models/directory.rb: -------------------------------------------------------------------------------- 1 | class Directory < ApplicationRecord 2 | has_and_belongs_to_many :services, -> { distinct } 3 | has_and_belongs_to_many :taxonomies, -> { distinct } 4 | validates_presence_of :name, :label 5 | validates_uniqueness_of :name, :label 6 | end 7 | -------------------------------------------------------------------------------- /app/models/directory_service.rb: -------------------------------------------------------------------------------- 1 | class DirectoryService < ApplicationRecord 2 | belongs_to :service 3 | belongs_to :directory 4 | end -------------------------------------------------------------------------------- /app/models/directory_taxonomy.rb: -------------------------------------------------------------------------------- 1 | class DirectoryTaxonomy < ApplicationRecord 2 | belongs_to :taxonomy 3 | belongs_to :directory 4 | end -------------------------------------------------------------------------------- /app/models/feedback.rb: -------------------------------------------------------------------------------- 1 | class Feedback < ApplicationRecord 2 | belongs_to :service 3 | 4 | validates_presence_of :topic 5 | validates_presence_of :body 6 | 7 | after_save :notify_owners 8 | 9 | paginates_per 20 10 | 11 | def notify_owners 12 | self.service.organisation.users.kept.each do |user| 13 | ServiceMailer.with(feedback: self, service: self.service, user: user).notify_owner_of_feedback_email.deliver_later 14 | end 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /app/models/file_upload.rb: -------------------------------------------------------------------------------- 1 | class FileUpload < ApplicationRecord 2 | has_one_attached :file 3 | 4 | validates :var, presence: true, uniqueness: true 5 | 6 | end 7 | -------------------------------------------------------------------------------- /app/models/link.rb: -------------------------------------------------------------------------------- 1 | class Link < ApplicationRecord 2 | belongs_to :service 3 | validates_presence_of :label, :url 4 | validates_uniqueness_of :label, scope: :service_id, message: 'must be unique' 5 | end 6 | -------------------------------------------------------------------------------- /app/models/note.rb: -------------------------------------------------------------------------------- 1 | class Note < ApplicationRecord 2 | belongs_to :service, counter_cache: true 3 | belongs_to :user 4 | 5 | validates_presence_of :body, length: { maximum: 200 } 6 | end 7 | -------------------------------------------------------------------------------- /app/models/planning_area.rb: -------------------------------------------------------------------------------- 1 | class PlanningArea < ApplicationRecord 2 | end -------------------------------------------------------------------------------- /app/models/report_postcode.rb: -------------------------------------------------------------------------------- 1 | class ReportPostcode < ApplicationRecord 2 | end -------------------------------------------------------------------------------- /app/models/send_need.rb: -------------------------------------------------------------------------------- 1 | class SendNeed < ApplicationRecord 2 | has_and_belongs_to_many :services 3 | 4 | validates :name, presence: true, uniqueness: true 5 | 6 | paginates_per 20 7 | 8 | def display_name 9 | name.humanize 10 | end 11 | 12 | def slug 13 | name.parameterize 14 | end 15 | 16 | def self.defaults 17 | [ 18 | "Autism", 19 | "Hearing impairment", 20 | "Visual impairment", 21 | "Mobility", 22 | "Cognitive" 23 | ] 24 | end 25 | end 26 | -------------------------------------------------------------------------------- /app/models/service_at_location.rb: -------------------------------------------------------------------------------- 1 | class ServiceAtLocation < ApplicationRecord 2 | belongs_to :service 3 | belongs_to :location 4 | 5 | has_one :organisation, through: :service 6 | paginates_per 20 7 | 8 | has_many :contacts, through: :service 9 | has_many :taxonomies, through: :service 10 | has_many :regular_schedules, dependent: :destroy 11 | end -------------------------------------------------------------------------------- /app/models/service_meta.rb: -------------------------------------------------------------------------------- 1 | class ServiceMeta < ApplicationRecord 2 | belongs_to :service 3 | validates :label, presence: true 4 | validates_uniqueness_of :label, scope: :service_id 5 | end 6 | -------------------------------------------------------------------------------- /app/models/service_taxonomy.rb: -------------------------------------------------------------------------------- 1 | class ServiceTaxonomy < ApplicationRecord 2 | belongs_to :service 3 | belongs_to :taxonomy, counter_cache: :services_count 4 | end -------------------------------------------------------------------------------- /app/models/service_version.rb: -------------------------------------------------------------------------------- 1 | class ServiceVersion < Version 2 | end 3 | -------------------------------------------------------------------------------- /app/models/suitability.rb: -------------------------------------------------------------------------------- 1 | class Suitability < ApplicationRecord 2 | has_and_belongs_to_many :services 3 | 4 | validates :name, presence: true, uniqueness: true 5 | 6 | paginates_per 20 7 | 8 | def display_name 9 | name.humanize 10 | end 11 | 12 | def slug 13 | name.parameterize 14 | end 15 | 16 | def self.defaults 17 | [ 18 | "Autism", 19 | "Learning difficulties", 20 | "Mental health/acquired brain injury", 21 | "Visual and / or hearing impediment", 22 | "Physical disabilities", 23 | "Older people", 24 | "Dementia" 25 | ] 26 | end 27 | 28 | end 29 | -------------------------------------------------------------------------------- /app/models/version.rb: -------------------------------------------------------------------------------- 1 | class Version < PaperTrail::Version 2 | belongs_to :user, foreign_key: :whodunnit, optional: true 3 | end 4 | -------------------------------------------------------------------------------- /app/models/watch.rb: -------------------------------------------------------------------------------- 1 | class Watch < ApplicationRecord 2 | belongs_to :user 3 | belongs_to :service 4 | end -------------------------------------------------------------------------------- /app/serializers/accessibility_serializer.rb: -------------------------------------------------------------------------------- 1 | class AccessibilitySerializer < ActiveModel::Serializer 2 | attribute :name 3 | attributes :slug 4 | 5 | def slug 6 | object.name.parameterize 7 | end 8 | end -------------------------------------------------------------------------------- /app/serializers/contact_serializer.rb: -------------------------------------------------------------------------------- 1 | class ContactSerializer < ActiveModel::Serializer 2 | def attributes(*args) 3 | object.attributes.symbolize_keys.except(:created_at, :updated_at, :service_id, :visible) 4 | end 5 | end -------------------------------------------------------------------------------- /app/serializers/cost_option_serializer.rb: -------------------------------------------------------------------------------- 1 | class CostOptionSerializer < ActiveModel::Serializer 2 | attributes :id, :option, :amount, :cost_type 3 | end 4 | -------------------------------------------------------------------------------- /app/serializers/directory_serializer.rb: -------------------------------------------------------------------------------- 1 | class DirectorySerializer < ActiveModel::Serializer 2 | def attributes(*args) 3 | object.attributes.symbolize_keys.except(:id, :created_at, :updated_at) 4 | end 5 | end -------------------------------------------------------------------------------- /app/serializers/link_serializer.rb: -------------------------------------------------------------------------------- 1 | class LinkSerializer < ActiveModel::Serializer 2 | attribute :label 3 | attribute :url 4 | end -------------------------------------------------------------------------------- /app/serializers/local_offer_serializer.rb: -------------------------------------------------------------------------------- 1 | class LocalOfferSerializer < ActiveModel::Serializer 2 | attributes :description 3 | attributes :link 4 | attributes :survey_answers 5 | 6 | def survey_answers 7 | object.survey_answers.map { |a| { 8 | question: object.questions.find{ |q| q[:id] === a["id"] }[:text], 9 | answer: a["answer"] 10 | }} if object.survey_answers 11 | end 12 | end -------------------------------------------------------------------------------- /app/serializers/organisation_serializer.rb: -------------------------------------------------------------------------------- 1 | class OrganisationSerializer < ActiveModel::Serializer 2 | def attributes(*args) 3 | object.attributes.symbolize_keys.except(:created_at, :updated_at, :users_count, :services_count, :old_external_id) 4 | end 5 | end -------------------------------------------------------------------------------- /app/serializers/regular_schedule_serializer.rb: -------------------------------------------------------------------------------- 1 | include RegularScheduleHelper 2 | 3 | class RegularScheduleSerializer < ActiveModel::Serializer 4 | attributes :id, :weekday, :opens_at, :closes_at, :dtstart, :freq, :interval, :byday, :bymonthday, :until, :count, :description 5 | 6 | def weekday 7 | object.weekday.humanize 8 | end 9 | 10 | def opens_at 11 | object.opens_at.to_s(:time) 12 | end 13 | 14 | def closes_at 15 | object.closes_at.to_s(:time) 16 | end 17 | 18 | def dtstart 19 | object.dtstart.strftime('%Y-%m-%d').to_time.utc if object.dtstart 20 | end 21 | 22 | def until 23 | object.until.strftime('%Y-%m-%d').to_time.utc if object.until 24 | end 25 | 26 | def description 27 | object.description 28 | end 29 | 30 | 31 | end 32 | -------------------------------------------------------------------------------- /app/serializers/regular_schedule_service_at_location_serializer.rb: -------------------------------------------------------------------------------- 1 | include RegularScheduleHelper 2 | 3 | class RegularScheduleServiceAtLocationSerializer < RegularScheduleSerializer 4 | belongs_to :service_at_location, serializer: ServiceAtLocationSerializer 5 | end 6 | -------------------------------------------------------------------------------- /app/serializers/send_need_serializer.rb: -------------------------------------------------------------------------------- 1 | class SendNeedSerializer < ActiveModel::Serializer 2 | attributes :id 3 | attributes :name 4 | attributes :slug 5 | 6 | def slug 7 | object.name.parameterize 8 | end 9 | end -------------------------------------------------------------------------------- /app/serializers/service_at_location_serializer.rb: -------------------------------------------------------------------------------- 1 | 2 | class ServiceAtLocationSerializer < ActiveModel::Serializer 3 | attribute :id 4 | attribute :service_id 5 | attribute :location_id 6 | belongs_to :location, serializer: LocationSerializer 7 | has_many :regular_schedules, serializer: RegularScheduleSerializer, key: :regular_schedule 8 | # @TODO add holiday_schedule here (holidayScheduleCollection) 9 | end -------------------------------------------------------------------------------- /app/serializers/service_meta_serializer.rb: -------------------------------------------------------------------------------- 1 | 2 | class ServiceMetaSerializer < ActiveModel::Serializer 3 | attribute :label 4 | attribute :key 5 | attribute :value 6 | end -------------------------------------------------------------------------------- /app/serializers/suitability_serializer.rb: -------------------------------------------------------------------------------- 1 | class SuitabilitySerializer < ActiveModel::Serializer 2 | attributes :id 3 | attributes :name 4 | attributes :slug 5 | 6 | def slug 7 | object.name.parameterize 8 | end 9 | end -------------------------------------------------------------------------------- /app/serializers/taxonomy_serializer.rb: -------------------------------------------------------------------------------- 1 | class TaxonomySerializer < ActiveModel::Serializer 2 | attributes :id 3 | attributes :name 4 | attributes :slug 5 | attributes :parent_id 6 | 7 | def slug 8 | object.name.parameterize 9 | end 10 | end -------------------------------------------------------------------------------- /app/views/admin/accessibilities/_fields.html.erb: -------------------------------------------------------------------------------- 1 |
2 | <%= f.label :name, class: "field__label" %> 3 | <%= f.text_field :name, required: true, value: @accessibility.name, class: "field__input" %> 4 |
5 | -------------------------------------------------------------------------------- /app/views/admin/accessibilities/new.html.erb: -------------------------------------------------------------------------------- 1 | <% content_for :header do %> 2 | <%= render "shared/dynamic-back-link", text: "Back to accessibilities", path: admin_accessibilities_path %> 3 |
4 |

5 | Add new accessibility option 6 |

7 |
8 | <% end %> 9 | 10 | <%= form_for [:admin, @accessibility], html: {class: "one-half"}, data: {warn_unsaved_changes: true} do |f| %> 11 | <%= render "shared/errors", model: @accessibility %> 12 |
13 | <%= render "fields", f: f %> 14 |
15 |
16 | <%= f.submit "Create", class: "button" %> 17 |
18 | <% end %> -------------------------------------------------------------------------------- /app/views/admin/custom_field_sections/new.html.erb: -------------------------------------------------------------------------------- 1 | <% content_for :header do %> 2 | <%= render "shared/dynamic-back-link", text: "Back to custom fields", path: admin_custom_field_sections_path %> 3 |

Add a new section

4 | <% end %> 5 | 6 | <%= form_for @section, url: admin_custom_field_sections_path, html: {class: "two-thirds"}, data: {warn_unsaved_changes: true} do |f| %> 7 | <%= render "shared/errors", model: @section %> 8 | 9 | <%= render "admin/custom_field_sections/fields", f: f %> 10 | 11 |
12 | <%= f.button "Create", class: "button" %> 13 |
14 | <% end %> -------------------------------------------------------------------------------- /app/views/admin/ofsted/_field.html.erb: -------------------------------------------------------------------------------- 1 |
2 |

<%= label %>

3 |

4 | <% if value.present? %> 5 | <%= value %> 6 | <% else %> 7 | — 8 | <% end %> 9 |

10 |
-------------------------------------------------------------------------------- /app/views/admin/ofsted/_mini-table-childcare-age.html.erb: -------------------------------------------------------------------------------- 1 | <% if t.present? %> 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | <% t.each do |r| %> 11 | 12 | 13 | 14 | 15 | 16 | 17 | <% end %> 18 | 19 |
FromToMaxRegister
<%= r["AgeFrom"] %><%= r["AgeTo"] %><%= r["MaximumNumber"] %><%= @item.human_readable_register(r["Register"]) %>
20 | <% else %> 21 |

Nothing to show

22 | <% end %> -------------------------------------------------------------------------------- /app/views/admin/ofsted/_mini-table-inspections.html.erb: -------------------------------------------------------------------------------- 1 | <% if t.present? %> 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | <% t.each do |r| %> 10 | 11 | 12 | 13 | 14 | 15 | <% end %> 16 | 17 |
DateTypeJudgement
<%= format_if_date(r['InspectionDate']) %><%= r['InspectionType'] %><%= r['InspectionOverallJudgement'] %>
18 | <% else %> 19 |

Nothing to show

20 | <% end %> -------------------------------------------------------------------------------- /app/views/admin/ofsted/_mini-table-registration-status-history.html.erb: -------------------------------------------------------------------------------- 1 | <% if t.present? %> 2 | 3 | 4 | 5 | 6 | 7 | 8 | <% t.each do |r| %> 9 | 10 | 13 | 16 | 17 | <% end %> 18 | 19 |
Change dateRegistration status
11 | <%= format_if_date(r["ChangeDate"]) %> 12 | 14 | <%= @item.human_readable_registration_status(r["RegistrationStatus"]) %> 15 |
20 | <% else %> 21 |

Nothing to show

22 | <% end %> -------------------------------------------------------------------------------- /app/views/admin/ofsted/_mini-table-welfare-notice-history.html.erb: -------------------------------------------------------------------------------- 1 | <% if t.present? %> 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | <% t.each do |r| %> 10 | 11 | 12 | 13 | 14 | 15 | <% end %> 16 | 17 |
CategoryStart dateEnd date
<%= r["WelfareCategory"] %><%= format_if_date(r["WelfareStartDate"]) %><%= format_if_date(r["WelfareEndDate"]) %>
18 | <% else %> 19 |

Nothing to show

20 | <% end %> -------------------------------------------------------------------------------- /app/views/admin/ofsted/_mini-table.html.erb: -------------------------------------------------------------------------------- 1 | 2 | <% if t.present? %> 3 | 4 | 5 | <% t.first.map do |key, value| %> 6 | 7 | <% end %> 8 | 9 | 10 | <% t.each do |r| %> 11 | 12 | <% r.map do |key, value| %> 13 | 16 | <% end %> 17 | 18 | <% end %> 19 | 20 |
<%= key.humanize %>
14 | <%= format_if_date(value) %> 15 |
21 | <% else %> 22 |

Nothing to show

23 | <% end %> -------------------------------------------------------------------------------- /app/views/admin/organisations/_fields.html.erb: -------------------------------------------------------------------------------- 1 |
2 | <%= f.label :name, class: "field__label" %> 3 | <%= f.text_field :name, required: true, value: @organisation.name, class: "field__input" %> 4 |
5 | -------------------------------------------------------------------------------- /app/views/admin/organisations/new.html.erb: -------------------------------------------------------------------------------- 1 | <% content_for :header do %> 2 | <%= render "shared/dynamic-back-link", text: "Back to organisations", path: admin_organisations_path %> 3 |
4 |

5 | Add a new organisation 6 |

7 |
8 | <% end %> 9 | 10 | <%= form_for [:admin, @organisation], html: {class: "one-half"}, data: {warn_unsaved_changes: true} do |f| %> 11 | <%= render "shared/errors", model: @organisation %> 12 |
13 | <%= render "fields", f: f %> 14 |
15 |
16 | <%= f.submit "Create", class: "button" %> 17 |
18 | <% end %> -------------------------------------------------------------------------------- /app/views/admin/send_needs/_fields.html.erb: -------------------------------------------------------------------------------- 1 |
2 | <%= f.label :name, class: "field__label" %> 3 | <%= f.text_field :name, required: true, value: @send_need.name, class: "field__input" %> 4 |
5 | -------------------------------------------------------------------------------- /app/views/admin/send_needs/new.html.erb: -------------------------------------------------------------------------------- 1 | <% content_for :header do %> 2 | <%= render "shared/dynamic-back-link", text: "Back to SEND needs", path: admin_send_needs_path %> 3 |
4 |

5 | Add new SEND need 6 |

7 |
8 | <% end %> 9 | 10 | <%= form_for [:admin, @send_need], html: {class: "one-half"}, data: {warn_unsaved_changes: true} do |f| %> 11 | <%= render "shared/errors", model: @send_need %> 12 |
13 | <%= render "fields", f: f %> 14 |
15 |
16 | <%= f.submit "Create", class: "button" %> 17 |
18 | <% end %> -------------------------------------------------------------------------------- /app/views/admin/services/_permenant-deletion.html.erb: -------------------------------------------------------------------------------- 1 | <% if s.object.discarded? %> 2 |
3 |

Danger zone

4 |

Permanently deleted services will be removed after 30 days. They can't be recovered by anyone.

5 |
6 |
7 | <%= s.check_box :marked_for_deletion, {class: "checkbox__input", checked: @service.marked_for_deletion?}, Time.now %> 8 | <%= s.label :marked_for_deletion, "Mark this service for permanent deletion?", class: "checkbox__label" %> 9 |
10 |
11 |
12 | <% end %> -------------------------------------------------------------------------------- /app/views/admin/services/editors/_contacts.html.erb: -------------------------------------------------------------------------------- 1 | <%= mark_unapproved_array("contacts") do %> 2 | 3 |
4 | 5 | 12 | 13 | <%= link_to_add_fields "Add a contact", s, :contacts, "admin/services/editors/contacts-fields" %> 14 |
15 | 16 | <% end %> -------------------------------------------------------------------------------- /app/views/admin/services/editors/_directories.html.erb: -------------------------------------------------------------------------------- 1 | <% if Directory.any? %> 2 |
3 |
4 | Choose which directories this service should appear on 5 | <%= s.collection_check_boxes( :directory_ids, Directory.all, :id, :name) do |c| %> 6 |
7 | <%= c.check_box class: "checkbox__input" %> 8 | <%= c.label class: "checkbox__label" %> 9 |
10 | <% end %> 11 |
12 |
13 | <% end %> 14 | 15 | -------------------------------------------------------------------------------- /app/views/admin/services/editors/_labels.html.erb: -------------------------------------------------------------------------------- 1 |
2 | 3 |
4 | <%= s.label :label_list, "Choose or add labels to this service", class: "field__label" %> 5 | <%= s.text_field :label_list, class: "field__input", data: {labels: true}, value: @service.label_list.to_s %> 6 |
7 | 8 | 11 | 12 |
13 | -------------------------------------------------------------------------------- /app/views/admin/services/editors/_links-fields.html.erb: -------------------------------------------------------------------------------- 1 |
2 |
3 | <%= c.label :label, "Label", class: "field__label" %> 4 | <%= c.text_field :label, class: "field__input", placeholder: "eg. Facebook, Twitter", list: "link-label-options", required: true %> 5 |
6 | 7 |
8 | <%= c.label :url, "URL", class: "field__label" %> 9 | <%= c.url_field :url, class: "field__input", required: true %> 10 |
11 |
12 | 13 | <%= c.hidden_field :_destroy, data: {destroy_field: true} %> 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /app/views/admin/services/editors/_links.html.erb: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | <%= mark_unapproved_array("links") do %> 10 | 11 |
12 | 19 | <%= link_to_add_fields "Add a link", s, :links, "admin/services/editors/links-fields" %> 20 |
21 | <% end %> -------------------------------------------------------------------------------- /app/views/admin/services/editors/_local-offer.html.erb: -------------------------------------------------------------------------------- 1 | <%= mark_unapproved_local_offer do %> 2 |
3 | 4 |
5 |
6 | <%= local_offer_checkbox(s, "admin/services/editors/local-offer-fields") %> 7 | <%= label_tag "local_offer", "This service is part of the SEND local offer", class: "checkbox__label" %> 8 |
9 |
10 | 11 | <%= s.fields_for :local_offer do |l| %> 12 | <%= render "admin/services/editors/local-offer-fields", s: s, l: l %> 13 | <% end %> 14 | 15 |
16 | <% end %> -------------------------------------------------------------------------------- /app/views/admin/services/editors/_locations.html.erb: -------------------------------------------------------------------------------- 1 | <%= mark_unapproved_array("locations") do %> 2 |
3 | 10 | <%= link_to_add_fields "Add a location", s, :locations, "admin/services/editors/location-fields" %> 11 |
12 | <% end %> -------------------------------------------------------------------------------- /app/views/admin/services/editors/_suitabilities.html.erb: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | 5 |

What needs does it meet?

6 |
7 | 8 | <%= s.collection_check_boxes( :suitability_ids, Suitability.all.order(:name), :id, :display_name) do |c| %> 9 |
10 | <%= c.check_box class: "checkbox__input" %> 11 | <%= c.label class: "checkbox__label" %> 12 |
13 | <% end %> 14 |
15 |
16 |
-------------------------------------------------------------------------------- /app/views/admin/services/index.html.erb: -------------------------------------------------------------------------------- 1 | <% content_for :title do %>Services | <% end %> 2 | 3 | <% content_for :header do %> 4 |

Services

5 | <%= render "shared/services-nav" %> 6 | <% end %> 7 | 8 | <%= render "filters" %> 9 | 10 | <% if @services.present? %> 11 |
12 | <%= render partial: 'list', locals: { services: @services } %> 13 |
14 | <%= paginate @services %> 15 | <% else %> 16 |

No results to show

17 | <% end %> -------------------------------------------------------------------------------- /app/views/admin/settings/editors/_features.html.erb: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | <%= f.check_box :feature_wysiwyg, class: "checkbox__input"%> 5 | <%= f.label :feature_wysiwyg, class: "checkbox__label" do %> 6 | Enable WYSIWYG editor functionality for service description fields. 7 | <% end %> 8 |
9 |
10 |
-------------------------------------------------------------------------------- /app/views/admin/suitabilities/_fields.html.erb: -------------------------------------------------------------------------------- 1 |
2 | <%= f.label :name, class: "field__label" %> 3 | <%= f.text_field :name, required: true, value: @suitability.name, class: "field__input" %> 4 |
5 | -------------------------------------------------------------------------------- /app/views/admin/suitabilities/new.html.erb: -------------------------------------------------------------------------------- 1 | <% content_for :header do %> 2 | <%= render "shared/dynamic-back-link", text: "Back to suitabilities", path: admin_suitabilities_path %> 3 |
4 |

5 | Add new suitability option 6 |

7 |
8 | <% end %> 9 | 10 | <%= form_for [:admin, @suitability], html: {class: "one-half"}, data: {warn_unsaved_changes: true} do |f| %> 11 | <%= render "shared/errors", model: @suitability %> 12 |
13 | <%= render "fields", f: f %> 14 |
15 |
16 | <%= f.submit "Create", class: "button" %> 17 |
18 | <% end %> -------------------------------------------------------------------------------- /app/views/admin/users/_labels.html.erb: -------------------------------------------------------------------------------- 1 |
2 | 3 |
4 | <%= s.label :label_list, "Choose or add labels to this user", class: "field__label" %> 5 | <%= s.text_field :label_list, class: "field__input", data: {labels: current_user.admin_users?}, value: @user.label_list.to_s, disabled: !current_user.admin_users? %> 6 |
7 | 8 | 11 | 12 |
13 | -------------------------------------------------------------------------------- /app/views/admin/users/_permanent-deletion.html.erb: -------------------------------------------------------------------------------- 1 | <% if f.object.discarded? %> 2 |
3 |

Danger zone

4 |

Permanently deleted users will be removed after 30 days. They can't be recovered by anyone.

5 |
6 |
7 | <%= f.check_box :marked_for_deletion, {class: "checkbox__input", checked: @user.marked_for_deletion?}, Time.now %> 8 | <%= f.label :marked_for_deletion, "Mark this user for permanent deletion?", class: "checkbox__label" %> 9 |
10 |
11 |
12 | <% end %> -------------------------------------------------------------------------------- /app/views/admin/users/new.html.erb: -------------------------------------------------------------------------------- 1 | <% content_for :header do %> 2 | <%= render "shared/dynamic-back-link", text: "Back to users", path: admin_users_path %> 3 |

Invite a new user

4 | <% end %> 5 | 6 | <%= form_for [:admin, @user], html: {class: "one-half"}, data: {warn_unsaved_changes: true} do |f| %> 7 | <%= render "shared/errors", model: @user %> 8 | <%= render "fields", f: f %> 9 |
10 | <%= f.submit "Send invite", class: "button" %> 11 |
12 | <% end %> -------------------------------------------------------------------------------- /app/views/devise/confirmations/new.html.erb: -------------------------------------------------------------------------------- 1 |

Resend confirmation instructions

2 | 3 | <%= form_for(resource, as: resource_name, url: confirmation_path(resource_name), html: { method: :post }) do |f| %> 4 | <%= render "shared/errors", model: resource %> 5 | 6 |
7 | <%= f.label :email %>
8 | <%= f.email_field :email, autofocus: true, autocomplete: "email", value: (resource.pending_reconfirmation? ? resource.unconfirmed_email : resource.email) %> 9 |
10 | 11 |
12 | <%= f.submit "Resend confirmation instructions" %> 13 |
14 | <% end %> 15 | 16 | <%= render "devise/shared/links" %> 17 | -------------------------------------------------------------------------------- /app/views/devise/mailer/confirmation_instructions.text.erb: -------------------------------------------------------------------------------- 1 | Welcome <%= @email %>! 2 | 3 | You can confirm your account email through the link below: 4 | 5 | [Confirm my account](<%= confirmation_url(@resource, confirmation_token: @token) %>) 6 | -------------------------------------------------------------------------------- /app/views/devise/mailer/email_changed.text.erb: -------------------------------------------------------------------------------- 1 | Hello <%= @email %>! 2 | 3 | <% if @resource.try(:unconfirmed_email?) %> 4 | We're contacting you to notify you that your email is being changed to <%= @resource.unconfirmed_email %>. 5 | <% else %> 6 | We're contacting you to notify you that your email has been changed to <%= @resource.email %>. 7 | <% end %> 8 | -------------------------------------------------------------------------------- /app/views/devise/mailer/password_change.text.erb: -------------------------------------------------------------------------------- 1 | Hello <%= @resource.email %>! 2 | 3 | We're contacting you to notify you that your password has been changed. 4 | -------------------------------------------------------------------------------- /app/views/devise/mailer/reset_password_instructions.text.erb: -------------------------------------------------------------------------------- 1 | Hello <%= @resource.email %>! 2 | 3 | Someone has requested a link to change your password. You can do this through the link below. 4 | 5 | [Change my password](<%= edit_password_url(@resource, reset_password_token: @token) %>) 6 | 7 | If you didn't request this, please ignore this email. 8 | Your password won't change until you access the link above and create a new one. 9 | -------------------------------------------------------------------------------- /app/views/devise/mailer/unlock_instructions.text.erb: -------------------------------------------------------------------------------- 1 | Hello <%= @resource.email %>! 2 | 3 | Your account has been locked due to an excessive number of unsuccessful sign in attempts. 4 | 5 | Click the link below to unlock your account: 6 | 7 | [Unlock my account](<%= unlock_url(@resource, unlock_token: @token) %>) 8 | -------------------------------------------------------------------------------- /app/views/devise/unlocks/new.html.erb: -------------------------------------------------------------------------------- 1 |

Resend unlock instructions

2 | 3 | <%= form_for(resource, as: resource_name, url: unlock_path(resource_name), html: { method: :post }) do |f| %> 4 | <%= render "shared/errors", model: resource %> 5 | 6 |
7 | <%= f.label :email %>
8 | <%= f.email_field :email, autofocus: true, autocomplete: "email" %> 9 |
10 | 11 |
12 | <%= f.submit "Resend unlock instructions" %> 13 |
14 | <% end %> 15 | 16 | <%= render "devise/shared/links" %> 17 | -------------------------------------------------------------------------------- /app/views/feedback/create.html.erb: -------------------------------------------------------------------------------- 1 | <% content_for :title do %>Feedback sent successfully | <% end %> 2 | 3 | <% content_for :header do %> 4 |
5 |

Your feedback has been sent successfully

6 |

You can now close this tab

7 |
8 | <% end %> -------------------------------------------------------------------------------- /app/views/layouts/mailer.text.erb: -------------------------------------------------------------------------------- 1 | <%= yield %> 2 | -------------------------------------------------------------------------------- /app/views/members/new.html.erb: -------------------------------------------------------------------------------- 1 | <% content_for :title do %>Invite a user | <% end %> 2 | 3 | <% content_for :header do %> 4 | <%= link_to "Back to dashboard", organisations_path, class: "go-back" %> 5 |

Invite a new user

6 |

You can invite other people you work with to help you manage this list of services.

7 | <% end %> 8 | 9 | <%= render "form" %> -------------------------------------------------------------------------------- /app/views/organisations/_form.html.erb: -------------------------------------------------------------------------------- 1 | <%= form_for @organisation, html: {class: "two-thirds"} do |f| %> 2 | 3 | <%= render "shared/errors", model: @organisation %> 4 | 5 |
6 |
7 | <%= f.label :name, "Organisation name", class: "field__label" %> 8 | <%= f.text_field :name, class: "field__input one-half" %> 9 |
10 |
11 | 12 |
13 | 14 | <% if params[:action] === "new" %> 15 | <%= f.submit "Continue", class: "button" %> 16 | <%= f.submit "Skip for now", class: "button button--secondary" %> 17 | <% else %> 18 | <%= f.submit "Update", class: "button" %> 19 | <% end %> 20 | 21 |
22 | 23 | <% end %> 24 | -------------------------------------------------------------------------------- /app/views/organisations/edit.html.erb: -------------------------------------------------------------------------------- 1 | <% content_for :title do %>Edit your organisation | <% end %> 2 | 3 | <% content_for :header do %> 4 | <%= link_to "Back to dashboard", organisations_path, class: "go-back" %> 5 |

Change your organisation's name

6 |

If you offer more than one service, a named organisation helps people recognise that they're run by you.

7 | <% end %> 8 | 9 | <%= render "form" %> -------------------------------------------------------------------------------- /app/views/organisations/new.html.erb: -------------------------------------------------------------------------------- 1 | <% content_for :header do %> 2 |

Give your organisation a name

3 |

This will be publicly visible. If you have more than one service, this name will be used to group them together.

4 | <% end %> 5 | 6 | <%= render "form" %> -------------------------------------------------------------------------------- /app/views/service_mailer/notify_owner_email.text.erb: -------------------------------------------------------------------------------- 1 | # Your changes to <%= @service.name %> have been approved. 2 | 3 | 4 | Your changes to <%= @service.name %> have been approved. 5 | 6 | Review the changes: 7 | 8 | <%= service_url(@service) %> 9 | 10 | -------------------------------------------------------------------------------- /app/views/service_mailer/notify_owner_of_feedback_email.text.erb: -------------------------------------------------------------------------------- 1 | # A member of the public has submitted new feedback for your service: <%= @service.name %>. 2 | 3 | Feedback is visible only to you and to admins. 4 | 5 | --- 6 | 7 | <%= pretty_topic(@feedback.topic) %>: 8 | 9 | "<%= @feedback.body %>" 10 | 11 | --- 12 | 13 | To make edits to your service: 14 | 15 | <%= service_url(@service) %> 16 | -------------------------------------------------------------------------------- /app/views/service_mailer/notify_watcher_email.text.erb: -------------------------------------------------------------------------------- 1 | # A service you're watching has been updated. 2 | 3 | See the updates: 4 | 5 | <%= admin_service_url(@service) %> 6 | 7 | You can control these notifications from your profile. -------------------------------------------------------------------------------- /app/views/services/_edit_ages.html.erb: -------------------------------------------------------------------------------- 1 | <% content_for :title do %>Ages | <% end %> 2 | 3 | <% content_for :header do %> 4 | <%= link_to "Go back", service_path(@service), class: "go-back" %> 5 |

Ages

6 | <% end %> 7 | 8 | <%= form_with model: @service, url: service_path(@service, :section => params[:section]), html: {class: "two-thirds"} do |s| %> 9 | <%= render "shared/errors", model: @service %> 10 | <%= render "admin/services/editors/ages", s: s %> 11 | 12 |
13 | 14 |
15 | <% end %> -------------------------------------------------------------------------------- /app/views/services/_edit_contacts.html.erb: -------------------------------------------------------------------------------- 1 | <% content_for :title do %>Contacts | <% end %> 2 | 3 | <% content_for :header do %> 4 | <%= link_to "Go back", service_path(@service), class: "go-back" %> 5 |

Contacts

6 |

Add contact details for people or parts of your service.

7 | <% end %> 8 | 9 | <%= form_with model: @service, url: service_path(@service, :section => params[:section]), html: {class: "two-thirds"} do |s| %> 10 | <%= render "shared/errors", model: @service %> 11 | <%= render "admin/services/editors/contacts", s: s %> 12 | 13 |
14 | 15 |
16 | <% end %> -------------------------------------------------------------------------------- /app/views/services/_edit_extra_questions.html.erb: -------------------------------------------------------------------------------- 1 | <% content_for :title do %>Extra questions | <% end %> 2 | 3 | <% content_for :header do %> 4 | <%= link_to "Go back", service_path(@service), class: "go-back" %> 5 |

Extra questions

6 | <% end %> 7 | 8 | <%= form_with model: @service, url: service_path(@service, :section => params[:section]), html: {class: "two-thirds"} do |s| %> 9 | <%= render "shared/errors", model: @service %> 10 | <%= render "admin/services/editors/custom-fields", s: s %> 11 | 12 |
13 | 14 |
15 | <% end %> -------------------------------------------------------------------------------- /app/views/services/_edit_fees.html.erb: -------------------------------------------------------------------------------- 1 | <% content_for :title do %>Fees | <% end %> 2 | 3 | <% content_for :header do %> 4 | <%= link_to "Go back", service_path(@service), class: "go-back" %> 5 |

Fees

6 |

Help people understand what your service costs.

7 | <% end %> 8 | 9 | <%= form_with model: @service, url: service_path(@service, :section => params[:section]), html: {class: "two-thirds"} do |s| %> 10 | <%= render "shared/errors", model: @service %> 11 | <%= render "admin/services/editors/cost-options", s: s %> 12 | 13 |
14 | 15 |
16 | <% end %> -------------------------------------------------------------------------------- /app/views/services/_edit_locations.html.erb: -------------------------------------------------------------------------------- 1 | <% content_for :title do %>Locations | <% end %> 2 | 3 | <% content_for :header do %> 4 | <%= link_to "Go back", service_path(@service), class: "go-back" %> 5 |

Locations

6 |

If your service has physical offices or places people can visit, add them here.

7 | <% end %> 8 | 9 | <%= form_with model: @service, url: service_path(@service, :section => params[:section]), html: {class: "two-thirds"} do |s| %> 10 | <%= render "shared/errors", model: @service %> 11 | <%= render "admin/services/editors/locations", s: s %> 12 | 13 |
14 | 15 |
16 | <% end %> -------------------------------------------------------------------------------- /app/views/services/_edit_visibility.html.erb: -------------------------------------------------------------------------------- 1 | <% content_for :title do %>Visibility | <% end %> 2 | 3 | <% content_for :header do %> 4 | <%= link_to "Go back", service_path(@service), class: "go-back" %> 5 |

Visibility

6 |

Do you want this service to be visible to the public?

7 | <% end %> 8 | 9 | <%= form_with model: @service, url: service_path(@service, :section => params[:section]), html: {class: "two-thirds"} do |s| %> 10 | <%= render "shared/errors", model: @service %> 11 | <%= render "admin/services/editors/dates", s: s %> 12 | 13 |
14 | 15 |
16 | <% end %> -------------------------------------------------------------------------------- /app/views/services/_task_list_item.html.erb: -------------------------------------------------------------------------------- 1 | <%= link_to s[:title], edit_service_path(@service, :section => s[:key].parameterize.underscore), class: 'task-list__title' %> 2 | <% if @currently_creating %> 3 | <% if session[:completed_sections].include?(s[:key].parameterize.underscore) %> 4 | Done 5 | <% else %> 6 | To do 7 | <% end %> 8 | <% end %> 9 |
10 |

<%= s[:description] %>

11 |
-------------------------------------------------------------------------------- /app/views/shared/_collapsible.html.erb: -------------------------------------------------------------------------------- 1 |
2 | 10 | <% if defined?(help_text) %> 11 | 12 | <% end %> 13 |
14 | <%= yield %> 15 |
16 |
-------------------------------------------------------------------------------- /app/views/shared/_dynamic-back-link.html.erb: -------------------------------------------------------------------------------- 1 | <% if session[:go_back_to].present? %> 2 | <%= link_to "Go back", session[:go_back_to], class: "go-back" %> 3 | <% else %> 4 | <%= link_to text, path, class: "go-back" %> 5 | <% end %> -------------------------------------------------------------------------------- /app/views/shared/_env-banner.html.erb: -------------------------------------------------------------------------------- 1 | <% if ENV["SHOW_ENV_BANNER"] %> 2 |
3 | This is <%= ENV["SHOW_ENV_BANNER"] %>. Changes may be reverted at any time. 4 |
5 | <% end %> -------------------------------------------------------------------------------- /app/views/shared/_errors.html.erb: -------------------------------------------------------------------------------- 1 | <% hide_list ||= false %> 2 | <% if model.errors.any? %> 3 |
4 |

<%= pluralize(model.errors.count, "error") %> stopped this <%= model.class.model_name.human.downcase %> being saved

5 | <% unless hide_list %> 6 | 11 | <% end %> 12 |
13 | <% end %> -------------------------------------------------------------------------------- /app/views/shared/_footer.html.erb: -------------------------------------------------------------------------------- 1 | 19 | -------------------------------------------------------------------------------- /app/views/shared/_google.html.erb: -------------------------------------------------------------------------------- 1 | <%= 2 | # this is a fall back for application running in docker. 3 | # Since the application is built without GOOGLE_CLIENT_KEY for the image and 4 | # there is no node process in production there is no way to get GOOGLE_CLIENT_KEY into the javascript. 5 | # By default we will look for process.env.GOOGLE_CLIENT_KEY but if thats not 6 | # available then GOOGLE_CLIENT_KEY becomes the backup 7 | %> 8 | -------------------------------------------------------------------------------- /app/views/shared/_head.html.erb: -------------------------------------------------------------------------------- 1 | 2 | 3 | <%= yield :title %> <%= Setting.outpost_title %> | <%= Setting.outpost_sub_title %> 4 | 5 | <%= csrf_meta_tags %> 6 | <%= csp_meta_tag %> 7 | <%= favicon_link_tag 'favicon.ico' %> 8 | 9 | 10 | <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %> 11 | <%= javascript_pack_tag 'application', 'data-turbolinks-track': 'reload' %> 12 | <%= render 'shared/settings' %> 13 | -------------------------------------------------------------------------------- /app/views/shared/_preview-canvas.html.erb: -------------------------------------------------------------------------------- 1 |
2 | <% combined_keys = live.merge(version).except!(*ignorable_fields).keys %> 3 | 4 | <% combined_keys.each do |key| %> 5 |

<%= key.humanize %>

6 | 7 | <% if version.has_key?(key) && live.has_key?(key) %> 8 | 9 | <%= diff(version[key], live[key]) %> 10 | 11 | <% elsif live.has_key?(key) %> 12 | 13 | <%= diff("", live[key]) %> 14 | 15 | <% elsif version.has_key?(key) %> 16 | 17 | <%= diff(version[key], "") %> 18 | 19 | <% end %> 20 | 21 | <% end %> 22 |
-------------------------------------------------------------------------------- /app/views/shared/_settings.html.erb: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/views/shared/_shortcuts_item.erb: -------------------------------------------------------------------------------- 1 | 2 | <%= link_to label, link, class: "shortcuts__link" %> 3 | (<%= count %>) 4 | -------------------------------------------------------------------------------- /app/views/shared/_taxonomies-nav.html.erb: -------------------------------------------------------------------------------- 1 | <% 2 | @directory_links = {} 3 | 4 | if Directory.any? 5 | Directory.all.each do |directory| 6 | @directory_links[directory.name] = admin_taxonomies_path(directory: directory.name); 7 | end 8 | end 9 | %> 10 | 11 | <%= 12 | # display the directory headings 13 | render partial: "shared/directory-shortcuts", locals: { 14 | all_state: !params[:directory].present?, 15 | all_link: admin_taxonomies_path, 16 | all_count: @taxonomy_counts.dig(:all, :all), 17 | all_label: "All", 18 | directory_links: @directory_links, 19 | directory_counts: @taxonomy_counts 20 | } 21 | %> 22 | 23 | -------------------------------------------------------------------------------- /app/views/shared/_user-circle.html.erb: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/views/shared/_watch.html.erb: -------------------------------------------------------------------------------- 1 | <% if @watched %> 2 | <%= form_with url: admin_service_watch_path(@service), method: :delete do |f| %> 3 | <%= f.submit "Unwatch", class: "button button--secondary" %> 4 | <% end %> 5 | <% else %> 6 | <%= form_with url: admin_service_watch_index_path(@service) do |f| %> 7 | <%= f.submit "Watch", class: "button button--secondary" %> 8 | <% end %> 9 | <% end %> -------------------------------------------------------------------------------- /app/views/shared/poppables/_deleted_user.html.erb: -------------------------------------------------------------------------------- 1 | 2 | 3 | <%= u %> 4 | 5 | 6 |
7 |
8 |

9 | <%= u %> 10 | Deleted user 11 |

12 |
13 |
14 |
15 | -------------------------------------------------------------------------------- /app/views/user_mailer/invite_from_admin_email.text.erb: -------------------------------------------------------------------------------- 1 | # You've been invited to join <%= @outpost_instance_name %> 2 | 3 | Set your password and sign in here: 4 | 5 | <%= new_user_password_url %>?email=<%= @user.email %> 6 | -------------------------------------------------------------------------------- /app/views/user_mailer/invite_from_community_email.text.erb: -------------------------------------------------------------------------------- 1 | # You've been invited to join <%= @outpost_instance_name %> 2 | 3 | You've been added to the <%= @org.name %> organisation. 4 | 5 | Set your password and sign in here: 6 | 7 | <%= new_user_password_url %>?email=<%= @user.email %> 8 | -------------------------------------------------------------------------------- /app/views/user_mailer/reset_instructions_email.text.erb: -------------------------------------------------------------------------------- 1 | Hello <%= @user.display_name %>, 2 | 3 | Someone has requested a link to change your password. You can do this through the link below. 4 | 5 | Change your password: 6 | 7 | <%= edit_password_url(@user, reset_password_token: @token) %> 8 | 9 | If you didn't request this, please ignore this email. 10 | 11 | Your password won't change until you access the link above and create a new one. 12 | -------------------------------------------------------------------------------- /bin/rails: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | begin 3 | load File.expand_path('../spring', __FILE__) 4 | rescue LoadError => e 5 | raise unless e.message.include?('spring') 6 | end 7 | APP_PATH = File.expand_path('../config/application', __dir__) 8 | require_relative '../config/boot' 9 | require 'rails/commands' 10 | -------------------------------------------------------------------------------- /bin/rake: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | begin 3 | load File.expand_path('../spring', __FILE__) 4 | rescue LoadError => e 5 | raise unless e.message.include?('spring') 6 | end 7 | require_relative '../config/boot' 8 | require 'rake' 9 | Rake.application.run 10 | -------------------------------------------------------------------------------- /bin/spring: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | 3 | # This file loads Spring without using Bundler, in order to be fast. 4 | # It gets overwritten when you run the `spring binstub` command. 5 | 6 | unless defined?(Spring) 7 | require 'rubygems' 8 | require 'bundler' 9 | 10 | lockfile = Bundler::LockfileParser.new(Bundler.default_lockfile.read) 11 | spring = lockfile.specs.detect { |spec| spec.name == 'spring' } 12 | if spring 13 | Gem.use_paths Gem.dir, Bundler.bundle_path.to_s, *Gem.path 14 | gem 'spring', spring.version 15 | require 'spring/binstub' 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /bin/webpack: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | 3 | ENV["RAILS_ENV"] ||= ENV["RACK_ENV"] || "development" 4 | ENV["NODE_ENV"] ||= "development" 5 | 6 | require "pathname" 7 | ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", 8 | Pathname.new(__FILE__).realpath) 9 | 10 | require "bundler/setup" 11 | 12 | require "webpacker" 13 | require "webpacker/webpack_runner" 14 | 15 | APP_ROOT = File.expand_path("..", __dir__) 16 | Dir.chdir(APP_ROOT) do 17 | Webpacker::WebpackRunner.run(ARGV) 18 | end 19 | -------------------------------------------------------------------------------- /bin/webpack-dev-server: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | 3 | ENV["RAILS_ENV"] ||= ENV["RACK_ENV"] || "development" 4 | ENV["NODE_ENV"] ||= "development" 5 | 6 | require "pathname" 7 | ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", 8 | Pathname.new(__FILE__).realpath) 9 | 10 | require "bundler/setup" 11 | 12 | require "webpacker" 13 | require "webpacker/dev_server_runner" 14 | 15 | APP_ROOT = File.expand_path("..", __dir__) 16 | Dir.chdir(APP_ROOT) do 17 | Webpacker::DevServerRunner.run(ARGV) 18 | end 19 | -------------------------------------------------------------------------------- /bin/yarn: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | APP_ROOT = File.expand_path('..', __dir__) 3 | Dir.chdir(APP_ROOT) do 4 | begin 5 | exec "yarnpkg", *ARGV 6 | rescue Errno::ENOENT 7 | $stderr.puts "Yarn executable was not detected in the system." 8 | $stderr.puts "Download Yarn at https://yarnpkg.com/en/docs/install" 9 | exit 1 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /config.ru: -------------------------------------------------------------------------------- 1 | # This file is used by Rack-based servers to start the application. 2 | 3 | require_relative 'config/environment' 4 | 5 | run Rails.application 6 | -------------------------------------------------------------------------------- /config/boot.rb: -------------------------------------------------------------------------------- 1 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__) 2 | 3 | require 'bundler/setup' # Set up gems listed in the Gemfile. 4 | require 'bootsnap/setup' # Speed up boot time by caching expensive operations. 5 | -------------------------------------------------------------------------------- /config/cable.yml: -------------------------------------------------------------------------------- 1 | development: 2 | adapter: async 3 | 4 | test: 5 | adapter: test 6 | 7 | production: 8 | adapter: redis 9 | url: <%= ENV.fetch("REDIS_URL") { "redis://localhost:6379/1" } %> 10 | channel_prefix: outpost_production 11 | -------------------------------------------------------------------------------- /config/credentials.yml.enc: -------------------------------------------------------------------------------- 1 | 1nh5U5pM2XgQ4uHUrmFa1+w7+I5pmF7OrOyHT4SgUeIO9NywIuGojBG/3jDkNkozmr3kxDDJc3lL+3p0I5zJrbx6Gl3XScD3bL5qAuPicNwjvr9Yve8ajAyk6XtDRlvZJ3dP2aBKSupOlXcmrJ8H7B8inOUJXQzC66VtyaA9qTPQwozW/HPBiZhzHE1kLVdcM7qldvj/zEWv50dCS38gVaneIoSSUcoFpKaJxxQV5dpzICvSb/8nUQeTGbHVPyd5WiMZbVClgwm3j4f4b5H8dUOX9LQaJQsmZhGhBwglGJerSlabhFeunq1pVn5+JyIjRn5dZv4uchk9tiFNxj4M1RKWUJXneJYt6gb58egQeEZxtjz8w3gmAcyB20b9ye0ehH2c4/AYY60Hm+KnBLNcYHSG3cJMPZa4VrQC--rRmZ1FqDtszskXZZ--Eq1u+902xEpT5Iz4kVIdQg== -------------------------------------------------------------------------------- /config/database.yml: -------------------------------------------------------------------------------- 1 | default: &default 2 | adapter: postgresql 3 | encoding: unicode 4 | pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %> 5 | timeout: <%= ENV.fetch("RAILS_TIMEOUT") { 5000 } %> 6 | 7 | development: 8 | <<: *default 9 | url: <%= ENV.fetch("DATABASE_URL"){ "postgresql://outpost:password@localhost/outpost?" }.gsub('?', '_development?') %> 10 | 11 | test: 12 | <<: *default 13 | url: <%= ENV.fetch("DATABASE_URL"){ "postgresql://outpost:password@localhost/outpost?" }.gsub('?', '_test?') %> 14 | 15 | staging: 16 | <<: *default 17 | url: <%= ENV.fetch("DATABASE_URL"){ "postgresql://localhost/outpost?" }.gsub('?', '_staging?') %> 18 | 19 | production: 20 | <<: *default 21 | url: <%= ENV.fetch("DATABASE_URL"){ "postgresql://localhost/outpost?" }.gsub('?', '_production?') %> 22 | -------------------------------------------------------------------------------- /config/environment.rb: -------------------------------------------------------------------------------- 1 | # Load the Rails application. 2 | require_relative 'application' 3 | 4 | # Initialize the Rails application. 5 | Rails.application.initialize! 6 | -------------------------------------------------------------------------------- /config/initializers/active_model_serializers.rb: -------------------------------------------------------------------------------- 1 | ActiveModelSerializers.config.adapter = :json 2 | 3 | ActiveModel::Serializer.config.default_includes = '**' -------------------------------------------------------------------------------- /config/initializers/app_config.rb: -------------------------------------------------------------------------------- 1 | instance = ENV["INSTANCE"] 2 | instance ||= "default" 3 | APP_CONFIG = YAML.load_file(Rails.root.join('config/app_config.yml'))[instance] -------------------------------------------------------------------------------- /config/initializers/application_controller_renderer.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # ActiveSupport::Reloader.to_prepare do 4 | # ApplicationController.renderer.defaults.merge!( 5 | # http_host: 'example.org', 6 | # https: false 7 | # ) 8 | # end 9 | -------------------------------------------------------------------------------- /config/initializers/assets.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Version of your assets, change this if you want to expire all your assets. 4 | Rails.application.config.assets.version = '1.0' 5 | 6 | # Add additional assets to the asset load path. 7 | # Rails.application.config.assets.paths << Emoji.images_path 8 | # Add Yarn node_modules folder to the asset load path. 9 | Rails.application.config.assets.paths << Rails.root.join('node_modules') 10 | 11 | # Precompile additional assets. 12 | # application.js, application.css, and all non-JS/CSS in the app/assets 13 | # folder are already added. 14 | # Rails.application.config.assets.precompile += %w( admin.js admin.css ) 15 | -------------------------------------------------------------------------------- /config/initializers/backtrace_silencers.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces. 4 | # Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ } 5 | 6 | # You can also remove all the silencers if you're trying to debug a problem that might stem from framework code. 7 | # Rails.backtrace_cleaner.remove_silencers! 8 | -------------------------------------------------------------------------------- /config/initializers/cookies_serializer.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Specify a serializer for the signed and encrypted cookie jars. 4 | # Valid options are :json, :marshal, and :hybrid. 5 | Rails.application.config.action_dispatch.cookies_serializer = :json 6 | -------------------------------------------------------------------------------- /config/initializers/filter_parameter_logging.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Configure sensitive parameters which will be filtered from the log file. 4 | Rails.application.config.filter_parameters += [:password] 5 | -------------------------------------------------------------------------------- /config/initializers/inflections.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Add new inflection rules using the following format. Inflections 4 | # are locale specific, and you may define rules for as many different 5 | # locales as you wish. All of these examples are active by default: 6 | # ActiveSupport::Inflector.inflections(:en) do |inflect| 7 | # inflect.plural /^(ox)$/i, '\1en' 8 | # inflect.singular /^(ox)en/i, '\1' 9 | # inflect.irregular 'person', 'people' 10 | # inflect.uncountable %w( fish sheep ) 11 | # end 12 | 13 | # These inflection rules are supported but not enabled by default: 14 | ActiveSupport::Inflector.inflections(:en) do |inflect| 15 | inflect.acronym 'API' 16 | end -------------------------------------------------------------------------------- /config/initializers/mime_types.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Add new mime types for use in respond_to blocks: 4 | # Mime::Type.register "text/richtext", :rtf 5 | -------------------------------------------------------------------------------- /config/initializers/wrap_parameters.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # This file contains settings for ActionController::ParamsWrapper which 4 | # is enabled by default. 5 | 6 | # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array. 7 | ActiveSupport.on_load(:action_controller) do 8 | wrap_parameters format: [:json] 9 | end 10 | 11 | # To enable root element in JSON for ActiveRecord objects. 12 | # ActiveSupport.on_load(:active_record) do 13 | # self.include_root_in_json = true 14 | # end 15 | -------------------------------------------------------------------------------- /config/locales/devise.security_extension.it.yml: -------------------------------------------------------------------------------- 1 | it: 2 | errors: 3 | messages: 4 | taken_in_past: "e' stata gia' utilizzata in passato!" 5 | equal_to_current_password: " deve essere differente dalla password corrente!" 6 | devise: 7 | invalid_captcha: "Il captcha inserito non e' valido!" 8 | password_expired: 9 | updated: "La tua nuova password e' stata salvata." 10 | change_required: "La tua password e' scaduta. Si prega di rinnovarla!" -------------------------------------------------------------------------------- /config/spring.rb: -------------------------------------------------------------------------------- 1 | Spring.watch( 2 | ".ruby-version", 3 | ".rbenv-vars", 4 | "tmp/restart.txt", 5 | "tmp/caching-dev.txt" 6 | ) 7 | -------------------------------------------------------------------------------- /config/webpack/development.js: -------------------------------------------------------------------------------- 1 | process.env.NODE_ENV = process.env.NODE_ENV || 'development' 2 | 3 | const environment = require('./environment') 4 | 5 | module.exports = environment.toWebpackConfig() 6 | -------------------------------------------------------------------------------- /config/webpack/environment.js: -------------------------------------------------------------------------------- 1 | const { environment } = require("@rails/webpacker"); 2 | const webpack = require("webpack"); 3 | 4 | module.exports = environment; 5 | -------------------------------------------------------------------------------- /config/webpack/production.js: -------------------------------------------------------------------------------- 1 | process.env.NODE_ENV = process.env.NODE_ENV || 'production' 2 | 3 | const environment = require('./environment') 4 | 5 | module.exports = environment.toWebpackConfig() 6 | -------------------------------------------------------------------------------- /config/webpack/test.js: -------------------------------------------------------------------------------- 1 | process.env.NODE_ENV = process.env.NODE_ENV || 'development' 2 | 3 | const environment = require('./environment') 4 | 5 | module.exports = environment.toWebpackConfig() 6 | -------------------------------------------------------------------------------- /db/migrate/20200226163120_create_organisations.rb: -------------------------------------------------------------------------------- 1 | class CreateOrganisations < ActiveRecord::Migration[6.0] 2 | def change 3 | create_table :organisations do |t| 4 | t.string :name 5 | t.text :description 6 | t.string :email 7 | t.string :url 8 | t.timestamps 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /db/migrate/20200226170500_create_services.rb: -------------------------------------------------------------------------------- 1 | class CreateServices < ActiveRecord::Migration[6.0] 2 | def change 3 | create_table :services do |t| 4 | t.belongs_to :organisation 5 | t.string :name 6 | t.text :description 7 | t.string :email 8 | t.string :url 9 | t.timestamps 10 | end 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /db/migrate/20200226172537_add_old_external_id_to_organisations.rb: -------------------------------------------------------------------------------- 1 | class AddOldExternalIdToOrganisations < ActiveRecord::Migration[6.0] 2 | def change 3 | add_column :organisations, :old_external_id, :string 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20200323141046_create_contacts.rb: -------------------------------------------------------------------------------- 1 | class CreateContacts < ActiveRecord::Migration[6.0] 2 | def change 3 | create_table :contacts do |t| 4 | t.belongs_to :service 5 | t.string :name 6 | t.string :title 7 | end 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /db/migrate/20200323151357_create_phones.rb: -------------------------------------------------------------------------------- 1 | class CreatePhones < ActiveRecord::Migration[6.0] 2 | def change 3 | create_table :phones do |t| 4 | t.belongs_to :contact 5 | t.string :number 6 | end 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20200403152026_create_physical_addresses.rb: -------------------------------------------------------------------------------- 1 | class CreatePhysicalAddresses < ActiveRecord::Migration[6.0] 2 | def change 3 | create_table :physical_addresses do |t| 4 | t.belongs_to :location 5 | t.string :address_1 6 | t.string :city 7 | t.string :state_province 8 | t.string :postal_code 9 | t.string :country 10 | end 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /db/migrate/20200403152335_create_locations.rb: -------------------------------------------------------------------------------- 1 | class CreateLocations < ActiveRecord::Migration[6.0] 2 | def change 3 | create_table :locations do |t| 4 | t.string :name 5 | t.string :description 6 | t.decimal :latitude, precision: 10, scale: 6 7 | t.decimal :longitude, precision: 10, scale: 6 8 | end 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /db/migrate/20200403160415_service_at_locations.rb: -------------------------------------------------------------------------------- 1 | class ServiceAtLocations < ActiveRecord::Migration[6.0] 2 | def change 3 | create_table :service_at_locations do |t| 4 | t.integer :service_id, null: false 5 | t.integer :location_id, null: false 6 | end 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20200403215552_add_watch_association.rb: -------------------------------------------------------------------------------- 1 | class AddWatchAssociation < ActiveRecord::Migration[6.0] 2 | def change 3 | 4 | create_table :watches do |t| 5 | t.belongs_to :user 6 | t.belongs_to :service 7 | t.timestamps 8 | end 9 | 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /db/migrate/20200406120632_drop_physical_addresses_table.rb: -------------------------------------------------------------------------------- 1 | class DropPhysicalAddressesTable < ActiveRecord::Migration[6.0] 2 | def change 3 | drop_table :physical_addresses 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20200406120701_add_address_fields_to_locations.rb: -------------------------------------------------------------------------------- 1 | class AddAddressFieldsToLocations < ActiveRecord::Migration[6.0] 2 | def change 3 | add_column :locations, :address_1, :string 4 | add_column :locations, :city, :string 5 | add_column :locations, :state_province, :string 6 | add_column :locations, :postal_code, :string 7 | add_column :locations, :country, :string 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /db/migrate/20200407115112_create_taxonomies.rb: -------------------------------------------------------------------------------- 1 | class CreateTaxonomies < ActiveRecord::Migration[6.0] 2 | def change 3 | create_table :taxonomies do |t| 4 | t.string :name 5 | 6 | t.timestamps 7 | end 8 | 9 | create_table :service_taxonomies do |t| 10 | t.belongs_to :taxonomy 11 | t.belongs_to :service 12 | t.timestamps 13 | end 14 | 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /db/migrate/20200408220530_add_object_changes_to_versions.rb: -------------------------------------------------------------------------------- 1 | # This migration adds the optional `object_changes` column, in which PaperTrail 2 | # will store the `changes` diff for each update event. See the readme for 3 | # details. 4 | class AddObjectChangesToVersions < ActiveRecord::Migration[6.0] 5 | # The largest text column available in all supported RDBMS. 6 | # See `create_versions.rb` for details. 7 | TEXT_BYTES = 1_073_741_823 8 | 9 | def change 10 | add_column :versions, :object_changes, :text, limit: TEXT_BYTES 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /db/migrate/20200415092246_add_searchable_fields_to_service_at_locations.rb: -------------------------------------------------------------------------------- 1 | class AddSearchableFieldsToServiceAtLocations < ActiveRecord::Migration[6.0] 2 | def change 3 | add_column :service_at_locations, :service_name, :string 4 | add_column :service_at_locations, :service_description, :text 5 | add_column :service_at_locations, :service_url, :string 6 | add_column :service_at_locations, :service_email, :string 7 | add_column :service_at_locations, :postcode, :string 8 | add_column :service_at_locations, :latitude, :decimal, precision: 10, scale: 6 9 | add_column :service_at_locations, :longitude, :decimal, precision: 10, scale: 6 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /db/migrate/20200416111637_add_parent_id_to_taxonomies.rb: -------------------------------------------------------------------------------- 1 | class AddParentIdToTaxonomies < ActiveRecord::Migration[6.0] 2 | def change 3 | add_reference :taxonomies, :parent, index: true 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20200417001138_add_roles_to_users.rb: -------------------------------------------------------------------------------- 1 | class AddRolesToUsers < ActiveRecord::Migration[6.0] 2 | def change 3 | add_column :users, :admin, :boolean 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20200417212827_associate_users_and_organisations.rb: -------------------------------------------------------------------------------- 1 | class AssociateUsersAndOrganisations < ActiveRecord::Migration[6.0] 2 | def change 3 | 4 | create_table :organisations_users, id: false do |t| 5 | t.belongs_to :user 6 | t.belongs_to :organisation 7 | end 8 | 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /db/migrate/20200418184053_no_more_than_one_org_per_user.rb: -------------------------------------------------------------------------------- 1 | class NoMoreThanOneOrgPerUser < ActiveRecord::Migration[6.0] 2 | def change 3 | 4 | drop_table :organisations_users 5 | 6 | add_reference :users, :organisation, index: true 7 | 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /db/migrate/20200419134231_create_notes.rb: -------------------------------------------------------------------------------- 1 | class CreateNotes < ActiveRecord::Migration[6.0] 2 | def change 3 | create_table :notes do |t| 4 | t.references :service, null: false, foreign_key: true 5 | t.text :body 6 | t.references :user, null: false, foreign_key: true 7 | 8 | t.timestamps 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /db/migrate/20200419153343_add_discarded_at_to_services.rb: -------------------------------------------------------------------------------- 1 | class AddDiscardedAtToServices < ActiveRecord::Migration[6.0] 2 | def change 3 | add_column :services, :discarded_at, :datetime 4 | add_index :services, :discarded_at 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20200419175240_remove_approval_tables.rb: -------------------------------------------------------------------------------- 1 | class RemoveApprovalTables < ActiveRecord::Migration[6.0] 2 | def change 3 | drop_table :approval_items 4 | drop_table :approval_comments 5 | drop_table :approval_requests 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /db/migrate/20200419190711_add_approved_to_services.rb: -------------------------------------------------------------------------------- 1 | class AddApprovedToServices < ActiveRecord::Migration[6.0] 2 | def change 3 | add_column :services, :approved, :boolean, default: true 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20200422132817_add_name_fields_to_users.rb: -------------------------------------------------------------------------------- 1 | class AddNameFieldsToUsers < ActiveRecord::Migration[6.0] 2 | def change 3 | add_column :users, :first_name, :string 4 | add_column :users, :last_name, :string 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20200422142949_devise_add_lastseenable_user.rb: -------------------------------------------------------------------------------- 1 | class DeviseAddLastseenableUser < ActiveRecord::Migration[6.0] 2 | def self.up 3 | add_column :users, :last_seen, :datetime 4 | end 5 | 6 | def self.down 7 | remove_column :users, :last_seen 8 | end 9 | end -------------------------------------------------------------------------------- /db/migrate/20200424142941_add_type_to_service.rb: -------------------------------------------------------------------------------- 1 | class AddTypeToService < ActiveRecord::Migration[6.0] 2 | def change 3 | add_column :services, :type, :string 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20200424155112_create_edits.rb: -------------------------------------------------------------------------------- 1 | class CreateEdits < ActiveRecord::Migration[6.0] 2 | def change 3 | create_table :edits do |t| 4 | t.json :object 5 | t.string :action 6 | t.references :user, null: false, foreign_key: true 7 | t.references :service, null: false, foreign_key: true 8 | 9 | t.timestamps 10 | end 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /db/migrate/20200424180425_create_send_needs.rb: -------------------------------------------------------------------------------- 1 | class CreateSendNeeds < ActiveRecord::Migration[6.0] 2 | def change 3 | create_table :send_needs do |t| 4 | t.string :name 5 | 6 | t.timestamps 7 | end 8 | 9 | create_join_table(:services, :send_needs) 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /db/migrate/20200424181255_create_accessibilities.rb: -------------------------------------------------------------------------------- 1 | class CreateAccessibilities < ActiveRecord::Migration[6.0] 2 | def change 3 | create_table :accessibilities do |t| 4 | t.string :name 5 | 6 | t.timestamps 7 | end 8 | 9 | create_join_table(:locations, :accessibilities) 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /db/migrate/20200424184944_add_discarded_at_to_service_at_locations.rb: -------------------------------------------------------------------------------- 1 | class AddDiscardedAtToServiceAtLocations < ActiveRecord::Migration[6.0] 2 | def change 3 | add_column :service_at_locations, :discarded_at, :datetime 4 | add_index :service_at_locations, :discarded_at 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20200425100452_add_valid_to_from_fields_to_service.rb: -------------------------------------------------------------------------------- 1 | class AddValidToFromFieldsToService < ActiveRecord::Migration[6.0] 2 | def change 3 | add_column :services, :visible_from, :date 4 | add_column :services, :visible_to, :date 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20200426095612_add_change_column_to_edits.rb: -------------------------------------------------------------------------------- 1 | class AddChangeColumnToEdits < ActiveRecord::Migration[6.0] 2 | def change 3 | add_column :edits, :object_changes, :json 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20200426100239_rename_edits_to_snapshots.rb: -------------------------------------------------------------------------------- 1 | class RenameEditsToSnapshots < ActiveRecord::Migration[6.0] 2 | def change 3 | rename_table :edits, :snapshots 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20200426164929_make_user_id_nullable_on_snapshots.rb: -------------------------------------------------------------------------------- 1 | class MakeUserIdNullableOnSnapshots < ActiveRecord::Migration[6.0] 2 | def change 3 | change_column :snapshots, :user_id, :integer, null: true 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20200428134029_add_google_place_id_column_to_location.rb: -------------------------------------------------------------------------------- 1 | class AddGooglePlaceIdColumnToLocation < ActiveRecord::Migration[6.0] 2 | def change 3 | add_column :locations, :google_place_id, :string 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20200429185209_add_counter_caches_for_organisation.rb: -------------------------------------------------------------------------------- 1 | class AddCounterCachesForOrganisation < ActiveRecord::Migration[6.0] 2 | def change 3 | add_column :organisations, :users_count, :integer, default: 0, null: false 4 | add_column :organisations, :services_count, :integer, default: 0, null: false 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20200429191415_add_notes_count_to_services.rb: -------------------------------------------------------------------------------- 1 | class AddNotesCountToServices < ActiveRecord::Migration[6.0] 2 | def change 3 | add_column :services, :notes_count, :integer, default: 0, null: false 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20200502142713_remove_paper_trail.rb: -------------------------------------------------------------------------------- 1 | class RemovePaperTrail < ActiveRecord::Migration[6.0] 2 | def change 3 | drop_table :versions 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20200502185553_add_discarded_at_to_users.rb: -------------------------------------------------------------------------------- 1 | class AddDiscardedAtToUsers < ActiveRecord::Migration[6.0] 2 | def change 3 | add_column :users, :discarded_at, :datetime 4 | add_index :users, :discarded_at 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20200504140413_add_old_external_id_to_users.rb: -------------------------------------------------------------------------------- 1 | class AddOldExternalIdToUsers < ActiveRecord::Migration[6.0] 2 | def change 3 | add_column :users, :old_external_id, :string 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20200505111134_add_ofsted_reference_number_to_services.rb: -------------------------------------------------------------------------------- 1 | class AddOfstedReferenceNumberToServices < ActiveRecord::Migration[6.0] 2 | def change 3 | add_column :services, :ofsted_reference_number, :string 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20200505155958_add_old_ofsted_id_to_services.rb: -------------------------------------------------------------------------------- 1 | class AddOldOfstedIdToServices < ActiveRecord::Migration[6.0] 2 | def change 3 | add_column :services, :old_ofsted_external_id, :string 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20200507081917_add_timestamps_to_ofsted_items.rb: -------------------------------------------------------------------------------- 1 | class AddTimestampsToOfstedItems < ActiveRecord::Migration[6.0] 2 | def change 3 | add_column :ofsted_items, :created_at, :datetime, null: false 4 | add_column :ofsted_items, :updated_at, :datetime, null: false 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20200507082550_change_ofsted_reference_number_to_be_int_in_services.rb: -------------------------------------------------------------------------------- 1 | class ChangeOfstedReferenceNumberToBeIntInServices < ActiveRecord::Migration[6.0] 2 | def change 3 | change_column :services, :ofsted_reference_number, 'integer USING CAST(ofsted_reference_number AS integer)' 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20200511215421_add_missing_taggable_index.acts_as_taggable_on_engine.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from acts_as_taggable_on_engine (originally 4) 2 | if ActiveRecord.gem_version >= Gem::Version.new('5.0') 3 | class AddMissingTaggableIndex < ActiveRecord::Migration[4.2]; end 4 | else 5 | class AddMissingTaggableIndex < ActiveRecord::Migration; end 6 | end 7 | AddMissingTaggableIndex.class_eval do 8 | def self.up 9 | add_index ActsAsTaggableOn.taggings_table, [:taggable_id, :taggable_type, :context], name: 'taggings_taggable_context_idx' 10 | end 11 | 12 | def self.down 13 | remove_index ActsAsTaggableOn.taggings_table, name: 'taggings_taggable_context_idx' 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /db/migrate/20200511215422_change_collation_for_tag_names.acts_as_taggable_on_engine.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from acts_as_taggable_on_engine (originally 5) 2 | # This migration is added to circumvent issue #623 and have special characters 3 | # work properly 4 | if ActiveRecord.gem_version >= Gem::Version.new('5.0') 5 | class ChangeCollationForTagNames < ActiveRecord::Migration[4.2]; end 6 | else 7 | class ChangeCollationForTagNames < ActiveRecord::Migration; end 8 | end 9 | ChangeCollationForTagNames.class_eval do 10 | def up 11 | if ActsAsTaggableOn::Utils.using_mysql? 12 | execute("ALTER TABLE #{ActsAsTaggableOn.tags_table} MODIFY name varchar(255) CHARACTER SET utf8 COLLATE utf8_bin;") 13 | end 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /db/migrate/20200512115614_create_feedbacks.rb: -------------------------------------------------------------------------------- 1 | class CreateFeedbacks < ActiveRecord::Migration[6.0] 2 | def change 3 | create_table :feedbacks do |t| 4 | t.references :service, null: false, foreign_key: true 5 | t.text :body 6 | 7 | t.timestamps 8 | end 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /db/migrate/20200512132140_add_topic_to_feedback.rb: -------------------------------------------------------------------------------- 1 | class AddTopicToFeedback < ActiveRecord::Migration[6.0] 2 | def change 3 | add_column :feedbacks, :topic, :string 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20200515105839_add_level_to_taxonomy.rb: -------------------------------------------------------------------------------- 1 | class AddLevelToTaxonomy < ActiveRecord::Migration[6.0] 2 | def change 3 | add_column :taxonomies, :level, :integer 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20200515111854_add_ancestry_to_taxonomies.rb: -------------------------------------------------------------------------------- 1 | class AddAncestryToTaxonomies < ActiveRecord::Migration[6.0] 2 | def change 3 | add_column :taxonomies, :ancestry, :string 4 | add_index :taxonomies, :ancestry 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20200515113030_remove_level_column_from_taxa.rb: -------------------------------------------------------------------------------- 1 | class RemoveLevelColumnFromTaxa < ActiveRecord::Migration[6.0] 2 | def change 3 | remove_column :taxonomies, :level 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20200517003006_create_taxonomy_hierarchies.rb: -------------------------------------------------------------------------------- 1 | class CreateTaxonomyHierarchies < ActiveRecord::Migration[6.0] 2 | def change 3 | create_table :taxonomy_hierarchies, id: false do |t| 4 | t.integer :ancestor_id, null: false 5 | t.integer :descendant_id, null: false 6 | t.integer :generations, null: false 7 | end 8 | 9 | add_index :taxonomy_hierarchies, [:ancestor_id, :descendant_id, :generations], 10 | unique: true, 11 | name: "taxonomy_anc_desc_idx" 12 | 13 | add_index :taxonomy_hierarchies, [:descendant_id], 14 | name: "taxonomy_desc_idx" 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /db/migrate/20200517003342_trash_ancestry.rb: -------------------------------------------------------------------------------- 1 | class TrashAncestry < ActiveRecord::Migration[6.0] 2 | def change 3 | remove_column :taxonomies, :ancestry 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20200519122150_drop_send_needs.rb: -------------------------------------------------------------------------------- 1 | class DropSendNeeds < ActiveRecord::Migration[6.0] 2 | def change 3 | drop_table :send_needs 4 | drop_table :send_needs_services 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20200519150122_add_report_postcodes_table.rb: -------------------------------------------------------------------------------- 1 | class AddReportPostcodesTable < ActiveRecord::Migration[6.0] 2 | def change 3 | 4 | create_table "report_postcodes", force: :cascade do |t| 5 | t.string "postcode" 6 | t.string "ward" 7 | t.string "childrens_centre" 8 | end 9 | 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /db/migrate/20200519222812_add_locked_to_taxonomies.rb: -------------------------------------------------------------------------------- 1 | class AddLockedToTaxonomies < ActiveRecord::Migration[6.0] 2 | def change 3 | add_column :taxonomies, :locked, :boolean 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20200520172953_add_visible_to_services.rb: -------------------------------------------------------------------------------- 1 | class AddVisibleToServices < ActiveRecord::Migration[6.0] 2 | def change 3 | add_column :services, :visible, :boolean 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20200520180028_add_order_to_taxonomies.rb: -------------------------------------------------------------------------------- 1 | class AddOrderToTaxonomies < ActiveRecord::Migration[6.0] 2 | def change 3 | add_column :taxonomies, :sort_order, :integer 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20200520184339_services_visible_by_default.rb: -------------------------------------------------------------------------------- 1 | class ServicesVisibleByDefault < ActiveRecord::Migration[6.0] 2 | def change 3 | change_column :services, :visible, :boolean, default: true 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20200520200727_create_local_offers.rb: -------------------------------------------------------------------------------- 1 | class CreateLocalOffers < ActiveRecord::Migration[6.0] 2 | def change 3 | create_table :local_offers do |t| 4 | t.text :description 5 | t.references :service, null: false, foreign_key: true 6 | t.string :link 7 | 8 | t.timestamps 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /db/migrate/20200523182249_create_regular_schedules.rb: -------------------------------------------------------------------------------- 1 | class CreateRegularSchedules < ActiveRecord::Migration[6.0] 2 | def change 3 | create_table :regular_schedules do |t| 4 | t.references :service, null: false, foreign_key: true 5 | t.time :opens_at 6 | t.time :closes_at 7 | t.integer :weekday 8 | 9 | t.timestamps 10 | end 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /db/migrate/20200524194826_create_cost_options.rb: -------------------------------------------------------------------------------- 1 | class CreateCostOptions < ActiveRecord::Migration[6.0] 2 | def change 3 | create_table :cost_options do |t| 4 | t.references :service, null: false, foreign_key: true 5 | t.string :option 6 | t.float :amount 7 | 8 | t.timestamps 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /db/migrate/20200524231220_add_visibility_to_contacts.rb: -------------------------------------------------------------------------------- 1 | class AddVisibilityToContacts < ActiveRecord::Migration[6.0] 2 | def change 3 | add_column :contacts, :visible, :boolean 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20200604182621_add_admin_users_to_users.rb: -------------------------------------------------------------------------------- 1 | class AddAdminUsersToUsers < ActiveRecord::Migration[6.0] 2 | def change 3 | add_column :users, :admin_users, :boolean 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20200608220535_add_visibility_to_locations.rb: -------------------------------------------------------------------------------- 1 | class AddVisibilityToLocations < ActiveRecord::Migration[6.0] 2 | def change 3 | add_column :locations, :visible, :boolean 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20200608221257_contacts_and_locations_visible_by_default.rb: -------------------------------------------------------------------------------- 1 | class ContactsAndLocationsVisibleByDefault < ActiveRecord::Migration[6.0] 2 | def change 3 | 4 | change_column :contacts, :visible, :boolean, default: true 5 | change_column :locations, :visible, :boolean, default: true 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /db/migrate/20200608222006_add_referral_checkbox_to_services.rb: -------------------------------------------------------------------------------- 1 | class AddReferralCheckboxToServices < ActiveRecord::Migration[6.0] 2 | def change 3 | add_column :services, :needs_referral, :boolean 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20200608222250_move_emails_to_contacts.rb: -------------------------------------------------------------------------------- 1 | class MoveEmailsToContacts < ActiveRecord::Migration[6.0] 2 | def change 3 | remove_column :services, :email 4 | add_column :contacts, :email, :string 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20200609192517_add_social_links_to_services.rb: -------------------------------------------------------------------------------- 1 | class AddSocialLinksToServices < ActiveRecord::Migration[6.0] 2 | def change 3 | add_column :services, :twitter_url, :string 4 | add_column :services, :facebook_url, :string 5 | add_column :services, :youtube_url, :string 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /db/migrate/20200609193155_add_mask_field_to_location.rb: -------------------------------------------------------------------------------- 1 | class AddMaskFieldToLocation < ActiveRecord::Migration[6.0] 2 | def change 3 | add_column :locations, :mask_exact_address, :boolean 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20200610132403_add_extra_social_links_to_services.rb: -------------------------------------------------------------------------------- 1 | class AddExtraSocialLinksToServices < ActiveRecord::Migration[6.0] 2 | def change 3 | add_column :services, :linkedin_url, :string 4 | add_column :services, :instagram_url, :string 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20200610132957_add_referral_url_to_services.rb: -------------------------------------------------------------------------------- 1 | class AddReferralUrlToServices < ActiveRecord::Migration[6.0] 2 | def change 3 | add_column :services, :referral_url, :string 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20200610182350_add_admin_ofsted_to_users.rb: -------------------------------------------------------------------------------- 1 | class AddAdminOfstedToUsers < ActiveRecord::Migration[6.0] 2 | def change 3 | add_column :users, :admin_ofsted, :boolean 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20200612154025_clear_cache_fields_off_service_at_location.rb: -------------------------------------------------------------------------------- 1 | class ClearCacheFieldsOffServiceAtLocation < ActiveRecord::Migration[6.0] 2 | def change 3 | remove_column :service_at_locations, :service_name 4 | remove_column :service_at_locations, :service_description 5 | remove_column :service_at_locations, :service_url 6 | remove_column :service_at_locations, :service_email 7 | remove_column :service_at_locations, :postcode 8 | remove_column :service_at_locations, :latitude 9 | remove_column :service_at_locations, :longitude 10 | remove_column :service_at_locations, :discarded_at 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /db/migrate/20200615135522_add_childcare_fields_to_service.rb: -------------------------------------------------------------------------------- 1 | class AddChildcareFieldsToService < ActiveRecord::Migration[6.0] 2 | def change 3 | add_column :services, :bccn_membership_number, :string 4 | add_column :services, :current_vacancies, :boolean 5 | add_column :services, :pick_up_drop_off_service, :boolean 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /db/migrate/20200615142458_add_marked_for_deletion_to_services.rb: -------------------------------------------------------------------------------- 1 | class AddMarkedForDeletionToServices < ActiveRecord::Migration[6.0] 2 | def change 3 | add_column :services, :marked_for_deletion, :datetime 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20200617112450_change_ofsted_nested_fields_to_jsonb.rb: -------------------------------------------------------------------------------- 1 | class ChangeOfstedNestedFieldsToJsonb < ActiveRecord::Migration[6.0] 2 | def change 3 | change_column :ofsted_items, :childcare_age, :jsonb, using: 'childcare_age::jsonb' 4 | change_column :ofsted_items, :inspection, :jsonb, using: 'inspection::jsonb' 5 | change_column :ofsted_items, :notice_history, :jsonb, using: 'notice_history::jsonb' 6 | change_column :ofsted_items, :welfare_notice_history, :jsonb, using: 'welfare_notice_history::jsonb' 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20200617175918_add_status_to_ofsted_items.rb: -------------------------------------------------------------------------------- 1 | class AddStatusToOfstedItems < ActiveRecord::Migration[6.0] 2 | def change 3 | add_column :ofsted_items, :status, :string 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20200618103747_change_bccn_membership_varchar_to_boolean.rb: -------------------------------------------------------------------------------- 1 | class ChangeBccnMembershipVarcharToBoolean < ActiveRecord::Migration[6.0] 2 | def change 3 | add_column :services, :bccn_member, :boolean, :default => false 4 | remove_column :services, :bccn_membership_number 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20200619110237_add_discarded_at_to_ofsted_items.rb: -------------------------------------------------------------------------------- 1 | class AddDiscardedAtToOfstedItems < ActiveRecord::Migration[6.0] 2 | def change 3 | add_column :ofsted_items, :discarded_at, :datetime 4 | add_index :ofsted_items, :discarded_at 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20200619164617_add_ofsted_item_id_to_service.rb: -------------------------------------------------------------------------------- 1 | class AddOfstedItemIdToService < ActiveRecord::Migration[6.0] 2 | def change 3 | add_reference :services, :ofsted_item, null: true, foreign_key: true 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20200619165342_remove_type_field_from_services.rb: -------------------------------------------------------------------------------- 1 | class RemoveTypeFieldFromServices < ActiveRecord::Migration[6.0] 2 | def change 3 | remove_column :services, :type 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20200619224151_add_phones_to_contacts.rb: -------------------------------------------------------------------------------- 1 | class AddPhonesToContacts < ActiveRecord::Migration[6.0] 2 | def change 3 | add_column :contacts, :phone, :string 4 | drop_table :phones 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20200622175307_add_survey_questions_to_local_offer.rb: -------------------------------------------------------------------------------- 1 | class AddSurveyQuestionsToLocalOffer < ActiveRecord::Migration[6.0] 2 | def change 3 | add_column :local_offers, :survey_answers, :jsonb 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20200623122942_rename_childrens_centre_to_family_centre_on_report_postcodes.rb: -------------------------------------------------------------------------------- 1 | class RenameChildrensCentreToFamilyCentreOnReportPostcodes < ActiveRecord::Migration[6.0] 2 | def change 3 | rename_column :report_postcodes, :childrens_centre, :family_centre 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20200624120857_add_free_to_services.rb: -------------------------------------------------------------------------------- 1 | class AddFreeToServices < ActiveRecord::Migration[6.0] 2 | def change 3 | add_column :services, :free, :boolean 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20200624124100_add_open_objects_external_id_to_ofsted_items.rb: -------------------------------------------------------------------------------- 1 | class AddOpenObjectsExternalIdToOfstedItems < ActiveRecord::Migration[6.0] 2 | def change 3 | add_column :ofsted_items, :open_objects_external_id, :string 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20200626144243_age_fields_on_services.rb: -------------------------------------------------------------------------------- 1 | class AgeFieldsOnServices < ActiveRecord::Migration[6.0] 2 | def change 3 | add_column :services, :min_age, :integer 4 | add_column :services, :max_age, :integer 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20200817155203_create_service_meta.rb: -------------------------------------------------------------------------------- 1 | class CreateServiceMeta < ActiveRecord::Migration[6.0] 2 | def change 3 | create_table :service_meta do |t| 4 | t.references :service, null: false, foreign_key: true 5 | t.string :key 6 | t.string :value 7 | 8 | t.timestamps 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /db/migrate/20200817205135_create_custom_fields.rb: -------------------------------------------------------------------------------- 1 | class CreateCustomFields < ActiveRecord::Migration[6.0] 2 | def change 3 | create_table :custom_fields do |t| 4 | t.string :key 5 | t.string :field_type 6 | 7 | t.timestamps 8 | end 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /db/migrate/20200928124150_create_links.rb: -------------------------------------------------------------------------------- 1 | class CreateLinks < ActiveRecord::Migration[6.0] 2 | def change 3 | create_table :links do |t| 4 | t.string :label 5 | t.string :url 6 | t.references :service, null: false, foreign_key: true 7 | 8 | t.timestamps 9 | end 10 | 11 | remove_column :services, :twitter_url 12 | remove_column :services, :facebook_url 13 | remove_column :services, :youtube_url 14 | remove_column :services, :linkedin_url 15 | remove_column :services, :instagram_url 16 | remove_column :services, :referral_url 17 | 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /db/migrate/20201001083411_add_foreign_keys_to_oauth_tables.rb: -------------------------------------------------------------------------------- 1 | class AddForeignKeysToOauthTables < ActiveRecord::Migration[6.0] 2 | def change 3 | add_foreign_key :oauth_access_grants, :users, column: :resource_owner_id 4 | add_foreign_key :oauth_access_tokens, :users, column: :resource_owner_id 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20201007001447_add_flag_to_custom_fields.rb: -------------------------------------------------------------------------------- 1 | class AddFlagToCustomFields < ActiveRecord::Migration[6.0] 2 | def change 3 | add_column :custom_fields, :public, :boolean 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20201007140013_add_service_count_to_taxonomies.rb: -------------------------------------------------------------------------------- 1 | class AddServiceCountToTaxonomies < ActiveRecord::Migration[6.0] 2 | def change 3 | add_column :taxonomies, :services_count, :integer 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20201009214941_add_instructions_to_custom_field.rb: -------------------------------------------------------------------------------- 1 | class AddInstructionsToCustomField < ActiveRecord::Migration[6.0] 2 | def change 3 | add_column :custom_fields, :hint, :string 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20201012202649_add_columns_to_versions.rb: -------------------------------------------------------------------------------- 1 | class AddColumnsToVersions < ActiveRecord::Migration[6.0] 2 | def change 3 | remove_column :versions, :object, :text 4 | remove_column :versions, :object_changes, :text 5 | 6 | add_column :versions, :object, :json 7 | add_column :versions, :object_changes, :json 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /db/migrate/20201013112151_create_custom_field_sections.rb: -------------------------------------------------------------------------------- 1 | class CreateCustomFieldSections < ActiveRecord::Migration[6.0] 2 | def change 3 | create_table :custom_field_sections do |t| 4 | t.string :name 5 | t.string :instructions 6 | 7 | t.timestamps 8 | end 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /db/migrate/20201013113037_add_foreign_key_to_custom_fields.rb: -------------------------------------------------------------------------------- 1 | class AddForeignKeyToCustomFields < ActiveRecord::Migration[6.0] 2 | def change 3 | add_reference :custom_fields, :custom_field_section, null: false, foreign_key: true 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20201013123405_move_public_onto_custom_field_sections.rb: -------------------------------------------------------------------------------- 1 | class MovePublicOntoCustomFieldSections < ActiveRecord::Migration[6.0] 2 | def change 3 | remove_column :custom_fields, :public, :boolean 4 | add_column :custom_field_sections, :public, :boolean 5 | 6 | rename_column :custom_field_sections, :instructions, :hint 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20201013160651_add_sort_to_field_sections.rb: -------------------------------------------------------------------------------- 1 | class AddSortToFieldSections < ActiveRecord::Migration[6.0] 2 | def change 3 | add_column :custom_field_sections, :sort_order, :integer 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20201013185138_add_options_to_custom_fields.rb: -------------------------------------------------------------------------------- 1 | class AddOptionsToCustomFields < ActiveRecord::Migration[6.0] 2 | def change 3 | add_column :custom_fields, :options, :string 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20201014094218_remove_columns_from_services.rb: -------------------------------------------------------------------------------- 1 | class RemoveColumnsFromServices < ActiveRecord::Migration[6.0] 2 | def change 3 | remove_column :services, :bccn_member, :boolean 4 | remove_column :services, :pick_up_drop_off_service, :boolean 5 | remove_column :services, :current_vacancies, :boolean 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /db/migrate/20201015153808_drop_snapshots_table.rb: -------------------------------------------------------------------------------- 1 | class DropSnapshotsTable < ActiveRecord::Migration[6.0] 2 | def change 3 | drop_table :snapshots 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20201020113125_add_send_needs.rb: -------------------------------------------------------------------------------- 1 | class AddSendNeeds < ActiveRecord::Migration[6.0] 2 | def change 3 | create_table :send_needs do |t| 4 | t.string :name 5 | 6 | t.timestamps 7 | end 8 | 9 | create_join_table(:services, :send_needs) 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /db/migrate/20201029134156_update_ofsted_fields_to_jsonb.rb: -------------------------------------------------------------------------------- 1 | class UpdateOfstedFieldsToJsonb < ActiveRecord::Migration[6.0] 2 | def change 3 | change_column :ofsted_items, :registration_status_history, :jsonb, using: 'registration_status_history::jsonb' 4 | change_column :ofsted_items, :child_services_register, :jsonb, using: 'child_services_register::jsonb' 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20201113131026_change_ofsted_item_reference_number_to_string.rb: -------------------------------------------------------------------------------- 1 | class ChangeOfstedItemReferenceNumberToString < ActiveRecord::Migration[6.0] 2 | def change 3 | change_column :ofsted_items, :reference_number, :string 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20210111111941_add_type_to_cost_options.rb: -------------------------------------------------------------------------------- 1 | class AddTypeToCostOptions < ActiveRecord::Migration[6.0] 2 | def change 3 | add_column :cost_options, :type, :string 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20210111150052_add_api_visibility_to_custom_field.rb: -------------------------------------------------------------------------------- 1 | class AddAPIVisibilityToCustomField < ActiveRecord::Migration[6.0] 2 | def change 3 | add_column :custom_fields, :api_public, :boolean 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20210111150054_add_api_visibility_to_custom_field_sections.rb: -------------------------------------------------------------------------------- 1 | class AddAPIVisibilityToCustomFieldSections < ActiveRecord::Migration[6.0] 2 | def change 3 | remove_column :custom_fields, :api_public 4 | add_column :custom_field_sections, :api_public, :boolean 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20210111161933_rename_type_column_on_cost_options.rb: -------------------------------------------------------------------------------- 1 | class RenameTypeColumnOnCostOptions < ActiveRecord::Migration[6.0] 2 | def change 3 | rename_column :cost_options, :type, :cost_type 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20210112135324_add_age_bands_to_services.rb: -------------------------------------------------------------------------------- 1 | class AddAgeBandsToServices < ActiveRecord::Migration[6.0] 2 | def change 3 | add_column :services, :age_band_under_2, :boolean 4 | add_column :services, :age_band_2, :boolean 5 | add_column :services, :age_band_3_4, :boolean 6 | add_column :services, :age_band_5_7, :boolean 7 | add_column :services, :age_band_8_plus, :boolean 8 | add_column :services, :age_band_all, :boolean 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /db/migrate/20210119101711_remove_linked_registration_from_ofsted_items.rb: -------------------------------------------------------------------------------- 1 | class RemoveLinkedRegistrationFromOfstedItems < ActiveRecord::Migration[6.0] 2 | def change 3 | 4 | remove_column :ofsted_items, :linked_registration, :string 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20210120142200_remove_ofsted_reference_number_and_old_ofsted_external_id_from_services.rb: -------------------------------------------------------------------------------- 1 | class RemoveOfstedReferenceNumberAndOldOfstedExternalIdFromServices < ActiveRecord::Migration[6.0] 2 | def change 3 | 4 | remove_column :services, :ofsted_reference_number, :string 5 | remove_column :services, :old_ofsted_external_id, :string 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /db/migrate/20210120142303_add_old_open_objects_external_id_to_services.rb: -------------------------------------------------------------------------------- 1 | class AddOldOpenObjectsExternalIdToServices < ActiveRecord::Migration[6.0] 2 | def change 3 | add_column :services, :old_open_objects_external_id, :string 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20210120142355_remove_certificate_condition_from_ofsted_items.rb: -------------------------------------------------------------------------------- 1 | class RemoveCertificateConditionFromOfstedItems < ActiveRecord::Migration[6.0] 2 | def change 3 | remove_column :ofsted_items, :certificate_condition, :string 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20210202115527_add_postal_preference_to_locations.rb: -------------------------------------------------------------------------------- 1 | class AddPostalPreferenceToLocations < ActiveRecord::Migration[6.0] 2 | def change 3 | add_column :locations, :preferred_for_post, :boolean 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20210202153610_add_status_to_services.rb: -------------------------------------------------------------------------------- 1 | class AddStatusToServices < ActiveRecord::Migration[6.0] 2 | def change 3 | add_column :services, :temporarily_closed, :boolean 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20210205161846_add_phone_to_users.rb: -------------------------------------------------------------------------------- 1 | class AddPhoneToUsers < ActiveRecord::Migration[6.0] 2 | def change 3 | add_column :users, :phone, :string 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20210223164623_remove_unused_ofsted_fields.rb: -------------------------------------------------------------------------------- 1 | class RemoveUnusedOfstedFields < ActiveRecord::Migration[6.0] 2 | def change 3 | remove_column :ofsted_items, :link_to_ofsted_report, :string 4 | remove_column :ofsted_items, :related_rpps, :string 5 | remove_column :ofsted_items, :prov_villagetown, :string 6 | remove_column :ofsted_items, :setting_villagetown, :string 7 | remove_column :ofsted_items, :location_ward, :string 8 | remove_column :ofsted_items, :location_planning, :string 9 | remove_column :ofsted_items, :prov_consent_withheld, :string 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /db/migrate/20210224105438_remove_last_updated_from_ofsted_item.rb: -------------------------------------------------------------------------------- 1 | class RemoveLastUpdatedFromOfstedItem < ActiveRecord::Migration[6.0] 2 | def change 3 | remove_column :ofsted_items, :lastupdated, :datetime 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20210304225518_enable_trigram_search.rb: -------------------------------------------------------------------------------- 1 | class EnableTrigramSearch < ActiveRecord::Migration[6.0] 2 | def change 3 | enable_extension "pg_trgm" 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20210305134944_mark_for_deletion_on_users.rb: -------------------------------------------------------------------------------- 1 | class MarkForDeletionOnUsers < ActiveRecord::Migration[6.0] 2 | def change 3 | add_column :users, :marked_for_deletion, :datetime 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20210423163044_add_foreign_key_to_contacts.rb: -------------------------------------------------------------------------------- 1 | class AddForeignKeyToContacts < ActiveRecord::Migration[6.0] 2 | def change 3 | add_foreign_key :contacts, :services, column: :service_id 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20210826091632_add_admin_manage_ofsted_access_to_users.rb: -------------------------------------------------------------------------------- 1 | class AddAdminManageOfstedAccessToUsers < ActiveRecord::Migration[6.0] 2 | def change 3 | add_column :users, :admin_manage_ofsted_access, :boolean, default: false, null: false 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20210901090335_create_suitabilities.rb: -------------------------------------------------------------------------------- 1 | class CreateSuitabilities < ActiveRecord::Migration[6.0] 2 | def change 3 | create_table :suitabilities do |t| 4 | t.string :name 5 | 6 | t.timestamps 7 | end 8 | 9 | create_join_table(:services, :suitabilities) 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /db/migrate/20210902162335_add_directories_column_to_services.rb: -------------------------------------------------------------------------------- 1 | class AddDirectoriesColumnToServices < ActiveRecord::Migration[6.0] 2 | def change 3 | add_column :services, :directories, :text, array: true, default: [] 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20210903151205_add_extra_text_field_for_directories.rb: -------------------------------------------------------------------------------- 1 | class AddExtraTextFieldForDirectories < ActiveRecord::Migration[6.0] 2 | def change 3 | add_column :services, :directories_as_text, :text 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20210910115333_create_directories.rb: -------------------------------------------------------------------------------- 1 | class CreateDirectories < ActiveRecord::Migration[6.0] 2 | def change 3 | create_table :directories do |t| 4 | t.string :name 5 | t.string :label 6 | 7 | t.timestamps 8 | end 9 | 10 | create_join_table(:services, :directories) 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /db/migrate/20210910133315_drop_directories_field_from_services.rb: -------------------------------------------------------------------------------- 1 | 2 | 3 | class DropDirectoriesFieldFromServices < ActiveRecord::Migration[6.0] 4 | def change 5 | remove_column :services, :directories 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /db/migrate/20210910164039_create_directory_taxonomies.rb: -------------------------------------------------------------------------------- 1 | class CreateDirectoryTaxonomies < ActiveRecord::Migration[6.0] 2 | def change 3 | create_join_table(:taxonomies, :directories) 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20210914144638_create_planning_areas.rb: -------------------------------------------------------------------------------- 1 | class CreatePlanningAreas < ActiveRecord::Migration[6.0] 2 | def change 3 | create_table :planning_areas do |t| 4 | t.string :postcode 5 | t.string :primary_planning_area 6 | end 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20220131165720_add_deleted_user_name_to_notes.rb: -------------------------------------------------------------------------------- 1 | class AddDeletedUserNameToNotes < ActiveRecord::Migration[6.0] 2 | def up 3 | add_column :notes, :deleted_user_name, :string 4 | change_column_null :notes, :user_id, true 5 | end 6 | 7 | def down 8 | remove_column :notes, :deleted_user_name 9 | 10 | # Get rid of any notes that no longer have an associated user 11 | Note.where(user_id: nil).find_each do |note| 12 | note.destroy! 13 | end 14 | 15 | change_column_null :notes, :user_id, false 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /db/migrate/20220620151849_create_settings.rb: -------------------------------------------------------------------------------- 1 | class CreateSettings < ActiveRecord::Migration[6.0] 2 | def self.up 3 | create_table :settings do |t| 4 | t.string :var, null: false 5 | t.text :value, null: true 6 | t.timestamps 7 | end 8 | 9 | add_index :settings, %i(var), unique: true 10 | end 11 | 12 | def self.down 13 | drop_table :settings 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /db/migrate/20220623112854_create_file_upload.rb: -------------------------------------------------------------------------------- 1 | class CreateFileUpload < ActiveRecord::Migration[6.0] 2 | def change 3 | create_table :file_uploads do |t| 4 | t.string :var, null: false, default: "" 5 | t.timestamps 6 | end 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20221005141547_add_superadmin_to_users.rb: -------------------------------------------------------------------------------- 1 | class AddSuperadminToUsers < ActiveRecord::Migration[6.0] 2 | def change 3 | add_column :users, :superadmin, :boolean, default: false, null: false 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20230824230543_add_foreign_key_constraint_to_active_storage_attachments_for_blob_id.active_storage.rb: -------------------------------------------------------------------------------- 1 | # This migration comes from active_storage (originally 20180723000244) 2 | class AddForeignKeyConstraintToActiveStorageAttachmentsForBlobId < ActiveRecord::Migration[6.0] 3 | def up 4 | return if foreign_key_exists?(:active_storage_attachments, column: :blob_id) 5 | 6 | if table_exists?(:active_storage_blobs) 7 | add_foreign_key :active_storage_attachments, :active_storage_blobs, column: :blob_id 8 | end 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /db/migrate/20240510133524_add_custom_fields_count_to_custom_field_sections.rb: -------------------------------------------------------------------------------- 1 | class AddCustomFieldsCountToCustomFieldSections < ActiveRecord::Migration[6.0] 2 | def change 3 | add_column :custom_field_sections, :custom_fields_count, :integer 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20240510133929_reset_all_custom_field_sections_cache_counters.rb: -------------------------------------------------------------------------------- 1 | class ResetAllCustomFieldSectionsCacheCounters < ActiveRecord::Migration[6.0] 2 | def up 3 | CustomFieldSection.all.each do |section| 4 | CustomFieldSection.reset_counters(section.id, :custom_fields) 5 | end 6 | end 7 | def down 8 | # no rollback needed 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /db/migrate/20240510153947_add_service_at_location_id_to_regular_schedules.rb: -------------------------------------------------------------------------------- 1 | class AddServiceAtLocationIdToRegularSchedules < ActiveRecord::Migration[6.0] 2 | def change 3 | add_reference :regular_schedules, :service_at_location, null: true, foreign_key: true 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20240830111345_add_i_cal_fields_to_regular_schedules.rb: -------------------------------------------------------------------------------- 1 | class AddICalFieldsToRegularSchedules < ActiveRecord::Migration[6.0] 2 | def change 3 | 4 | add_column :regular_schedules, :dtstart, :date 5 | add_column :regular_schedules, :freq, :string 6 | add_column :regular_schedules, :interval, :integer 7 | add_column :regular_schedules, :byday, :string 8 | add_column :regular_schedules, :bymonthday, :integer 9 | 10 | add_column :regular_schedules, :until, :date 11 | add_column :regular_schedules, :count, :integer 12 | 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /db/migrate/20240918091413_add_cascade_delete_to_regular_schedules.rb: -------------------------------------------------------------------------------- 1 | class AddCascadeDeleteToRegularSchedules < ActiveRecord::Migration[6.0] 2 | def change 3 | # Remove the existing foreign key constraint 4 | remove_foreign_key :regular_schedules, :service_at_locations 5 | 6 | # Add the new foreign key constraint with ON DELETE CASCADE 7 | add_foreign_key :regular_schedules, :service_at_locations, on_delete: :cascade 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /db/migrate/20241111163850_add_custom_field_label.rb: -------------------------------------------------------------------------------- 1 | class AddCustomFieldLabel < ActiveRecord::Migration[6.0] 2 | def change 3 | # Add new label column 4 | add_column :custom_fields, :label, :string 5 | 6 | # Copy data from key to label (only on up migration) 7 | reversible do |dir| 8 | dir.up do 9 | CustomField.reset_column_information 10 | CustomField.update_all('label = key') 11 | end 12 | end 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /db/migrate/20241111181710_add_service_meta_label.rb: -------------------------------------------------------------------------------- 1 | class AddServiceMetaLabel < ActiveRecord::Migration[6.0] 2 | def change 3 | # Add new label column 4 | add_column :service_meta, :label, :string 5 | 6 | # Copy data from key to label (only on up migration) 7 | reversible do |dir| 8 | dir.up do 9 | ServiceMeta.reset_column_information 10 | ServiceMeta.update_all('label = key') 11 | end 12 | end 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /docs/intro-outpost.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wearefuturegov/outpost/fd18756b7a476f414c297333dd28640fb8875c44/docs/intro-outpost.png -------------------------------------------------------------------------------- /lib/assets/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wearefuturegov/outpost/fd18756b7a476f414c297333dd28640fb8875c44/lib/assets/.keep -------------------------------------------------------------------------------- /lib/tasks/data_import/custom_fields/custom-fields-sample-data.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wearefuturegov/outpost/fd18756b7a476f414c297333dd28640fb8875c44/lib/tasks/data_import/custom_fields/custom-fields-sample-data.png -------------------------------------------------------------------------------- /lib/tasks/data_import/custom_fields/custom-fields-template--with-sample-data.csv: -------------------------------------------------------------------------------- 1 | import_id,import_id_reference,name,hint,section_sort_order,section_expose_in_public_api,section_visible_to_community_users,field_type,field_options 2 | 1,,Section name (required),Description about this section,,FALSE,FALSE,, 3 | 2,1,Text field,Description about this field,,,,text, 4 | 3,1,Checkbox field ,True or false,,,,checkbox, 5 | 4,1,Number field,number field,,,,number, 6 | 5,1,Select field,Comma separated list beware of exta commas being split into other options!,,,,select,"one, two, three" 7 | 6,1,Date fields,date picker,,,,date, -------------------------------------------------------------------------------- /lib/tasks/data_import/custom_fields/custom-fields-template.csv: -------------------------------------------------------------------------------- 1 | import_id,import_id_reference,name,hint,section_sort_order,section_expose_in_public_api,section_visible_to_community_users,field_type,field_options -------------------------------------------------------------------------------- /lib/tasks/data_import/planning_area_postcodes.rake: -------------------------------------------------------------------------------- 1 | namespace :import do 2 | desc 'Import planning area postcodes from CSV' 3 | task :planning_area_postcodes => [ :environment ] do 4 | csv_file = File.open('lib/seeds/planning_area_postcodes.csv', "r:utf-8") 5 | planning_area_postcodes_csv = CSV.parse(csv_file, headers: true) 6 | 7 | planning_area_postcodes_csv.each.with_index do |row, line| 8 | PlanningArea.create(postcode: UKPostcode.parse(row["PCNoBlanks"]).to_s, primary_planning_area: row["Planning_Area"]) 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /lib/tasks/data_import/report_postcodes.rake: -------------------------------------------------------------------------------- 1 | namespace :import do 2 | desc 'Import report postcodes from CSV' 3 | task :report_postcodes => [ :environment ] do 4 | csv_file = File.open('lib/seeds/report_postcodes.csv', "r:utf-8") 5 | report_postcodes_csv = CSV.parse(csv_file, headers: true) 6 | 7 | report_postcodes_csv.each.with_index do |row, line| 8 | ReportPostcode.create(postcode: row["postcode"], ward: row["ward"], family_centre: row["childrens_centre"]) 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /lib/tasks/data_import/users.rake: -------------------------------------------------------------------------------- 1 | namespace :import do 2 | desc 'Create users from YAML file' 3 | task :users => :environment do 4 | 5 | user_logins_yaml = Rails.root.join('lib', 'seeds', 'user_logins.yml') 6 | user_logins = YAML::load_file(user_logins_yaml) 7 | user_logins.each do |user_login| 8 | user_login["admin_users"] = true 9 | user_login["admin_ofsted"] = true 10 | unless User.find_by(email: user_login["email"]) 11 | user = User.new(user_login) 12 | user.password = "A9b#{SecureRandom.hex(8)}1yZ" unless user.password 13 | unless user.save 14 | puts "User #{user_login["email"]} failed to save: #{user.errors.messages}" 15 | end 16 | end 17 | end 18 | end 19 | 20 | end 21 | -------------------------------------------------------------------------------- /lib/tasks/services/add_parent_taxonomies.rake: -------------------------------------------------------------------------------- 1 | # bin/bundle exec rake service:add_parent_taxonomies 2 | 3 | namespace :service do 4 | desc 'Add parent taxonomies to each service' 5 | task add_parent_taxonomies: :environment do 6 | Service.find_each(batch_size: 1000) do |service| 7 | service.add_parent_taxonomies 8 | end 9 | end 10 | end -------------------------------------------------------------------------------- /log/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wearefuturegov/outpost/fd18756b7a476f414c297333dd28640fb8875c44/log/.keep -------------------------------------------------------------------------------- /postcss.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | plugins: [ 3 | require('postcss-import'), 4 | require('postcss-flexbugs-fixes'), 5 | require('postcss-preset-env')({ 6 | autoprefixer: { 7 | flexbox: 'no-2009' 8 | }, 9 | stage: 3 10 | }) 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /public/apple-touch-icon-precomposed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wearefuturegov/outpost/fd18756b7a476f414c297333dd28640fb8875c44/public/apple-touch-icon-precomposed.png -------------------------------------------------------------------------------- /public/apple-touch-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wearefuturegov/outpost/fd18756b7a476f414c297333dd28640fb8875c44/public/apple-touch-icon.png -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wearefuturegov/outpost/fd18756b7a476f414c297333dd28640fb8875c44/public/favicon.ico -------------------------------------------------------------------------------- /public/robots.txt: -------------------------------------------------------------------------------- 1 | # See https://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file 2 | -------------------------------------------------------------------------------- /sample.env: -------------------------------------------------------------------------------- 1 | # Env vars for development 2 | 3 | # ------------------ environment 4 | 5 | PROJECT_NAME=outpost_development 6 | SHOW_ENV_BANNER=outpost_development 7 | 8 | # simulate prod 9 | # run: RAILS_ENV=production rake secret 10 | # SECRET_KEY_BASE= 11 | 12 | # ------------------ emails 13 | 14 | MAILER_FROM= 15 | MAILER_HOST= 16 | 17 | NOTIFY_TEMPLATE_ID= 18 | NOTIFY_API_KEY= 19 | 20 | 21 | # ------------------ google maps/apis 22 | 23 | # (outpost_geocode_*) with the geocoding API enabled, to geocode postcodes 24 | GOOGLE_API_KEY= 25 | 26 | # (outpost_maps_*) with the javascript and static maps APIs enabled, to add map views to admin screens 27 | GOOGLE_CLIENT_KEY= 28 | 29 | # -------- node options 30 | # This is temporary until we can upgrade from webpacker. 31 | 32 | NODE_OPTIONS=--openssl-legacy-provider 33 | -------------------------------------------------------------------------------- /spec/factories/accessibility.rb: -------------------------------------------------------------------------------- 1 | FactoryBot.define do 2 | factory :accessibility do 3 | name { Faker::Lorem.word } 4 | end 5 | end -------------------------------------------------------------------------------- /spec/factories/contact.rb: -------------------------------------------------------------------------------- 1 | FactoryBot.define do 2 | factory :contact do 3 | name { Faker::Name.name } 4 | title { Faker::Lorem.word } 5 | visible { [true, false].sample } 6 | 7 | association :service 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /spec/factories/cost_option.rb: -------------------------------------------------------------------------------- 1 | FactoryBot.define do 2 | factory :cost_option do 3 | option { Faker::Lorem.sentence } 4 | amount { Faker::Number.number } 5 | 6 | association :service 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /spec/factories/custom_field.rb: -------------------------------------------------------------------------------- 1 | FactoryBot.define do 2 | factory :custom_field do 3 | label { Faker::Lorem.sentence } 4 | field_type { 'text' } 5 | custom_field_section 6 | 7 | trait :number do 8 | field_type { 'number' } 9 | end 10 | 11 | trait :checkbox do 12 | field_type { 'checkbox' } 13 | end 14 | 15 | trait :date do 16 | field_type { 'date' } 17 | end 18 | 19 | trait :select do 20 | field_type { 'select' } 21 | end 22 | end 23 | end 24 | -------------------------------------------------------------------------------- /spec/factories/custom_field_section.rb: -------------------------------------------------------------------------------- 1 | FactoryBot.define do 2 | factory :custom_field_section do 3 | name { Faker::Lorem.sentence } 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /spec/factories/directory.rb: -------------------------------------------------------------------------------- 1 | FactoryBot.define do 2 | factory :directory do 3 | end 4 | end -------------------------------------------------------------------------------- /spec/factories/feedback.rb: -------------------------------------------------------------------------------- 1 | FactoryBot.define do 2 | factory :feedback do 3 | body { Faker::Lorem.sentence } 4 | topic { ['out-of-date', 'something-else', 'extra-information-to-add', 'service-has-closed'].sample } 5 | 6 | service 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /spec/factories/link.rb: -------------------------------------------------------------------------------- 1 | FactoryBot.define do 2 | factory :link do 3 | label { ['Facebook', 'YouTube', 'Twitter', 'Instagram', 'LinkedIn'].sample } 4 | url { Faker::Internet.url } 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /spec/factories/local_offer.rb: -------------------------------------------------------------------------------- 1 | FactoryBot.define do 2 | factory :local_offer do 3 | description { Faker::Lorem.paragraph } 4 | end 5 | end -------------------------------------------------------------------------------- /spec/factories/location.rb: -------------------------------------------------------------------------------- 1 | FactoryBot.define do 2 | factory :location do 3 | name { Faker::Address.street_name } 4 | description { Faker::Lorem.paragraph } 5 | latitude { Faker::Address.latitude } 6 | longitude { Faker::Address.longitude } 7 | address_1 { Faker::Address.street_address } 8 | city { Faker::Address.city } 9 | state_province { Faker::Address.state } 10 | postal_code { 'N1 1AA' } 11 | country { Faker::Address.country } 12 | end 13 | end -------------------------------------------------------------------------------- /spec/factories/note.rb: -------------------------------------------------------------------------------- 1 | FactoryBot.define do 2 | factory :note do 3 | association :user 4 | association :service 5 | body { Faker::Lorem.sentence } 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /spec/factories/ofsted_item.rb: -------------------------------------------------------------------------------- 1 | FactoryBot.define do 2 | factory :ofsted_item do 3 | provider_name { Faker::Company.name } 4 | # Use a sequence to avoid generating the same name twice 5 | sequence(:setting_name) { |n| "#{Faker::Educator.primary_school} #{n}" } 6 | reference_number { Faker::Internet.uuid } 7 | provision_type { ['HCR', 'CMR', 'CCN', 'RPP', 'CCD'].sample } 8 | childcare_period { [] } 9 | 10 | trait :new do 11 | status { 'new' } 12 | end 13 | 14 | trait :changed do 15 | status { 'changed' } 16 | end 17 | 18 | trait :deleted do 19 | status { 'deleted' } 20 | end 21 | end 22 | end 23 | -------------------------------------------------------------------------------- /spec/factories/organisation.rb: -------------------------------------------------------------------------------- 1 | FactoryBot.define do 2 | factory :organisation do 3 | name { Faker::Company.name } 4 | description { Faker::Lorem.paragraph } 5 | url { Faker::Internet.url } 6 | 7 | factory :organisation_with_services do 8 | name { Faker::Lorem.word } 9 | description { Faker::Lorem.paragraph } 10 | url { Faker::Internet.url } 11 | 12 | after(:create) do |organisation| 13 | create_list(:service, 5, organisation: organisation) 14 | end 15 | end 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /spec/factories/regular_schedule.rb: -------------------------------------------------------------------------------- 1 | FactoryBot.define do 2 | factory :regular_schedule do 3 | opens_at { Faker::Time.between_dates(from: Date.today - 1, to: Date.today, period: :morning) } 4 | closes_at { Faker::Time.between_dates(from: Date.today - 1, to: Date.today, period: :evening) } 5 | weekday { Faker::Number.between(from: 1, to: 7) } 6 | 7 | association :service 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /spec/factories/send_need.rb: -------------------------------------------------------------------------------- 1 | FactoryBot.define do 2 | factory :send_need do 3 | name { Faker::Lorem.word } 4 | end 5 | end -------------------------------------------------------------------------------- /spec/factories/service.rb: -------------------------------------------------------------------------------- 1 | FactoryBot.define do 2 | factory :service do 3 | sequence(:name) { |n| "#{Faker::Company.name} #{n}" } 4 | 5 | description { Faker::Lorem.paragraph } 6 | url { Faker::Internet.url } 7 | after(:create) do |service| 8 | create(:location, services: [service]) 9 | end 10 | organisation 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /spec/factories/service_at_location.rb: -------------------------------------------------------------------------------- 1 | FactoryBot.define do 2 | factory :service_at_location do 3 | association :location 4 | association :service 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /spec/factories/service_meta.rb: -------------------------------------------------------------------------------- 1 | FactoryBot.define do 2 | factory :service_meta do 3 | label { Faker::Lorem.sentence } 4 | value { Faker::Number.number } 5 | end 6 | end -------------------------------------------------------------------------------- /spec/factories/service_taxonomy.rb: -------------------------------------------------------------------------------- 1 | FactoryBot.define do 2 | factory :service_taxonomy do 3 | taxonomy factory: :taxonomy 4 | end 5 | end -------------------------------------------------------------------------------- /spec/factories/service_version.rb: -------------------------------------------------------------------------------- 1 | FactoryBot.define do 2 | factory :service_version do 3 | end 4 | end 5 | -------------------------------------------------------------------------------- /spec/factories/suitability.rb: -------------------------------------------------------------------------------- 1 | FactoryBot.define do 2 | factory :suitability do 3 | name { Faker::Lorem.sentence } 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /spec/factories/taxonomy.rb: -------------------------------------------------------------------------------- 1 | FactoryBot.define do 2 | factory :taxonomy do 3 | name { Faker::Lorem.sentence } 4 | end 5 | end -------------------------------------------------------------------------------- /spec/factories/watch.rb: -------------------------------------------------------------------------------- 1 | FactoryBot.define do 2 | factory :watch do 3 | association :user 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /spec/features/managing_taxonomies_spec.rb: -------------------------------------------------------------------------------- 1 | require 'rails_helper' 2 | 3 | RSpec.describe 'Managing taxonomies', type: :feature do 4 | before do 5 | admin_user = FactoryBot.create :user, :full_admin 6 | login_as admin_user 7 | visit admin_taxonomies_path 8 | end 9 | 10 | context 'creating a new taxonomy' do 11 | let(:name) { Faker::Lorem.sentence } 12 | let(:invalid_name) { '' } 13 | 14 | it 'works' do 15 | fill_in :taxonomy_name, with: name 16 | click_button 'Create' 17 | expect(page).to have_content 'Taxonomy has been created' 18 | expect(page).to have_content name 19 | end 20 | 21 | it 'shows any errors' do 22 | fill_in :taxonomy_name, with: invalid_name 23 | click_button 'Create' 24 | expect(page).to have_content 'can\'t be blank' 25 | end 26 | end 27 | end 28 | -------------------------------------------------------------------------------- /spec/features/viewing_feedback_spec.rb: -------------------------------------------------------------------------------- 1 | require 'rails_helper' 2 | 3 | feature 'Viewing feedback', type: :feature do 4 | before do 5 | admin_user = FactoryBot.create :user, :services_admin 6 | login_as admin_user 7 | end 8 | 9 | it 'works' do 10 | service = FactoryBot.create :service 11 | feedback = FactoryBot.create :feedback, service: service 12 | 13 | visit '/admin/feedbacks' 14 | expect(page).to have_content feedback.body 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /spec/fixtures/data_import/custom_fields_valid.csv: -------------------------------------------------------------------------------- 1 | import_id,import_id_reference,name,hint,section_sort_order,section_expose_in_public_api,section_visible_to_community_users,field_type,field_options 2 | 1,,Section name (required),Description about this section,,FALSE,FALSE,, 3 | 2,1,Text field,Description about this field,,,,text, 4 | 3,1,Checkbox field ,True or false,,,,checkbox, 5 | 4,1,Number field,number field,,,,number, 6 | 5,1,Select field,Comma separated list beware of exta commas being split into other options!,,,,select,"one, two, three" 7 | 6,1,Date fields,date picker,,,,date, 8 | -------------------------------------------------------------------------------- /spec/fixtures/ofsted_response_deleted_item.json: -------------------------------------------------------------------------------- 1 | { 2 | "OfstedChildcareRegisterLocalAuthorityExtract": { 3 | "@xmlns:xs": "http://www.w3.org/2001/XMLSchema-instance", 4 | "@xmlns": "http://www.ofsted.gov.uk/Childcare/Registration/LocalAuthority", 5 | "Extract": { 6 | "ExtractDateTime": "2021-02-22T14:22:32", 7 | "LocalAuthority": { 8 | "LocalAuthorityCode": "825", 9 | "LocalAuthorityName": "Buckinghamshire" 10 | } 11 | }, 12 | "Registration": [ 13 | 14 | ] 15 | } 16 | } -------------------------------------------------------------------------------- /spec/mailers/previews/service_mailer_preview.rb: -------------------------------------------------------------------------------- 1 | class ServiceMailerPreview < ActionMailer::Preview 2 | def notify_watcher_email 3 | ServiceMailer.with(service: Watch.first.service, user: Watch.first.user).notify_watcher_email 4 | end 5 | 6 | def notify_owner_email 7 | ServiceMailer.with(service: Service.first, user: User.first).notify_owner_email 8 | end 9 | 10 | def notify_owner_of_feedback_email 11 | ServiceMailer.with(service: Feedback.first.service, feedback: Feedback.first, user: User.first).notify_owner_of_feedback_email 12 | end 13 | end 14 | 15 | -------------------------------------------------------------------------------- /spec/mailers/previews/user_mailer_preview.rb: -------------------------------------------------------------------------------- 1 | # Preview all emails at http://localhost:3000/rails/mailers/user_mailer 2 | class UserMailerPreview < ActionMailer::Preview 3 | 4 | def invite_from_admin_email 5 | UserMailer.with(user: User.first).invite_from_admin_email 6 | end 7 | 8 | def invite_from_community_email 9 | UserMailer.with(user: User.first).invite_from_community_email 10 | end 11 | 12 | def reset_instructions_email 13 | UserMailer.with(user: User.first).reset_instructions_email 14 | end 15 | 16 | end 17 | -------------------------------------------------------------------------------- /spec/models/accessibility_spec.rb: -------------------------------------------------------------------------------- 1 | require 'rails_helper' 2 | 3 | RSpec.describe Accessibility, type: :model do 4 | it { should validate_presence_of :name } 5 | it { should validate_uniqueness_of :name } 6 | end 7 | -------------------------------------------------------------------------------- /spec/models/cost_option_spec.rb: -------------------------------------------------------------------------------- 1 | require 'rails_helper' 2 | 3 | RSpec.describe CostOption, type: :model do 4 | it { should validate_presence_of :amount } 5 | end 6 | -------------------------------------------------------------------------------- /spec/models/custom_field_section_spec.rb: -------------------------------------------------------------------------------- 1 | require 'rails_helper' 2 | 3 | RSpec.describe CustomFieldSection, type: :model do 4 | it { should validate_presence_of :name } 5 | it { should validate_uniqueness_of :name } 6 | end 7 | -------------------------------------------------------------------------------- /spec/models/custom_field_spec.rb: -------------------------------------------------------------------------------- 1 | require 'rails_helper' 2 | 3 | RSpec.describe CustomField, type: :model do 4 | subject { FactoryBot.build :custom_field } 5 | 6 | it { should validate_presence_of :label } 7 | it { should validate_uniqueness_of :label } 8 | it { should validate_presence_of :field_type } 9 | end 10 | -------------------------------------------------------------------------------- /spec/models/directory_spec.rb: -------------------------------------------------------------------------------- 1 | require 'rails_helper' 2 | 3 | RSpec.describe Directory, type: :model do 4 | it { should validate_presence_of :name } 5 | it { should validate_uniqueness_of :name } 6 | it { should validate_presence_of :label } 7 | it { should validate_uniqueness_of :label } 8 | end 9 | -------------------------------------------------------------------------------- /spec/models/link_spec.rb: -------------------------------------------------------------------------------- 1 | require 'rails_helper' 2 | 3 | RSpec.describe Link, type: :model do 4 | it { should validate_presence_of :label } 5 | it { should validate_presence_of :url } 6 | end 7 | -------------------------------------------------------------------------------- /spec/models/local_offer_spec.rb: -------------------------------------------------------------------------------- 1 | require 'rails_helper' 2 | 3 | RSpec.describe LocalOffer, type: :model do 4 | it { should validate_presence_of :description } 5 | end 6 | -------------------------------------------------------------------------------- /spec/models/organisation_spec.rb: -------------------------------------------------------------------------------- 1 | require 'rails_helper' 2 | 3 | RSpec.describe Organisation, type: :model do 4 | it { should allow_value(nil).for(:name) } 5 | it { should allow_value('Some Name').for(:name) } 6 | it { should validate_uniqueness_of(:name) } 7 | it { should validate_length_of(:name).is_at_least(2).is_at_most(100).allow_nil } 8 | 9 | # This tests the behavior that multiple organisations can have a nil name. 10 | it 'allows nil names' do 11 | first = Organisation.create!(name: nil) 12 | second = Organisation.new(name: nil) 13 | 14 | expect(second).to be_valid 15 | end 16 | 17 | 18 | it 'Does not allow duplicate names' do 19 | first = Organisation.create!(name: "Organisation 1") 20 | second = Organisation.new(name: "Organisation 1") 21 | 22 | expect(second).to be_invalid 23 | end 24 | end 25 | -------------------------------------------------------------------------------- /spec/models/send_need_spec.rb: -------------------------------------------------------------------------------- 1 | require 'rails_helper' 2 | 3 | RSpec.describe SendNeed, type: :model do 4 | it { should validate_presence_of :name } 5 | it { should validate_uniqueness_of :name } 6 | end 7 | -------------------------------------------------------------------------------- /spec/models/service_meta_spec.rb: -------------------------------------------------------------------------------- 1 | require 'rails_helper' 2 | 3 | RSpec.describe ServiceMeta, type: :model do 4 | subject { FactoryBot.create :service_meta, service: FactoryBot.create(:service) } 5 | 6 | it { should validate_presence_of(:label) } 7 | it { should validate_uniqueness_of(:label).scoped_to(:service_id) } 8 | end 9 | -------------------------------------------------------------------------------- /spec/models/user_spec.rb: -------------------------------------------------------------------------------- 1 | require 'rails_helper' 2 | 3 | RSpec.describe User, type: :model do 4 | 5 | let!(:user) { FactoryBot.build(:user) } 6 | 7 | it { should validate_presence_of(:email) } 8 | it { should validate_presence_of(:first_name) } 9 | it { should validate_presence_of(:last_name) } 10 | 11 | it "won't save without password" do 12 | user.password = nil 13 | expect(user.save).to eq(false) 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /spec/requests/suggesting_feedback_spec.rb: -------------------------------------------------------------------------------- 1 | require 'rails_helper' 2 | 3 | describe 'Suggesting feedback', type: :request do 4 | let(:service) { FactoryBot.create :service } 5 | let(:admin) { FactoryBot.create :user, :services_admin } 6 | 7 | context 'logged out' do 8 | it 'renders the feedback form' do 9 | get "/services/#{service.id}/feedback" 10 | expect(response).to_not redirect_to admin_service_path service 11 | expect(response.body).to include 'Suggest an edit' 12 | end 13 | end 14 | 15 | context 'logged in as an admin' do 16 | it 'redirects to the service edit page' do 17 | sign_in admin 18 | get "/services/#{service.id}/feedback" 19 | expect(response).to redirect_to admin_service_path service 20 | end 21 | end 22 | end 23 | -------------------------------------------------------------------------------- /spec/serializers/contact_serializer_spec.rb: -------------------------------------------------------------------------------- 1 | require 'rails_helper' 2 | 3 | RSpec.describe ContactSerializer do 4 | let(:contact) { FactoryBot.create :contact } 5 | subject { described_class.new(contact) } 6 | 7 | it "includes the expected attributes" do 8 | expect(subject.attributes.keys). 9 | to contain_exactly( 10 | :id, 11 | :name, 12 | :email, 13 | :phone, 14 | :title 15 | ) 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /spec/serializers/cost_option_serializer_spec.rb: -------------------------------------------------------------------------------- 1 | require 'rails_helper' 2 | 3 | RSpec.describe CostOptionSerializer do 4 | let(:cost_option) { FactoryBot.create :cost_option } 5 | subject { described_class.new(cost_option) } 6 | 7 | it "includes the expected attributes" do 8 | expect(subject.attributes.keys). 9 | to contain_exactly( 10 | :id, 11 | :option, 12 | :amount, 13 | :cost_type 14 | ) 15 | end 16 | 17 | end 18 | -------------------------------------------------------------------------------- /spec/serializers/regular_schedule_serializer_spec.rb: -------------------------------------------------------------------------------- 1 | require 'rails_helper' 2 | 3 | RSpec.describe RegularScheduleSerializer do 4 | let(:regular_schedule) { FactoryBot.create :regular_schedule } 5 | subject { described_class.new(regular_schedule) } 6 | 7 | it "includes the expected attributes" do 8 | expect(subject.attributes.keys). 9 | to contain_exactly( 10 | :id, 11 | :weekday, 12 | :opens_at, 13 | :closes_at, 14 | :byday, 15 | :bymonthday, 16 | :count, 17 | :description, 18 | :dtstart, 19 | :freq, 20 | :interval, 21 | :until 22 | ) 23 | end 24 | 25 | end 26 | -------------------------------------------------------------------------------- /spec/serializers/taxonomy_serializer_spec.rb: -------------------------------------------------------------------------------- 1 | require 'rails_helper' 2 | 3 | RSpec.describe TaxonomySerializer do 4 | let(:taxonomy) { FactoryBot.create :taxonomy } 5 | subject { described_class.new(taxonomy) } 6 | 7 | it "includes the expected attributes" do 8 | expect(subject.attributes.keys). 9 | to contain_exactly( 10 | :id, 11 | :name, 12 | :parent_id, 13 | :slug, 14 | ) 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /spec/support/devise.rb: -------------------------------------------------------------------------------- 1 | RSpec.configure do |config| 2 | config.include Warden::Test::Helpers 3 | end 4 | -------------------------------------------------------------------------------- /spec/support/matchers/appear_before.rb: -------------------------------------------------------------------------------- 1 | RSpec::Matchers.define :appear_before do |later_content| 2 | match do |earlier_content| 3 | page.body.index(earlier_content) < page.body.index(later_content) 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /storage/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wearefuturegov/outpost/fd18756b7a476f414c297333dd28640fb8875c44/storage/.keep -------------------------------------------------------------------------------- /vendor/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wearefuturegov/outpost/fd18756b7a476f414c297333dd28640fb8875c44/vendor/.keep --------------------------------------------------------------------------------