You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
67 lines
2.1 KiB
67 lines
2.1 KiB
<% content_for :title, "Invite user to submit CORE data" %> |
|
|
|
<% content_for :before_content do %> |
|
<%= govuk_back_link( |
|
text: "Back", |
|
href: :back, |
|
) %> |
|
<% end %> |
|
|
|
<%= form_for(@resource, as: :user, html: { method: :post }) do |f| %> |
|
<div class="govuk-grid-row"> |
|
<div class="govuk-grid-column-two-thirds"> |
|
<%= f.govuk_error_summary %> |
|
|
|
<h1 class="govuk-heading-l"> |
|
<%= content_for(:title) %> |
|
</h1> |
|
|
|
<%= f.govuk_text_field :name, |
|
autocomplete: "name", |
|
label: { text: "Name (optional)" } %> |
|
|
|
<%= f.govuk_email_field :email, |
|
label: { text: "Email address" }, |
|
autocomplete: "email", |
|
spellcheck: "false", |
|
value: @resource.email %> |
|
|
|
<% if current_user.support? %> |
|
<% null_option = [OpenStruct.new(id: "", name: "Select an option")] %> |
|
<% organisations = Organisation.all.map { |org| OpenStruct.new(id: org.id, name: org.name) } %> |
|
<% answer_options = null_option + organisations %> |
|
|
|
<%= f.govuk_collection_select :organisation_id, |
|
answer_options, |
|
:id, |
|
:name, |
|
label: { text: "Organisation", size: "m" }, |
|
options: { disabled: [""], selected: "" } %> |
|
<% end %> |
|
|
|
<% roles = current_user.assignable_roles.map { |key, _| OpenStruct.new(id: key, name: key.to_s.humanize) } %> |
|
|
|
<%= f.govuk_collection_radio_buttons :role, |
|
roles, |
|
:id, |
|
:name, |
|
legend: { text: "Role", size: "m" } %> |
|
|
|
<%= f.govuk_collection_radio_buttons :is_dpo, |
|
[OpenStruct.new(id: false, name: "No"), OpenStruct.new(id: true, name: "Yes")], |
|
:id, |
|
:name, |
|
inline: true, |
|
legend: { text: "Are #{pronoun(@user, current_user)} a data protection officer?", size: "m" } %> |
|
|
|
<%= f.govuk_collection_radio_buttons :is_key_contact, |
|
[OpenStruct.new(id: false, name: "No"), OpenStruct.new(id: true, name: "Yes")], |
|
:id, |
|
:name, |
|
inline: true, |
|
legend: { text: "Are #{pronoun(@user, current_user)} a key contact?", size: "m" } %> |
|
|
|
<%= f.govuk_submit "Continue" %> |
|
</div> |
|
</div> |
|
<% end %>
|
|
|