From e23fec6c7887e5084fcd283764d3b9c1839a29da Mon Sep 17 00:00:00 2001 From: Paul Robert Lloyd Date: Mon, 11 Jul 2022 11:54:57 +0100 Subject: [PATCH] Fix whitespace --- app/views/locations/edit.html.erb | 3 - app/views/locations/index.html.erb | 3 + app/views/schemes/confirm_secondary.html.erb | 2 - app/views/schemes/details.html.erb | 128 +++++++++--------- app/views/schemes/edit_name.html.erb | 88 ++++++------ app/views/schemes/new.html.erb | 2 - .../schemes/secondary_client_group.html.erb | 8 +- app/views/schemes/support.html.erb | 2 +- 8 files changed, 116 insertions(+), 120 deletions(-) diff --git a/app/views/locations/edit.html.erb b/app/views/locations/edit.html.erb index 047b9ca6e..4d516b020 100644 --- a/app/views/locations/edit.html.erb +++ b/app/views/locations/edit.html.erb @@ -30,7 +30,6 @@ autofocus: true %> <% type_of_units_selection = Location.type_of_units.keys.map { |key, _| OpenStruct.new(id: key, name: key.to_s.humanize) } %> - <%= f.govuk_collection_radio_buttons :type_of_unit, type_of_units_selection, :id, @@ -38,7 +37,6 @@ legend: { text: "What is this type of scheme?", size: "m" } %> <% wheelchair_user_selection = Location.wheelchair_adaptations.keys.map { |key, _| OpenStruct.new(id: key, name: key.to_s.humanize) } %> - <%= f.govuk_collection_radio_buttons :wheelchair_adaptation, wheelchair_user_selection, :id, @@ -49,7 +47,6 @@ <%= govuk_section_break(visible: true, size: "m") %> <% another_location_selection = %w[Yes no].map { |key, _| OpenStruct.new(id: key, name: key.to_s.humanize) } %> - <%= f.govuk_collection_radio_buttons :add_another_location, another_location_selection, :id, diff --git a/app/views/locations/index.html.erb b/app/views/locations/index.html.erb index 0a579b4aa..3770c612a 100644 --- a/app/views/locations/index.html.erb +++ b/app/views/locations/index.html.erb @@ -1,12 +1,15 @@ <% title = @scheme.service_name %> <% content_for :title, title %> + <% content_for :before_content do %> <%= govuk_back_link( text: "Back", href: "/schemes/#{@scheme.id}", ) %> <% end %> + <%= render partial: "organisations/headings", locals: { main: @scheme.service_name, sub: nil } %> + <%= render SubNavigationComponent.new(items: scheme_items(request.path, @scheme.id, "Locations")) %> <%= govuk_table do |table| %> diff --git a/app/views/schemes/confirm_secondary.html.erb b/app/views/schemes/confirm_secondary.html.erb index b511c5a01..c145e573d 100644 --- a/app/views/schemes/confirm_secondary.html.erb +++ b/app/views/schemes/confirm_secondary.html.erb @@ -12,9 +12,7 @@ <%= form_for(@scheme, method: :patch) do |f| %>
- <% selection = [OpenStruct.new(id: "Yes", name: "Yes"), OpenStruct.new(id: "No", name: "No")] %> - <%= f.govuk_collection_radio_buttons :has_other_client_group, selection, :id, diff --git a/app/views/schemes/details.html.erb b/app/views/schemes/details.html.erb index 9e0998204..4ae640208 100644 --- a/app/views/schemes/details.html.erb +++ b/app/views/schemes/details.html.erb @@ -1,79 +1,79 @@ <% content_for :title, "Create a new supported housing scheme" %> - <% content_for :before_content do %> - <%= govuk_back_link( - text: "Back", - href: :back, - ) %> - <% end %> +<% content_for :before_content do %> + <%= govuk_back_link( + text: "Back", + href: :back, + ) %> +<% end %> - <%= render partial: "organisations/headings", locals: { main: "Create a new supported housing scheme", sub: nil } %> +<%= render partial: "organisations/headings", locals: { main: "Create a new supported housing scheme", sub: nil } %> - <%= form_for(@scheme, method: :patch) do |f| %> -
-
- <%= f.govuk_error_summary %> +<%= form_for(@scheme, method: :patch) do |f| %> +
+
+ <%= f.govuk_error_summary %> - <%= f.govuk_text_field :service_name, - label: { text: "Scheme name", size: "m" }, - hint: { text: "This is how you refer to this supported housing scheme within your organisation. For example, the name could relate to the address or location. You’ll be able to see the client group when selecting it." } %> + <%= f.govuk_text_field :service_name, + label: { text: "Scheme name", size: "m" }, + hint: { text: "This is how you refer to this supported housing scheme within your organisation. For example, the name could relate to the address or location. You’ll be able to see the client group when selecting it." } %> - <%= f.govuk_check_boxes_fieldset :sensitive, - legend: nil do %> - <%= f.govuk_check_box :sensitive, - 1, - 0, - multiple: false, - checked: @scheme.sensitive == "Yes", - label: { text: "This scheme contains confidential information" } %> - <% end %> + <%= f.govuk_check_boxes_fieldset :sensitive, + legend: nil do %> + <%= f.govuk_check_box :sensitive, + 1, + 0, + multiple: false, + checked: @scheme.sensitive == "Yes", + label: { text: "This scheme contains confidential information" } %> + <% end %> - <% null_option = [OpenStruct.new(id: "", name: "Select an option")] %> - <% organisations = Organisation.all.map { |org| OpenStruct.new(id: org.id, name: org.name) } %> - <% managing_org_answer_options = null_option + organisations %> + <% null_option = [OpenStruct.new(id: "", name: "Select an option")] %> + <% organisations = Organisation.all.map { |org| OpenStruct.new(id: org.id, name: org.name) } %> + <% managing_org_answer_options = null_option + organisations %> - <%= f.govuk_collection_select :managing_organisation_id, - managing_org_answer_options, - :id, - :name, - label: { text: "Which organisation manages this scheme?", size: "m" }, - options: { required: true }, - "data-controller": %w[accessible-autocomplete conditional-filter] %> + <%= f.govuk_collection_select :managing_organisation_id, + managing_org_answer_options, + :id, + :name, + label: { text: "Which organisation manages this scheme?", size: "m" }, + options: { required: true }, + "data-controller": %w[accessible-autocomplete conditional-filter] %> - <% if current_user.support? %> - <%= f.govuk_collection_select :owning_organisation_id, - organisations, - :id, - :name, - label: { text: "Which organisation owns the housing stock for this scheme?", size: "m" }, - "data-controller": %w[accessible-autocomplete conditional-filter] %> - <% end %> + <% if current_user.support? %> + <%= f.govuk_collection_select :owning_organisation_id, + organisations, + :id, + :name, + label: { text: "Which organisation owns the housing stock for this scheme?", size: "m" }, + "data-controller": %w[accessible-autocomplete conditional-filter] %> + <% end %> - <% if current_user.data_coordinator? %> - <%= f.hidden_field :owning_organisation_id, value: current_user.organisation.id %> - <% end %> + <% if current_user.data_coordinator? %> + <%= f.hidden_field :owning_organisation_id, value: current_user.organisation.id %> + <% end %> - <% scheme_types_selection = Scheme.scheme_types.keys.excluding("Missing").map { |key, _| OpenStruct.new(id: key, name: key.to_s.humanize) } %> + <% scheme_types_selection = Scheme.scheme_types.keys.excluding("Missing").map { |key, _| OpenStruct.new(id: key, name: key.to_s.humanize) } %> - <%= f.govuk_collection_radio_buttons :scheme_type, - scheme_types_selection, - :id, - :name, - legend: { text: "What is this type of scheme?", size: "m" } %> + <%= f.govuk_collection_radio_buttons :scheme_type, + scheme_types_selection, + :id, + :name, + legend: { text: "What is this type of scheme?", size: "m" } %> - <% care_acts_selection = Scheme.registered_under_care_acts.keys.reverse.map { |key, _| OpenStruct.new(id: key, name: key.to_s.humanize) } %> + <% care_acts_selection = Scheme.registered_under_care_acts.keys.reverse.map { |key, _| OpenStruct.new(id: key, name: key.to_s.humanize) } %> - <%= f.govuk_collection_radio_buttons :registered_under_care_act, - care_acts_selection, - :id, - :name, - legend: { text: "Is this scheme registered under the Care Standards Act 2000?", size: "m" } %> + <%= f.govuk_collection_radio_buttons :registered_under_care_act, + care_acts_selection, + :id, + :name, + legend: { text: "Is this scheme registered under the Care Standards Act 2000?", size: "m" } %> - <%= f.hidden_field :page, value: "details" %> - <% if request.query_parameters["check_answers"] %> - <%= f.hidden_field :check_answers, value: "true" %> - <% end %> - <%= f.govuk_submit "Save and continue" %> -
-
- <% end %> + <%= f.hidden_field :page, value: "details" %> + <% if request.query_parameters["check_answers"] %> + <%= f.hidden_field :check_answers, value: "true" %> + <% end %> + <%= f.govuk_submit "Save and continue" %> +
+
+<% end %> diff --git a/app/views/schemes/edit_name.html.erb b/app/views/schemes/edit_name.html.erb index 0d04a7703..876e73a25 100644 --- a/app/views/schemes/edit_name.html.erb +++ b/app/views/schemes/edit_name.html.erb @@ -1,46 +1,46 @@ <% content_for :title, "Scheme details" %> - <% content_for :before_content do %> - <%= govuk_back_link( - text: "Back", - href: :back, - ) %> - <% end %> - - <%= render partial: "organisations/headings", locals: { main: "Scheme details", sub: @scheme.service_name } %> - - <%= form_for(@scheme, method: :patch) do |f| %> -
-
- <%= f.govuk_error_summary %> - - <%= f.govuk_text_field :service_name, - label: { text: "Scheme name", size: "m" }, - hint: { text: "This is how you refer to this supported housing scheme within your organisation. For example, the name could relate to the address or location. You’ll be able to see the client group when selecting it." } %> - - <%= f.govuk_check_boxes_fieldset :sensitive, - legend: nil do %> - <%= f.govuk_check_box :sensitive, - 1, - 0, - multiple: false, - checked: @scheme.sensitive == "Yes", - label: { text: "This scheme contains confidential information" } %> - <% end %> - - <% organisations = Organisation.all.map { |org| OpenStruct.new(id: org.id, name: org.name) } %> - <% if current_user.support? %> - <%= f.govuk_collection_select :owning_organisation_id, - organisations, - :id, - :name, - label: { text: "Which organisation owns the housing stock for this scheme?", size: "m" }, - "data-controller": %w[accessible-autocomplete conditional-filter] %> - <% end %> - - <%= f.hidden_field :page, value: "edit-name" %> - - <%= f.govuk_submit "Save changes" %> -
-
- <% end %> +<% content_for :before_content do %> + <%= govuk_back_link( + text: "Back", + href: :back, + ) %> +<% end %> + +<%= render partial: "organisations/headings", locals: { main: "Scheme details", sub: @scheme.service_name } %> + +<%= form_for(@scheme, method: :patch) do |f| %> +
+
+ <%= f.govuk_error_summary %> + + <%= f.govuk_text_field :service_name, + label: { text: "Scheme name", size: "m" }, + hint: { text: "This is how you refer to this supported housing scheme within your organisation. For example, the name could relate to the address or location. You’ll be able to see the client group when selecting it." } %> + + <%= f.govuk_check_boxes_fieldset :sensitive, + legend: nil do %> + <%= f.govuk_check_box :sensitive, + 1, + 0, + multiple: false, + checked: @scheme.sensitive == "Yes", + label: { text: "This scheme contains confidential information" } %> + <% end %> + + <% organisations = Organisation.all.map { |org| OpenStruct.new(id: org.id, name: org.name) } %> + <% if current_user.support? %> + <%= f.govuk_collection_select :owning_organisation_id, + organisations, + :id, + :name, + label: { text: "Which organisation owns the housing stock for this scheme?", size: "m" }, + "data-controller": %w[accessible-autocomplete conditional-filter] %> + <% end %> + + <%= f.hidden_field :page, value: "edit-name" %> + + <%= f.govuk_submit "Save changes" %> +
+
+<% end %> diff --git a/app/views/schemes/new.html.erb b/app/views/schemes/new.html.erb index b58e461c0..297af9cef 100644 --- a/app/views/schemes/new.html.erb +++ b/app/views/schemes/new.html.erb @@ -53,7 +53,6 @@ <% end %> <% scheme_types_selection = Scheme.scheme_types.keys.excluding("Missing").map { |key, _| OpenStruct.new(id: key, name: key.to_s.humanize) } %> - <%= f.govuk_collection_radio_buttons :scheme_type, scheme_types_selection, :id, @@ -61,7 +60,6 @@ legend: { text: "What is this type of scheme?", size: "m" } %> <% care_acts_selection = Scheme.registered_under_care_acts.keys.reverse.map { |key, _| OpenStruct.new(id: key, name: key.to_s.humanize) } %> - <%= f.govuk_collection_radio_buttons :registered_under_care_act, care_acts_selection, :id, diff --git a/app/views/schemes/secondary_client_group.html.erb b/app/views/schemes/secondary_client_group.html.erb index f20051630..eb88881c4 100644 --- a/app/views/schemes/secondary_client_group.html.erb +++ b/app/views/schemes/secondary_client_group.html.erb @@ -21,10 +21,10 @@ :name, legend: nil %> - <%= f.hidden_field :page, value: "secondary-client-group" %> - <% if request.query_parameters["check_answers"] == "true" %> - <%= f.hidden_field :check_answers, value: "true" %> - <% end %> + <%= f.hidden_field :page, value: "secondary-client-group" %> + <% if request.query_parameters["check_answers"] == "true" %> + <%= f.hidden_field :check_answers, value: "true" %> + <% end %> <%= f.govuk_submit "Save and continue" %>
diff --git a/app/views/schemes/support.html.erb b/app/views/schemes/support.html.erb index b8f7a3bda..b4482bf66 100644 --- a/app/views/schemes/support.html.erb +++ b/app/views/schemes/support.html.erb @@ -28,7 +28,7 @@ :name, legend: { text: "Intended length of stay", size: "m" } %> - <%= f.hidden_field :page, value: "support" %> + <%= f.hidden_field :page, value: "support" %> <%= f.govuk_submit "Save and continue" %>