diff --git a/app/views/users/_form_fields.html.erb b/app/views/users/_form_fields.html.erb deleted file mode 100644 index 17e6897f8..000000000 --- a/app/views/users/_form_fields.html.erb +++ /dev/null @@ -1,82 +0,0 @@ -

- 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 %> -

- -

- Role: <%= @user.role.humanize %> - <% if policy(User).assign_role? %> - <%= link_to edit_user_role_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 %> - <% 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 %> - - <% 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 %> -
-
- -

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

-<%= render partial: "shared/user_permissions", locals: { user_object: @user }%> - -<% if current_user.publishing_manager? %> -

All Permissions for this user

- <%= render partial: "app_permissions", locals: { user_object: @user }%> -<% end %> diff --git a/app/views/users/edit.html.erb b/app/views/users/edit.html.erb index e56667cf8..39253801a 100644 --- a/app/views/users/edit.html.erb +++ b/app/views/users/edit.html.erb @@ -53,7 +53,88 @@ <% end %> <%= form_for @user, :html => {:class => 'well add-top-margin'} do |f| %> - <%= render partial: "form_fields", locals: { f: 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 %> +

+ +

+ Role: <%= @user.role.humanize %> + <% if policy(User).assign_role? %> + <%= link_to edit_user_role_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 %> + <% 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 %> + + <% 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 %> +
+
+ +

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

+ <%= render partial: "shared/user_permissions", locals: { user_object: @user }%> + + <% if current_user.publishing_manager? %> +

All Permissions for this user

+ <%= render partial: "app_permissions", locals: { user_object: @user }%> + <% end %>