<commit_before>$(function() {
    var $user_dialog = $("#user_dialog");
    <% if @user.id %>
        $user_dialog.dialog("close"); //close the dialog!!
        //append the new user to the table
        <% if @questionnaire %>
            var $myTable = $("#myTable");
            $myTable.prepend("<tr id='row_<%=@<EMAIL>.id.to_s%>'>" +
                                  "<td><%= escape_javascript( check_box_tag "users["+<EMAIL>.id.to_s+"]", @user.id.to_s, false, {:class => "checkboxes"} ) %></td>" +
                                  "<td id='auth_<%=@<EMAIL>.id.to_s%>'>No</td>"+
                                  "<td><%= escape_javascript( link_to h(@user.full_name), user_path(@user))%></td>"+
                                  "<td><%= escape_javascript(mail_to @user.email, h(@user.email))%></td>"+
                                  "<td id='groups_<%=@<EMAIL>.to_s%>' class='user_groups'></td>"+
                                  "</tr>");
            $myTable.trigger("update"); //tell the table that it has been updated
            $myTable.trigger("sorton",[[]]); //remove the sorting
        <% else %>
            var $users_index = $("#users_index");
            $users_index.prepend("<tr id='row_<%=@<EMAIL>.to_s%>'>" +
                                  "<td><%= escape_javascript( check_box_tag "users["+<EMAIL>.to_s+"]", @user.id.to_s, false, {:class => "checkboxes"} ) %></td>" +
                                  "<td><%= escape_javascript(link_to h(@user.full_name), user_path(@user)) %></td>"+
                                  "<td><%= escape_javascript(mail_to @user.email, h(@user.email))%></td>"+
                                  "<td><%= escape_javascript(@user.created_at.to_formatted_s(:long_ordinal)) %></td>"+
                                  "<td><%= escape_javascript(@user.creator ? "#{link_to h(@user.creator.full_name), user_path(@user.creator)}" : "None").html_safe %></td>"+
                                  "<td><%= @user.roles.map(&:name).join(', ') if @user.roles.present? %></td>"+
                                  "<td id='groups_<%=@user.id.to_s%>' class='user_groups'></td>"+
                                  "<td></td>"+
                                  "</tr>")
                        .trigger("update") //tell the table that it has been updated
                        .trigger("sorton",[[]]); //remove the sorting
        <% end %>
        $("#row_<%=@user.id.to_s%>").effect("highlight", {color: "blue"}, 3000 ); //highlight the added row
        <% @user = nil %> //reset the form completely. @user is nil, so it will create a new user.
        $("#form_user").remove();
        $user_dialog.append("<%= escape_javascript(render :partial => 'users/new') %>");
    <% else %>
        $("#form_user").remove();
        $user_dialog.append("<%= escape_javascript(render :partial => 'users/new') %>");
    <% end %>
});<commit_msg>Fix table columns in javascript for users table when adding user<commit_after>$(function() {
    var $user_dialog = $("#user_dialog");
    <% if @user.id %>
        $user_dialog.dialog("close"); //close the dialog!!
        //append the new user to the table
        <% if @questionnaire %>
            var $myTable = $("#myTable");
            $myTable.prepend("<tr id='row_<%=@user.id.to_s%>'>" +
                                  "<td><%= escape_javascript( check_box_tag "users["+@user.id.to_s+"]", @user.id.to_s, false, {:class => "checkboxes"} ) %></td>" +
                                  "<td id='auth_<%=@user.id.to_s%>'>No</td>"+
                                  "<td><%= escape_javascript( link_to h(@user.full_name), user_path(@user))%></td>"+
                                  "<td><%= escape_javascript(mail_to @user.email, h(@user.email))%></td>"+
                                  "<td id='groups_<%=@user.id.to_s%>' class='user_groups'></td>"+
                                  "</tr>");
            $myTable.trigger("update"); //tell the table that it has been updated
            $myTable.trigger("sorton",[[]]); //remove the sorting
        <% else %>
            var $users_index = $("#users_index");
            $users_index.prepend("<tr id='row_<%=@user.id.to_s%>'>" +
                                  "<td><%= escape_javascript( check_box_tag "users["+@user.id.to_s+"]", @user.id.to_s, false, {:class => "checkboxes"} ) %></td>" +
                                  "<td><%= escape_javascript(link_to h(@user.full_name), user_path(@user)) %></td>"+
                                  "<td><%= @user.created_at.strftime("%d/%m/%Y") %></td>"+
                                  "<td><%= @user.roles.map(&:name).join(', ') if @user.roles.present? %></td>"+
                                  "<td id='groups_<%=@user.id.to_s%>' class='user_groups'></td>"+
                                  "<td>"+
                                    "<a href='#' class='information-tooltip-trigger'><%= escape_javascript(fa_icon 'align-left') %> details</a> | <%= escape_javascript(link_to "view", @user) %>" +
                                  " | <%= escape_javascript(link_to "delete", delete_user_path(@user)) if !@user.role?(:admin) %>" +
                                  "</td>" +
                                  "</tr>")
                        .trigger("update") //tell the table that it has been updated
                        .trigger("sorton",[[]]); //remove the sorting
        <% end %>
        $("#row_<%=@user.id.to_s%>").effect("highlight", {color: "blue"}, 3000 ); //highlight the added row
        <% @user = nil %> //reset the form completely. @user is nil, so it will create a new user.
        $("#form_user").remove();
        $user_dialog.append("<%= escape_javascript(render :partial => 'users/new') %>");
    <% else %>
        $("#form_user").remove();
        $user_dialog.append("<%= escape_javascript(render :partial => 'users/new') %>");
    <% end %>
});
{'fraction_non_alphanumeric': 0.2071076347559939, 'fraction_numerical': 0.0013603128719605509, 'mean_word_length': 1.834698795180723, 'pattern_counts': {'":': 0, '<': 116, '<?xml version=': 0, '>': 124, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 31, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2108186', 'n_tokens_mistral': 1833, 'n_tokens_neox': 1736, 'n_words': 324}