<commit_before>$("#users-list #users-menu").click(function () {
  $("#content")
    .hide("slow", function () {
      $(this)
        .html(app.modules.users.html["menu"])
        .slideDown("slow");
    });

  return false;
});

$.ajax({
  type: "POST",
  url: "/users/findAllUsers",
  success: function (data)
  {
    if (!data.status) {
      var alertType = data.level;
      if (!alertType){
        alertType = "error";
      }
      $("#content #alert")
        .addClass("alert-" + alertType)
        .removeAttr("hidden")
        .html(msg);
    }
    else if (data.users.length === 0) {
      var alertType = data.level;
      if (!alertType){
        alertType = "warning";
      }
      $("#content #alert")
        .addClass("alert-" + alertType)
        .removeAttr("hidden")
        .html(msg);
    }
    else {
      $("#content #list table tbody")
        /*.html(
        "<tr><td>1</td><td>" + data.users[0].email + 
        "</td><td>" + (data.users[0].isAdministrator ? '<span class="glyphicon glyphicon-asterisk" aria-hidden="true"></span>' : "") +
        "</td></tr>"
        );*/
        .loadTemplate($("#users-list-item"),
          {
            number: 1,
            email: data.users[0].email,
            isAdministrator: data.users[0].isAdministrator ? '<span class="glyphicon glyphicon-asterisk" aria-hidden="true"></span>' : ""
          });
      for (var i = 1; i < data.users.length; i++) {
        $("#content #list table tr")
          .last()
          .after(
          "<tr><td>" + (i + 1) + 
          "</td><td>" + data.users[i].email + 
          "</td><td>" + (data.users[i].isAdministrator ? '<span class="glyphicon glyphicon-asterisk" aria-hidden="true"></span>' : "") +
          "</td></tr>"
          );
      }
      $("#content #list").removeAttr("hidden");
    }
    $("#content").slideDown("slow");
  }
});<commit_msg>Вывод списка пользователей с использованием loadTemplate.<commit_after>$("#users-list #users-menu").click(function () {
  $("#content")
    .hide("slow", function () {
      $(this)
        .html(app.modules.users.html["menu"])
        .slideDown("slow");
    });

  return false;
});

$.ajax({
  type: "POST",
  url: "/users/findAllUsers",
  success: function (data)
  {
    if (!data.status) {
      var alertType = data.level;
      if (!alertType){
        alertType = "error";
      }
      $("#content #alert")
        .addClass("alert-" + alertType)
        .removeAttr("hidden")
        .html(msg);
    }
    else if (data.users.length === 0) {
      var alertType = data.level;
      if (!alertType){
        alertType = "warning";
      }
      $("#content #alert")
        .addClass("alert-" + alertType)
        .removeAttr("hidden")
        .html(msg);
    }
    else {
      $("#content #list table tbody")
        .loadTemplate($("#users-list-item"),
          {
            number: 1,
            email: data.users[0].email,
            isAdministrator: data.users[0].isAdministrator ? '<span class="glyphicon glyphicon-asterisk" aria-hidden="true"></span>' : ""
          });
      for (var i = 1; i < data.users.length; i++) {
        $("#content #list table tbody")
          .loadTemplate($("#users-list-item"),
            {
              number: i + 1,
              email: data.users[i].email,
              isAdministrator: data.users[i].isAdministrator ? '<span class="glyphicon glyphicon-asterisk" aria-hidden="true"></span>' : ""
            },
            {
              append: true
            });
      }
      $("#content #list").removeAttr("hidden");
    }
    $("#content").slideDown("slow");
  }
});
{'fraction_non_alphanumeric': 0.199778331947908, 'fraction_numerical': 0.004156275976724855, 'mean_word_length': 2.0033277870216306, 'pattern_counts': {'":': 0, '<': 31, '<?xml version=': 0, '>': 29, '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': '3285346', 'n_tokens_mistral': 1139, 'n_tokens_neox': 1120, 'n_words': 203}