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.
107 lines
3.7 KiB
107 lines
3.7 KiB
<% content_for :title, current_user == @user ? "Your account" : "#{@user.name.presence || @user.email}’s account" %> |
|
|
|
<div class="govuk-grid-row"> |
|
<div class="govuk-grid-column-two-thirds"> |
|
<h1 class="govuk-heading-l"> |
|
<%= content_for(:title) %> |
|
</h1> |
|
<p> |
|
<% if current_user.can_toggle_active?(@user) %> |
|
<% if @user.active? %> |
|
<%= govuk_link_to "Deactivate user", "/users/#{@user.id}/deactivate" %> |
|
<% else %> |
|
<span class="app-!-colour-muted govuk-!-margin-right-2"> |
|
This user has been deactivated. <%= govuk_link_to "Reactivate user", "/users/#{@user.id}/reactivate" %> |
|
</span> |
|
<% end %> |
|
<% end %> |
|
</p> |
|
|
|
<h2 class="govuk-heading-m"> |
|
Personal details |
|
</h2> |
|
<%= govuk_summary_list do |summary_list| %> |
|
<%= summary_list.row do |row| |
|
row.key { "Name" } |
|
row.value { @user.name } |
|
if can_edit_names?(@user, current_user) |
|
row.action(visually_hidden_text: "name", href: aliased_user_edit(@user, current_user), html_attributes: { "data-qa": "change-name" }) |
|
else |
|
row.action |
|
end |
|
end %> |
|
|
|
<%= summary_list.row do |row| |
|
row.key { "Email address" } |
|
row.value { @user.email } |
|
if can_edit_emails?(@user, current_user) |
|
row.action(visually_hidden_text: "email address", href: aliased_user_edit(@user, current_user), html_attributes: { "data-qa": "change-email-address" }) |
|
else |
|
row.action |
|
end |
|
end %> |
|
|
|
<%= summary_list.row do |row| |
|
row.key { "Password" } |
|
row.value { "••••••••" } |
|
if can_edit_password?(@user, current_user) |
|
row.action( |
|
visually_hidden_text: "password", |
|
href: edit_password_account_path, |
|
html_attributes: { "data-qa": "change-password" }, |
|
) |
|
else |
|
row.action |
|
end |
|
end %> |
|
|
|
<%= summary_list.row do |row| |
|
row.key { "Organisation" } |
|
row.value { @user.organisation.name } |
|
row.action |
|
end %> |
|
|
|
<%= summary_list.row do |row| |
|
row.key { "Role" } |
|
row.value { @user.role&.humanize } |
|
if can_edit_roles?(@user, current_user) |
|
row.action( |
|
visually_hidden_text: "role", |
|
href: aliased_user_edit(@user, current_user), |
|
html_attributes: { "data-qa": "change-role" }, |
|
) |
|
else |
|
row.action |
|
end |
|
end %> |
|
|
|
<%= summary_list.row do |row| |
|
row.key { "Data protection officer" } |
|
row.value { @user.is_data_protection_officer? ? "Yes" : "No" } |
|
if can_edit_dpo?(@user, current_user) |
|
row.action( |
|
visually_hidden_text: "if data protection officer", |
|
href: user_edit_dpo_path(@user), |
|
html_attributes: { "data-qa": "change-data-protection-officer" }, |
|
) |
|
else |
|
row.action |
|
end |
|
end %> |
|
|
|
<%= summary_list.row do |row| |
|
row.key { "Key contact" } |
|
row.value { @user.is_key_contact? ? "Yes" : "No" } |
|
if can_edit_key_contact?(@user, current_user) |
|
row.action( |
|
visually_hidden_text: "if a key contact", |
|
href: user_edit_key_contact_path(@user), |
|
html_attributes: { "data-qa": "change-key-contact" }, |
|
) |
|
else |
|
row.action |
|
end |
|
end %> |
|
<% end %> |
|
</div> |
|
</div>
|
|
|