diff --git a/app/models/location.rb b/app/models/location.rb index 2008c5c64..f8fcbbfb6 100644 --- a/app/models/location.rb +++ b/app/models/location.rb @@ -18,8 +18,6 @@ class Location < ApplicationRecord auto_strip_attributes :name - attr_accessor :add_another_location - scope :search_by_postcode, ->(postcode) { where("REPLACE(postcode, ' ', '') ILIKE ?", "%#{postcode.delete(' ')}%") } scope :search_by_name, ->(name) { where("name ILIKE ?", "%#{name}%") } scope :search_by, ->(param) { search_by_name(param).or(search_by_postcode(param)) } diff --git a/app/views/locations/new.html.erb b/app/views/locations/new.html.erb deleted file mode 100644 index 69f56744b..000000000 --- a/app/views/locations/new.html.erb +++ /dev/null @@ -1,61 +0,0 @@ -<% content_for :title, "Add a location to this scheme" %> - -<% content_for :before_content do %> - <%= govuk_back_link( - text: "Back", - href: "/schemes/#{@scheme.id}/support", - ) %> -<% end %> - -<%= form_for(@location, method: :post, url: scheme_locations_path) do |f| %> -
-
- <%= f.govuk_error_summary %> - - <%= render partial: "organisations/headings", locals: { main: "Add a location to this scheme", sub: @scheme.service_name } %> - - <%= f.govuk_text_field :postcode, - label: { size: "m" }, - hint: { text: I18n.t("hints.location.postcode") }, - width: 5 %> - - <%= f.govuk_text_field :name, - label: { text: I18n.t("questions.location.name"), size: "m" }, - hint: { text: I18n.t("hints.location.name") } %> - - <%= f.govuk_number_field :units, - label: { text: I18n.t("questions.location.units"), size: "m" }, - width: 2, - hint: { text: I18n.t("hints.location.units") }, - autofocus: true %> - - <%= f.govuk_collection_radio_buttons :type_of_unit, - type_of_units_selection, - :id, - :name, - legend: { text: I18n.t("questions.location.type_of_unit"), size: "m" } %> - - <%= f.govuk_collection_radio_buttons :mobility_type, - mobility_type_selection, - :id, - :name, - :description, - legend: { text: I18n.t("questions.location.mobility_type"), size: "m" } %> - - <%= f.govuk_date_field :startdate, - legend: { text: I18n.t("questions.location.startdate"), size: "m" }, - width: 20 %> - - <%= govuk_section_break(visible: true, size: "m") %> - - <%= f.govuk_collection_radio_buttons :add_another_location, - another_location_selection, - :id, - :name, - inline: true, - legend: { text: I18n.t("questions.location.add_another_location"), size: "m" } %> - - <%= f.govuk_submit "Save and continue" %> -
-
-<% end %> diff --git a/config/locales/en.yml b/config/locales/en.yml index fbb373a2b..9fac1b731 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -411,7 +411,6 @@ en: units: "How many units are at this location?" type_of_unit: "What is the most common type of unit at this location?" startdate: "When did the first property in this location become available under this scheme?" - add_another_location: "Do you want to add another location?" mobility_type: "What are the mobility standards for the majority of units in this location?" toggle_active: apply_from: "When should this change apply?"