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 %> -+ Name: <%= @user.name %> + <%= link_to edit_user_name_path(@user) do %> + Change name + <% end %> +
-<%= form_for @user, :html => {:class => 'well add-top-margin'} do |f| %> -- Name: <%= @user.name %> - <%= link_to edit_user_name_path(@user) do %> - Change name - <% end %> -
++ Email: <%= @user.email %> + <%= link_to edit_user_email_path(@user) do %> + Change email + <% end %> +
-- Email: <%= @user.email %> - <%= link_to edit_user_email_path(@user) do %> - Change email +
+ Role: <%= @user.role.humanize %> + <% if policy(User).assign_role? %> + <%= link_to edit_user_role_path(@user) do %> + Change role <% end %> -
+ <% end %> + -- Role: <%= @user.role.humanize %> - <% if policy(User).assign_role? %> - <%= link_to edit_user_role_path(@user) do %> - Change role - <% end %> +
+ Organisation: <%= @user.organisation.present? ? @user.organisation.name : Organisation::NONE %> + <% if policy(User).assign_organisation? %> + <%= link_to edit_user_organisation_path(@user) do %> + Change organisation <% 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 organisation - <% end %> +
+ 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 %>
+
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 %> - -
- 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)
+ ) %>
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).
+
- <%= 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).
-