Browse Source

padding for checkbox fieldset

pull/717/head
JG 3 years ago
parent
commit
a5c796f20e
  1. 2
      app/controllers/schemes_controller.rb
  2. 15
      app/views/schemes/details.html.erb
  3. 29
      app/views/schemes/edit_name.html.erb
  4. 13
      app/views/schemes/new.html.erb
  5. 1
      app/views/schemes/show.html.erb

2
app/controllers/schemes_controller.rb

@ -102,7 +102,7 @@ private
when "details" when "details"
scheme_primary_client_group_path(@scheme) scheme_primary_client_group_path(@scheme)
when "edit-name" when "edit-name"
schemes_path(@scheme) scheme_path(@scheme)
end end
end end

15
app/views/schemes/details.html.erb

@ -18,12 +18,15 @@
label: { text: "Scheme name", size: "m" }, label: { text: "Scheme name", size: "m" },
hint: { text: "This is how you’ll 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." } %> hint: { text: "This is how you’ll 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_box :sensitive, <%= f.govuk_check_boxes_fieldset :sensitive,
1, legend: { text: "This scheme contains confidential information" } do %>
0, <%= f.govuk_check_box :sensitive,
checked: @scheme.sensitive?, 1,
multiple: false, 0,
label: { text: "This scheme contains confidential information" } %> multiple: false,
checked: @scheme.sensitive == "Yes",
label: { text: "This scheme contains confidential information" } %>
<% end %>
<% null_option = [OpenStruct.new(id: "", name: "Select an option")] %> <% null_option = [OpenStruct.new(id: "", name: "Select an option")] %>
<% organisations = Organisation.all.map { |org| OpenStruct.new(id: org.id, name: org.name) } %> <% organisations = Organisation.all.map { |org| OpenStruct.new(id: org.id, name: org.name) } %>

29
app/views/schemes/edit_name.html.erb

@ -18,24 +18,19 @@
label: { text: "Scheme name", size: "m" }, label: { text: "Scheme name", size: "m" },
hint: { text: "This is how you’ll 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." } %> hint: { text: "This is how you’ll 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_box :sensitive,
1,
0, <%= f.govuk_check_boxes_fieldset :sensitive,
checked: @scheme.sensitive?, legend: { text: "This scheme contains confidential information" } do %>
multiple: false, <%= f.govuk_check_box :sensitive,
label: { text: "This scheme contains confidential information" } %> 1,
0,
<% null_option = [OpenStruct.new(id: "", name: "Select an option")] %> 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) } %> <% 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] %>
<% if current_user.support? %> <% if current_user.support? %>
<%= f.govuk_collection_select :owning_organisation_id, <%= f.govuk_collection_select :owning_organisation_id,

13
app/views/schemes/new.html.erb

@ -20,11 +20,14 @@
label: { text: "Scheme name", size: "m" }, 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." } %> 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_box :sensitive, <%= f.govuk_check_boxes_fieldset :sensitive,
"Yes", legend: { text: "This scheme contains confidential information" } do %>
checked: @scheme.sensitive?, <%= f.govuk_check_box :sensitive,
multiple: false, 1,
label: { text: "This scheme contains confidential information" } %> 0,
multiple: false,
label: { text: "This scheme contains confidential information" } %>
<% end %>
<% null_option = [OpenStruct.new(id: "", name: "Select an option")] %> <% null_option = [OpenStruct.new(id: "", name: "Select an option")] %>
<% organisations = Organisation.all.map { |org| OpenStruct.new(id: org.id, name: org.name) } %> <% organisations = Organisation.all.map { |org| OpenStruct.new(id: org.id, name: org.name) } %>

1
app/views/schemes/show.html.erb

@ -16,6 +16,7 @@
<div class="govuk-grid-column-two-thirds"> <div class="govuk-grid-column-two-thirds">
<%= govuk_summary_list do |summary_list| %> <%= govuk_summary_list do |summary_list| %>
<% @scheme.display_attributes.each do |attr| %> <% @scheme.display_attributes.each do |attr| %>
<% next if current_user.data_coordinator? && attr[:name] == ("Housing stock owned by") %>
<%= summary_list.row do |row| %> <%= summary_list.row do |row| %>
<% row.key { attr[:name].eql?("Registered under Care Standards Act 2000") ? "Registered under Care Standards Act 2000" : attr[:name].to_s.humanize } %> <% row.key { attr[:name].eql?("Registered under Care Standards Act 2000") ? "Registered under Care Standards Act 2000" : attr[:name].to_s.humanize } %>
<% row.value { details_html(attr) } %> <% row.value { details_html(attr) } %>

Loading…
Cancel
Save