mirror of
https://github.com/zulip/zulip.git
synced 2025-11-16 20:02:15 +00:00
Admin: Put bots in a separate table.
(imported from commit 21330e28b486e10aff6af5f48280ea675cbd5697)
This commit is contained in:
@@ -3,8 +3,10 @@ var admin = (function () {
|
|||||||
var exports = {};
|
var exports = {};
|
||||||
|
|
||||||
function populate_users () {
|
function populate_users () {
|
||||||
var tb = $("#admin_users_table");
|
var users_table = $("#admin_users_table");
|
||||||
tb.empty();
|
var bots_table = $("#admin_bots_table");
|
||||||
|
users_table.empty();
|
||||||
|
bots_table.empty();
|
||||||
|
|
||||||
var humans = [];
|
var humans = [];
|
||||||
var bots = [];
|
var bots = [];
|
||||||
@@ -20,17 +22,18 @@ function populate_users () {
|
|||||||
humans = _.sortBy(humans, 'full_name');
|
humans = _.sortBy(humans, 'full_name');
|
||||||
bots = _.sortBy(bots, 'full_name');
|
bots = _.sortBy(bots, 'full_name');
|
||||||
|
|
||||||
var users = humans.concat(bots);
|
_.each(bots, function (user) {
|
||||||
|
bots_table.append(templates.render("admin_user_list", {user: user}));
|
||||||
_.each(users, function (user) {
|
});
|
||||||
tb.append(templates.render("admin_user_list", {user: user}));
|
_.each(humans, function (user) {
|
||||||
|
users_table.append(templates.render("admin_user_list", {user: user}));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
exports.setup_page = function () {
|
exports.setup_page = function () {
|
||||||
populate_users();
|
populate_users();
|
||||||
|
|
||||||
$("#admin_users_table").on("click", ".deactivate", function (e) {
|
$(".admin_user_table").on("click", ".deactivate", function (e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
|
|
||||||
@@ -47,7 +50,7 @@ exports.setup_page = function () {
|
|||||||
$("#deactivation_modal").modal("show");
|
$("#deactivation_modal").modal("show");
|
||||||
});
|
});
|
||||||
|
|
||||||
$("#admin_users_table").on("click", ".reactivate", function (e) {
|
$(".admin_user_table").on("click", ".reactivate", function (e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,15 @@
|
|||||||
<h1>Administration</h1>
|
<h1>Administration</h1>
|
||||||
<h2>Users</h2>
|
<h2>Users</h2>
|
||||||
<table class="table table-condensed table-striped">
|
<table class="table table-condensed table-striped">
|
||||||
<tbody id="admin_users_table">
|
<tbody id="admin_users_table" class="admin_user_table">
|
||||||
|
<th>Name</th>
|
||||||
|
<th>Email</th>
|
||||||
|
<th>Actions</th>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<h2>Bots</h2>
|
||||||
|
<table class="table table-condensed table-striped">
|
||||||
|
<tbody id="admin_bots_table" class="admin_user_table">
|
||||||
<th>Name</th>
|
<th>Name</th>
|
||||||
<th>Email</th>
|
<th>Email</th>
|
||||||
<th>Actions</th>
|
<th>Actions</th>
|
||||||
|
|||||||
Reference in New Issue
Block a user