<commit_before><%= form_for(@user, :url => {:controller => 'users', :action => 'update', :id => @user.id}, :html => {:class => 'form-horizontal', :multipart => true, :data => {:abide => true}}) do |f| %>
  <div class="pane3-padding">
    <div class="row">
      <div class="col-sm-12">
        <div class="project-card">
          <div class="card-block">
            <div class="form-content form-below">
              <% if @user.errors.any? %>
                  <div id="error_explanation">
                    <% @user.errors.full_messages.each do |msg| %>
                        <li><%= msg %></li>
                    <% end %>
                    </ul>
                  </div>
              <% end %>

              <% if current_user.admin? %>
                  <%= build_validated_field('user', 'name', 'Name', 'Cannot be blank', '[a-zA-Z]+', 'text', @user.name) %>
                  <% if current_user == @user %>
                      <%= build_validated_field('user', 'nickname', 'Nickname', 'Cannot be blank', '[a-zA-Z]+', 'text', @user.nickname) %>
                      <%= build_field('user', 'image', 'Profile picture', 'file', @user.image) %>
                      <%= f.check_box :remove_image %>
                      Remove Image<br>
                  <% end %>
                  <%= build_validated_field('user', 'email', 'Email', '', '', 'text', @user.email) %>
                  <%= build_validated_field('user', 'employee_code', 'Employee code', 'Cannot be blank', '[a-zA-Z]+', 'text', @user.employee_code) %>
                  <%= build_validated_select('user', 'role', 'Role', 'Should select at least one', '', false, @user_role, [['Employee'], ['Manager'], ['Admin']]) %>
                  <%= f.label :manager_ids %>
                  <%= f.select :manager_ids, @users.map { |x| [x.name, x.id] }, {}, {:multiple => true} %>
              <% end %>
              <% if current_user == @user %>
                  <% unless current_user.admin? %>
                      <%= build_validated_field('user', 'nickname', 'Nickname', 'Cannot be blank', '[a-zA-Z]+', 'text', @user.nickname) %>
                      <%= build_field('user', 'image', 'Profile picture', 'file', @user.image) %>
                      <%= f.check_box :remove_image %>
                      Remove avatar
                  <% end %>
              <% end %>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
  <div class="pane3-padding">
    <div class="right">
      <%= link_to t('.cancel', :default => t("helpers.links.cancel")),
                  teams_path, :class => 'button alert' %>
      <%= f.submit nil, :class => 'button success', data: {disable_with: "Saving"} %>
    </div><commit_msg>Fixed Issue With Admin not being able to change user images<commit_after><%= form_for(@user, :url => {:controller => 'users', :action => 'update', :id => @user.id}, :html => {:class => 'form-horizontal', :multipart => true, :data => {:abide => true}}) do |f| %>
  <div class="pane3-padding">
    <div class="row">
      <div class="col-sm-12">
        <div class="project-card">
          <div class="card-block">
            <div class="form-content form-below">
              <% if @user.errors.any? %>
                  <div id="error_explanation">
                    <% @user.errors.full_messages.each do |msg| %>
                        <li><%= msg %></li>
                    <% end %>
                    </ul>
                  </div>
              <% end %>

              <% if current_user.manager? %>
                  <%= build_validated_field('user', 'name', 'Name', 'Cannot be blank', '[a-zA-Z]+', 'text', @user.name) %>
                  <%= build_validated_field('user', 'nickname', 'Nickname', 'Cannot be blank', '[a-zA-Z]+', 'text', @user.nickname) %>
                  <%= build_field('user', 'image', 'Profile picture', 'file', @user.image) %>
                  <%= f.check_box :remove_image %>
                  Remove Image<br>
                  <%= build_validated_field('user', 'email', 'Email', '', '', 'text', @user.email) %>
                  <%= build_validated_field('user', 'employee_code', 'Employee code', 'Cannot be blank', '[a-zA-Z]+', 'text', @user.employee_code) %>
                  <%= build_validated_select('user', 'role', 'Role', 'Should select at least one', '', false, @user_role, [['Employee'], ['Manager'], ['Admin']]) %>
                  <%= f.label :manager_ids %>
                  <%= f.select :manager_ids, @users.map { |x| [x.name, x.id] }, {}, {:multiple => true} %>
              <% end %>
              <% if current_user == @user %>
                <% unless current_user.manager? %>
                  <%= build_validated_field('user', 'nickname', 'Nickname', 'Cannot be blank', '[a-zA-Z]+', 'text', @user.nickname) %>
                  <%= build_field('user', 'image', 'Profile picture', 'file', @user.image) %>
                  <%= f.check_box :remove_image %>
                  Remove avatar
                <% end %>
              <% end %>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
  <div class="pane3-padding">
    <div class="right">
      <%= link_to t('.cancel', :default => t("helpers.links.cancel")),
                  teams_path, :class => 'button alert' %>
      <%= f.submit nil, :class => 'button success', data: {disable_with: "Saving"} %>
    </div>
{'fraction_non_alphanumeric': 0.20326107096535112, 'fraction_numerical': 0.0014823049842505095, 'mean_word_length': 1.8470464135021096, 'pattern_counts': {'":': 0, '<': 99, '<?xml version=': 0, '>': 125, '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': '2345843', 'n_tokens_mistral': 1748, 'n_tokens_neox': 1559, 'n_words': 357}