<commit_before><p class="form-group">
  <%= f.label :name %>
  <%= f.text_field :name, autofocus: true, class: 'form-control input-md-6 ' %>
</p>

<p class="form-group">
  <%= f.label :email %>
  <%= f.text_field :email, class: 'form-control input-md-6 add-label-margin' %>
  <% if f.object.persisted? %>
    <% if f.object.invited_but_not_yet_accepted? %>
      <span class="help-block">Changes will trigger a new signup email.</span>
    <% end %>
  <% end %>
</p>

<% if f.object.unconfirmed_email.present? %>
  <p class="form-group">
    <%= f.label :unconfirmed_email, "Pending email" %>
    <%= f.text_field :unconfirmed_email, readonly: "readonly", disabled: "disabled", class: 'form-control' %>

    <div class="help-block add-bottom-margin">
      <%= link_to "Resend email change", resend_email_change_user_path(f.object), :method => :put, :class => "btn btn-primary add-right-margin" %>
      <%= link_to "Cancel email change", cancel_email_change_user_path(f.object), :method => :delete, :class => "btn btn-danger" %>
    </div>
  </p>
<% end %>

<% if policy(User).assign_role? %>
  <p class="form-group">
    <%= f.label :role %><br />
    <%= f.select :role, options_for_select(filtered_user_roles.map(&:humanize).zip(filtered_user_roles), f.object.role), {}, class: "chosen-select form-control", 'data-module' => 'chosen' %>
    <span class="help-block">
      <strong>Admins</strong> can create and edit normal users.<br />
      <strong>Superadmins</strong> can create and edit all user types and edit applications.
    </span>
  </p>
<% end %>

<p class="form-group">
  <%= f.label :organisation_id, "Organisation" %><br />
  <%= f.select :organisation_id, organisation_options(f), organisation_select_options, { class: "chosen-select form-control", 'data-module' => 'chosen' } %>
</p>

<% if policy(User).flag_2sv? %>
  <p class="form-group">
    <%= f.check_box :requires_2sv %> <%= f.label :requires_2sv, "Require 2-step verification" %>
  </p>
<% end %>

<h2 class="add-vertical-margins">Permissions</h2>

<%= render partial: "shared/user_permissions", locals: { user_object: f.object }%><commit_msg>Improves positioning and markup of 2SV check box<commit_after><p class="form-group">
  <%= f.label :name %>
  <%= f.text_field :name, autofocus: true, class: 'form-control input-md-6 ' %>
</p>

<p class="form-group">
  <%= f.label :email %>
  <%= f.text_field :email, class: 'form-control input-md-6 add-label-margin' %>
  <% if f.object.persisted? %>
    <% if f.object.invited_but_not_yet_accepted? %>
      <span class="help-block">Changes will trigger a new signup email.</span>
    <% end %>
  <% end %>
</p>

<% if f.object.unconfirmed_email.present? %>
  <p class="form-group">
    <%= f.label :unconfirmed_email, "Pending email" %>
    <%= f.text_field :unconfirmed_email, readonly: "readonly", disabled: "disabled", class: 'form-control' %>

    <div class="help-block add-bottom-margin">
      <%= link_to "Resend email change", resend_email_change_user_path(f.object), :method => :put, :class => "btn btn-primary add-right-margin" %>
      <%= link_to "Cancel email change", cancel_email_change_user_path(f.object), :method => :delete, :class => "btn btn-danger" %>
    </div>
  </p>
<% end %>

<% if policy(User).assign_role? %>
  <p class="form-group">
    <%= f.label :role %><br />
    <%= f.select :role, options_for_select(filtered_user_roles.map(&:humanize).zip(filtered_user_roles), f.object.role), {}, class: "chosen-select form-control", 'data-module' => 'chosen' %>
    <span class="help-block">
      <strong>Admins</strong> can create and edit normal users.<br />
      <strong>Superadmins</strong> can create and edit all user types and edit applications.
    </span>
  </p>
<% end %>

<% if policy(User).flag_2sv? %>
  <p class="checkbox">
    <%= f.label :requires_2sv do %>
      <%= f.check_box :requires_2sv %> Require 2-step verification
    <% end %>
  </p>
<% end %>

<p class="form-group">
  <%= f.label :organisation_id, "Organisation" %><br />
  <%= f.select :organisation_id, organisation_options(f), organisation_select_options, { class: "chosen-select form-control", 'data-module' => 'chosen' } %>
</p>

<h2 class="add-vertical-margins">Permissions</h2>

<%= render partial: "shared/user_permissions", locals: { user_object: f.object }%>
{'fraction_non_alphanumeric': 0.19306815538497324, 'fraction_numerical': 0.003954408001860898, 'mean_word_length': 4.149700598802395, 'pattern_counts': {'":': 0, '<': 108, '<?xml version=': 0, '>': 120, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2961281', 'n_tokens_mistral': 1625, 'n_tokens_neox': 1501, 'n_words': 321}