(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 |
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 |
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 | From
5 | To
6 | Max
7 | Register
8 |
9 |
10 | <% t.each do |r| %>
11 |
12 | <%= r["AgeFrom"] %>
13 | <%= r["AgeTo"] %>
14 | <%= r["MaximumNumber"] %>
15 | <%= @item.human_readable_register(r["Register"]) %>
16 |
17 | <% end %>
18 |
19 |
20 | <% else %>
21 | Nothing to show
22 | <% end %>
--------------------------------------------------------------------------------
/app/views/admin/ofsted/_mini-table-inspections.html.erb:
--------------------------------------------------------------------------------
1 | <% if t.present? %>
2 |
3 |
4 | Date
5 | Type
6 | Judgement
7 |
8 |
9 | <% t.each do |r| %>
10 |
11 | <%= format_if_date(r['InspectionDate']) %>
12 | <%= r['InspectionType'] %>
13 | <%= r['InspectionOverallJudgement'] %>
14 |
15 | <% end %>
16 |
17 |
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 | Change date
5 | Registration status
6 |
7 |
8 | <% t.each do |r| %>
9 |
10 |
11 | <%= format_if_date(r["ChangeDate"]) %>
12 |
13 |
14 | <%= @item.human_readable_registration_status(r["RegistrationStatus"]) %>
15 |
16 |
17 | <% end %>
18 |
19 |
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 | Category
5 | Start date
6 | End date
7 |
8 |
9 | <% t.each do |r| %>
10 |
11 | <%= r["WelfareCategory"] %>
12 | <%= format_if_date(r["WelfareStartDate"]) %>
13 | <%= format_if_date(r["WelfareEndDate"]) %>
14 |
15 | <% end %>
16 |
17 |
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 | <%= key.humanize %>
7 | <% end %>
8 |
9 |
10 | <% t.each do |r| %>
11 |
12 | <% r.map do |key, value| %>
13 |
14 | <%= format_if_date(value) %>
15 |
16 | <% end %>
17 |
18 | <% end %>
19 |
20 |
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 |
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 |
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 |
6 | <%= s.fields_for :contacts do |c| %>
7 |
8 | <%= render "admin/services/editors/contacts-fields", c: c %>
9 |
10 | <% end %>
11 |
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 | Remove this link
17 |
--------------------------------------------------------------------------------
/app/views/admin/services/editors/_links.html.erb:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | <%= mark_unapproved_array("links") do %>
10 |
11 |
12 |
13 | <%= s.fields_for :links do |c| %>
14 |
15 | <%= render "admin/services/editors/links-fields", c: c %>
16 |
17 | <% end %>
18 |
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 |
4 | <%= s.fields_for :locations do |l| %>
5 |
6 | <%= render "admin/services/editors/location-fields", l: l %>
7 |
8 | <% end %>
9 |
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 |
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 |
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 |
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 |
6 |
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 |
6 |
7 | <% end %>
8 |
9 | <%= render "form" %>
--------------------------------------------------------------------------------
/app/views/organisations/new.html.erb:
--------------------------------------------------------------------------------
1 | <% content_for :header do %>
2 |
3 |
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 |
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 | Continue
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 |
6 |
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 | Continue
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 |
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 | Continue
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 |
6 |
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 | Continue
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 |
6 |
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 | Continue
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 |
6 |
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 | Continue
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 |
Help with this section
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 |
7 | <% model.errors.full_messages.each do |e| %>
8 | <%= e.html_safe %>
9 | <% end %>
10 |
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 |
2 | <%= u.initials %>
3 | <% if u.last_seen && u.last_seen > (Time.now - 10.minutes) %>
4 |
5 | <% end %>
6 |
--------------------------------------------------------------------------------
/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
--------------------------------------------------------------------------------