<commit_before><%#
  DMPTool customization overview:
  ------------------------------------------
  1. Added default_org var
  2. Added if 'shibbolized' check for Org selector/text
  3. Removed shib account linking link
 %>
<% default_org = Org.find_by(is_other: true) %>
<%= form_for(resource, namespace: current_user.id, as: resource_name, url: registration_path(resource_name), html: {method: :put, id: 'personal_details_registration_form' }) do |f| %>
  <p class="form-control-static">
    <%= sanitize _("Please note that your email address is also your username. If you change this remember to use your new email address on sign in. If your account is created with your institutional credentials you must contact us to change your email or organisation.") %>
  </p>

  <%= hidden_field_tag :unlink_flag, "false", id: 'unlink_flag' %>

  <div class="form-group col-xs-8">
    <%= f.label(:email, _('Email'), class: 'control-label') %>
    <% if shibbolized %>
      <%= render partial: 'shared/popover',
                 locals: { message: _('Your account is linked to your institutional credentials for login. Please contact the helpdesk to change your email.'), placement: 'right' } %>
      <input type="email" class="form-control" aria-required="true" value="<%= @user.email %>" disabled />
      <input type="hidden" name="user[email]" id="user_email" value="<%= @user.email %>" />
    <% else %>
      <%= f.email_field(:email, class: "form-control", "aria-required": true, value: @user.email) %>
    <% end %>
    <%= hidden_field_tag :original_email, @user.email %>
  </div>

  <div class="form-group col-xs-8">
    <%= f.label(:firstname, _('First name'), class: 'control-label') %>
    <%= f.text_field(:firstname, class: "form-control", "aria-required": true, value: @user.firstname) %>
  </div>

  <div class="form-group col-xs-8">
    <%= f.label(:surname, _('Last name'), class: 'control-label') %>
    <%= f.text_field(:surname, class: "form-control", "aria-required": true, value: @user.surname) %>
  </div>

  <div class="form-group col-xs-8" id="org-controls">
    <% if shibbolized %>
      <label class="control-label"><%= _('Organisation') %></label>
      <%= render partial: 'shared/popover',
                 locals: { message: _('Your account is linked to your institutional credentials for login. Please contact the helpdesk to change your organisation.'), placement: 'right' } %>
      <input type="text" disabled="true" value="<%= @default_org.name if @default_org.present? %>" class="form-control" />
      <input type="hidden" name="user[org_id]" id="user_org_id" value="<%= current_user.org_id %>">
    <% else %>
      <%= render partial: "shared/my_org",
                 locals: {
                  f: f,
                  default_org: current_user.org.is_other? ? nil : current_user.org,
                  orgs: Org.participating,
                  allow_other_orgs: true
                } %>
    <% end %>

    <% departments = current_user.org.departments.order(:name) %>
    <% if departments.count > 0 %>
      <div class="form-group col-xs-8">
        <% dept_id = current_user.department.nil? ? -1 : current_user.department.id  %>
        <%= f.label(:department_id, _('Department or school'), class: 'control-label') %>
        <%= select_tag("user[department_id]", options_from_collection_for_select(departments, "id", "name", dept_id), include_blank: true, disabled: departments.count === 0, class: "form-control") %>
      </div>
    <% end %>
  </div>

  <% if Language.many? %>
    <div class="form-group col-xs-8">
      <% lang_id = current_user.language.nil? ? Language.id_for(FastGettext.default_locale) : current_user.language.id %><commit_msg>fixed issue with html layout of user profile<commit_after><%#
  DMPTool customization overview:
  ------------------------------------------
  1. Added default_org var
  2. Added if 'shibbolized' check for Org selector/text
  3. Removed shib account linking link
 %>
<% default_org = Org.find_by(is_other: true) %>
<%= form_for(resource, namespace: current_user.id, as: resource_name, url: registration_path(resource_name), html: {method: :put, id: 'personal_details_registration_form' }) do |f| %>
  <p class="form-control-static">
    <%= sanitize _("Please note that your email address is also your username. If you change this remember to use your new email address on sign in. If your account is created with your institutional credentials you must contact us to change your email or organisation.") %>
  </p>

  <%= hidden_field_tag :unlink_flag, "false", id: 'unlink_flag' %>

  <div class="form-group col-xs-8">
    <%= f.label(:email, _('Email'), class: 'control-label') %>
    <% if shibbolized %>
      <%= render partial: 'shared/popover',
                 locals: { message: _('Your account is linked to your institutional credentials for login. Please contact the helpdesk to change your email.'), placement: 'right' } %>
      <input type="email" class="form-control" aria-required="true" value="<%= @user.email %>" disabled />
      <input type="hidden" name="user[email]" id="user_email" value="<%= @user.email %>" />
    <% else %>
      <%= f.email_field(:email, class: "form-control", "aria-required": true, value: @user.email) %>
    <% end %>
    <%= hidden_field_tag :original_email, @user.email %>
  </div>

  <div class="form-group col-xs-8">
    <%= f.label(:firstname, _('First name'), class: 'control-label') %>
    <%= f.text_field(:firstname, class: "form-control", "aria-required": true, value: @user.firstname) %>
  </div>

  <div class="form-group col-xs-8">
    <%= f.label(:surname, _('Last name'), class: 'control-label') %>
    <%= f.text_field(:surname, class: "form-control", "aria-required": true, value: @user.surname) %>
  </div>

  <div class="form-group col-xs-8" id="org-controls">
    <% if shibbolized %>
      <label class="control-label"><%= _('Organisation') %></label>
      <%= render partial: 'shared/popover',
                 locals: { message: _('Your account is linked to your institutional credentials for login. Please contact the helpdesk to change your organisation.'), placement: 'right' } %>
      <input type="text" disabled="true" value="<%= @default_org.name if @default_org.present? %>" class="form-control" />
      <input type="hidden" name="user[org_id]" id="user_org_id" value="<%= current_user.org_id %>">
    <% else %>
      <%= render partial: "shared/my_org",
                 locals: {
                  f: f,
                  default_org: current_user.org.is_other? ? nil : current_user.org,
                  orgs: Org.participating,
                  allow_other_orgs: true
                } %>
    <% end %>
  </div>

  <% departments = current_user.org.departments.order(:name) %>
  <% if departments.count > 0 %>
    <div class="form-group col-xs-8">
      <% dept_id = current_user.department.nil? ? -1 : current_user.department.id  %>
      <%= f.label(:department_id, _('Department or school'), class: 'control-label') %>
      <%= select_tag("user[department_id]", options_from_collection_for_select(departments, "id", "name", dept_id), include_blank: true, disabled: departments.count === 0, class: "form-control") %>
    </div>
  <% end %>

  <% if Language.many? %>
    <div class="form-group col-xs-8">
      <% lang_id = current_user.language.nil? ? Language.id_for(FastGettext.default_locale) : current_user.language.id %>
{'fraction_non_alphanumeric': 0.1760819738438722, 'fraction_numerical': 0.003235809626533639, 'mean_word_length': 3.332943925233645, 'pattern_counts': {'":': 6, '<': 109, '<?xml version=': 0, '>': 111, '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': '4229915', 'n_tokens_mistral': 2461, 'n_tokens_neox': 2281, 'n_words': 587}