<commit_before><script type="text/javascript" charset="utf-8">

    function confirmBlacklisted() {
        $(".devices :checkbox").each(function () {
            if (this.checked && !this.defaultChecked)
                return confirm(I18n.t("devices.message.disable"));
        });
        return true;
    }

    function confirmDisable() {
        var checkbox = $("#user_disabled")[0];
        if (checkbox.checked && !checkbox.defaultChecked) {
            return confirm(I18n.t("users.messages.disable"));
        }
        return true;
    }

    $(document).ready(function () {
        $("form").submit(function () {
            return (confirmDisable() && confirmBlacklisted());
        });
    });
</script>

<% if flash[:verify] %>
<div class='flash'>
  <p class='notice'><%= flash[:verify] %></p>
</div>
<% end %>
<%= form_for editable_user, :html => {:class => ''} do |f| %>
    <%= f.error_messages :header_tag => :h3 %>
    <% trying_to_edit_ourself = editing_ourself?(editable_user) %>


    <div class="mandate_panel"><span>*</span> <%= t("mandatory_field") %> </div>
    <div class="clearfix"></div>
    <fieldset>
    <p>
      <%= f.label :full_name, t("user.full_name"), :class=>'key' %>
      <%= f.text_field :full_name, :autocomplete => "off"%>*
    </p>

    <p>
      <%= f.label  :user_name, t("login.username"), :class=>'key'  %>
      <%= f.text_field :user_name, :disabled => !editable_user.new_record?, :autocomplete => "off" %>*
      <span class="footnote"><%= t("user.no_blank") %></span>
    </p>

    <p>
      <%= f.label :password, t('login.password.label'), :class=>'key'  %>
      <%= f.password_field :password, :autocomplete => "off" %>
    </p>

    <p>
      <%= f.label :password_confirmation,t("login.password.re_enter"), :class=>'key'  %>
      <%= f.password_field :password_confirmation, :autocomplete => "off" %>
    </p>

    <% if !trying_to_edit_ourself %>
      <p>
        <label class="key"><%= t("roles.label") %></label>
      <% @roles.each do |role| %>
        <%= f.check_box :role_ids, {:id => "user_#{role.name}", :name => "user[role_ids][]"}, role.id, "" %>
          <%= f.label role.name %>
      <% end %>
      </p>
    <% end %>

    <p>
      <%= f.label :phone, t("phone"), :class=>'key'  %>
      <%= f.text_field :phone %>
    </p>
    <p>
      <%= f.label :email, t("email"), :class=>'key'  %>
      <%= f.text_field :email %>
    </p>

    <p>
      <%= f.label :organisation, t("organisation"), :class=>'key'  %>
      <%= f.text_field :organisation %>*
    </p>

    <p>
      <%= f.label :position, t("position"), :class=>'key'  %>
      <%= f.text_field :position %>
    </p>

    <p>
      <%= f.label :location, t("location"), :class=>'key'  %>
      <%= f.text_field :location %>
    </p>

    <% if !trying_to_edit_ourself && can?(:disable, @user) %>
        <p>
          <%= f.label :disabled, t("user.disabled"), :class=>'key' %>
          <%= f.check_box :disabled, {}, "true", "false" %>
        </p>
    <% end %>

    <%= f.hidden_field :verified, :value => true %>

    </fieldset>

    <div class="btn_panel">
    <!--TODO: After we got the user object in the session replace the DB query with User object-->
      <%= cancel_button(users_path) %>
      <%= submit_button(editable_user.new_record? ? t("user.create") : (params[:verify] ? t('user.verify') : t('user.update'))) %>
    </div>
<% end %>
<commit_msg>bug 1822<commit_after><script type="text/javascript" charset="utf-8">

    function confirmBlacklisted() {
        $(".devices :checkbox").each(function () {
            if (this.checked && !this.defaultChecked)
                return confirm(I18n.t("devices.message.disable"));
        });
        return true;
    }

    function confirmDisable() {
        var checkbox = $("#user_disabled")[0];
        if (checkbox.checked && !checkbox.defaultChecked) {
            return confirm(I18n.t("users.messages.disable"));
        }
        return true;
    }

    $(document).ready(function () {
        $("form").submit(function () {
            return (confirmDisable() && confirmBlacklisted());
        });
    });
</script>

<% if flash[:verify] %>
<div class='flash'>
  <p class='notice'><%= flash[:verify] %></p>
</div>
<% end %>
<%= form_for editable_user, :html => {:class => ''} do |f| %>
    <%= f.error_messages :header_tag => :h3 %>
    <% trying_to_edit_ourself = editing_ourself?(editable_user) %>


    <div class="mandate_panel"><span>*</span> <%= t("mandatory_field") %> </div>
    <div class="clearfix"></div>
    <fieldset>
    <p>
      <%= f.label :full_name, t("user.full_name"), :class=>'key' %>
      <%= f.text_field :full_name, :autocomplete => "off"%>*
    </p>

    <p>
      <%= f.label  :user_name, t("login.username"), :class=>'key'  %>
      <%= f.text_field :user_name, :disabled => !editable_user.new_record?, :autocomplete => "off" %>*
      <span class="footnote"><%= t("user.no_blank") %></span>
    </p>

    <p>
      <%= f.label :password, t('login.password.label'), :class=>'key'  %>
      <%= f.password_field :password, :autocomplete => "off" %>*
    </p>

    <p>
      <%= f.label :password_confirmation,t("login.password.re_enter"), :class=>'key'  %>
      <%= f.password_field :password_confirmation, :autocomplete => "off" %>*
    </p>

    <% if !trying_to_edit_ourself %>
      <p>
        <label class="key"><%= t("roles.label") %></label>
      <% @roles.each do |role| %>
        <%= f.check_box :role_ids, {:id => "user_#{role.name}", :name => "user[role_ids][]"}, role.id, "" %>
          <%= f.label role.name %>
      <% end %>
      </p>
    <% end %>

    <p>
      <%= f.label :phone, t("phone"), :class=>'key'  %>
      <%= f.text_field :phone %>
    </p>
    <p>
      <%= f.label :email, t("email"), :class=>'key'  %>
      <%= f.text_field :email %>
    </p>

    <p>
      <%= f.label :organisation, t("organisation"), :class=>'key'  %>
      <%= f.text_field :organisation %>*
    </p>

    <p>
      <%= f.label :position, t("position"), :class=>'key'  %>
      <%= f.text_field :position %>
    </p>

    <p>
      <%= f.label :location, t("location"), :class=>'key'  %>
      <%= f.text_field :location %>
    </p>

    <% if !trying_to_edit_ourself && can?(:disable, @user) %>
        <p>
          <%= f.label :disabled, t("user.disabled"), :class=>'key' %>
          <%= f.check_box :disabled, {}, "true", "false" %>
        </p>
    <% end %>

    <%= f.hidden_field :verified, :value => true %>

    </fieldset>

    <div class="btn_panel">
    <!--TODO: After we got the user object in the session replace the DB query with User object-->
      <%= cancel_button(users_path) %>
      <%= submit_button(editable_user.new_record? ? t("user.create") : (params[:verify] ? t('user.verify') : t('user.update'))) %>
    </div>
<% end %>

{'fraction_non_alphanumeric': 0.2258775150536055, 'fraction_numerical': 0.0026435599941254224, 'mean_word_length': 2.6652314316469323, 'pattern_counts': {'":': 0, '<': 171, '<?xml version=': 0, '>': 213, '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': '2351464', 'n_tokens_mistral': 2564, 'n_tokens_neox': 2370, 'n_words': 429}