diff --git a/app/views/users/edit.html.erb b/app/views/users/edit.html.erb index 39253801a..986f9d8f9 100644 --- a/app/views/users/edit.html.erb +++ b/app/views/users/edit.html.erb @@ -40,94 +40,94 @@

<% end %> -<% if @user.errors.count > 0 %> - -<% end %> +

+ Name: <%= @user.name %> + <%= link_to edit_user_name_path(@user) do %> + Change + <% end %> +

-<%= form_for @user, :html => {:class => 'well add-top-margin'} do |f| %> -

- Name: <%= @user.name %> - <%= link_to edit_user_name_path(@user) do %> - Change - <% end %> -

+

+ Email: <%= @user.email %> + <%= link_to edit_user_email_path(@user) do %> + Change + <% end %> +

-

- Email: <%= @user.email %> - <%= link_to edit_user_email_path(@user) do %> - Change +

+ Role: <%= @user.role.humanize %> + <% if policy(User).assign_role? %> + <%= link_to edit_user_role_path(@user) do %> + Change <% end %> -

+ <% end %> +

-

- Role: <%= @user.role.humanize %> - <% if policy(User).assign_role? %> - <%= link_to edit_user_role_path(@user) do %> - Change - <% end %> +

+ Organisation: <%= @user.organisation.present? ? @user.organisation.name : Organisation::NONE %> + <% if policy(User).assign_organisation? %> + <%= link_to edit_user_organisation_path(@user) do %> + Change <% end %> -

+ <% end %> +

-

- Organisation: <%= @user.organisation.present? ? @user.organisation.name : Organisation::NONE %> - <% if policy(User).assign_organisation? %> - <%= link_to edit_user_organisation_path(@user) do %> - Change - <% end %> +

+
Account security
+
+ <% if @user.exempt_from_2sv? %> +

+ The user has been made exempt from 2-step verification for the following reason: <%= @user.reason_for_2sv_exemption %> + <% if policy(@user).exempt_from_two_step_verification? %> +
+ <%= link_to 'Edit reason or expiry date for 2-step verification exemption', edit_two_step_verification_exemption_path(@user) %> + <% end %> +

+ <% elsif @user.has_2sv? %> +

2-step verification enabled

+

+ <%= link_to 'Reset 2-step verification', edit_user_two_step_verification_reset_path(@user) %> +

+ <% elsif @user.require_2sv? %> +

2-step verification required but not set up

+ <% else %> +

2-step verification not set up

<% end %> -

-
-
Account security
-
- <% if @user.exempt_from_2sv? %> + <% unless @user.require_2sv? %> + <% if policy(@user).mandate_2sv? %>

- The user has been made exempt from 2-step verification for the following reason: <%= @user.reason_for_2sv_exemption %> - <% if policy(@user).exempt_from_two_step_verification? %> -
- <%= link_to 'Edit reason or expiry date for 2-step verification exemption', edit_two_step_verification_exemption_path(@user) %> - <% end %> + <%= link_to( + "Mandate 2-step verification for this user#{@user.exempt_from_2sv? ? ' (this will remove their exemption)' : nil}", + edit_user_two_step_verification_mandation_path(@user) + ) %>

- <% elsif @user.has_2sv? %> -

2-step verification enabled

-

- <%= link_to 'Reset 2-step verification', edit_user_two_step_verification_reset_path(@user) %> -

- <% elsif @user.require_2sv? %> -

2-step verification required but not set up

- <% else %> -

2-step verification not set up

<% end %> + <% end %> - <% unless @user.require_2sv? %> - <% if policy(@user).mandate_2sv? %> -

- <%= link_to( - "Mandate 2-step verification for this user#{@user.exempt_from_2sv? ? ' (this will remove their exemption)' : nil}", - edit_user_two_step_verification_mandation_path(@user) - ) %> -

- <% end %> - <% end %> + <% if policy(@user).exempt_from_two_step_verification? && !@user.exempt_from_2sv? %> +

+ <%= link_to 'Exempt user from 2-step verification', edit_two_step_verification_exemption_path(@user) %> +
+ Exempt a user from 2-step verification (requires a reason to be supplied). +

+ <% end %> +
+
- <% if policy(@user).exempt_from_two_step_verification? && !@user.exempt_from_2sv? %> -

- <%= link_to 'Exempt user from 2-step verification', edit_two_step_verification_exemption_path(@user) %> -
- Exempt a user from 2-step verification (requires a reason to be supplied). -

- <% end %> -
-
+<% if @user.errors.count > 0 %> + +<% end %> +<%= form_for @user, :html => {:class => 'well add-top-margin'} do |f| %>

<%= "Editable " if (current_user.publishing_manager? ) %>Permissions

<%= render partial: "shared/user_permissions", locals: { user_object: @user }%>