From 206e4c71e87beab85f9479a76b2b3d10ff15fedf Mon Sep 17 00:00:00 2001 From: JG Date: Fri, 29 Jul 2022 09:15:06 +0100 Subject: [PATCH] more tests and tweaks --- app/views/users/dpo.html.erb | 27 +++++++++++++++++++++++++++ app/views/users/key_contact.html.erb | 28 ++++++++++++++++++++++++++++ 2 files changed, 55 insertions(+) create mode 100644 app/views/users/dpo.html.erb create mode 100644 app/views/users/key_contact.html.erb diff --git a/app/views/users/dpo.html.erb b/app/views/users/dpo.html.erb new file mode 100644 index 000000000..5612843e2 --- /dev/null +++ b/app/views/users/dpo.html.erb @@ -0,0 +1,27 @@ +<% content_for :title, "Is this user your organisation’s data protection officer?" %> + + +<% content_for :before_content do %> + <%= govuk_back_link(href: :back) %> +<% end %> + +<%= render partial: "organisations/headings", locals: { main: "Is this user your organisation’s data protection officer?", sub: @user.name } %> + +<%= form_for(@user, as: :user, html: { method: :patch }) do |f| %> +
+
+ <%= f.govuk_error_summary %> + + <% if current_user.data_coordinator? || current_user.support? %> + + <%= f.govuk_collection_radio_buttons :is_dpo, + [OpenStruct.new(id: true, name: "Yes"), OpenStruct.new(id: false, name: "No")], + :id, + :name, + legend: nil %> + <% end %> + + <%= f.govuk_submit "Save changes" %> +
+
+<% end %> diff --git a/app/views/users/key_contact.html.erb b/app/views/users/key_contact.html.erb new file mode 100644 index 000000000..4c69622a2 --- /dev/null +++ b/app/views/users/key_contact.html.erb @@ -0,0 +1,28 @@ +<% content_for :title, "Is this user a key contact for this service?" %> + + +<% content_for :before_content do %> + <%= govuk_back_link(href: :back) %> +<% end %> + +<%= render partial: "organisations/headings", locals: { main: "Is this user a key contact for this service?", sub: @user.name } %> + +<%= form_for(@user, as: :user, html: { method: :patch }) do |f| %> +
+
+ <%= f.govuk_error_summary %> + + <% if current_user.data_coordinator? || current_user.support? %> + + <%= f.govuk_collection_radio_buttons :is_key_contact, + [OpenStruct.new(id: true, name: "Yes"), OpenStruct.new(id: false, name: "No")], + :id, + :name, + legend: nil, + hint: { text: "This is a person responsible for sharing information about social housing lettings and sales data within the organisation." } %> + <% end %> + + <%= f.govuk_submit "Save changes" %> +
+
+<% end %>