org_settings: Disable `Deactivate` button for yourself in Users tab.

This disables the Deactivate button for the current user in the Users tab,
so that it becomes hard to deactivae yourself accidently from Users tab.

Fixes #10427.
This commit is contained in:
Pragati Agrawal 2019-03-18 11:56:12 +05:30 committed by Tim Abbott
parent 8b76a55b16
commit 9037ef56dc
2 changed files with 6 additions and 3 deletions

View File

@ -169,8 +169,11 @@ function populate_users(realm_people_data) {
activity_rendered = $("<span></span>").text(i18n.t("Unknown"));
}
var $row = $(templates.render("admin_user_list", {user: item, can_modify: page_params.is_admin}));
var $row = $(templates.render("admin_user_list", {
user: item,
can_modify: page_params.is_admin,
is_current_user: people.is_my_user_id(item.user_id),
}));
$row.find(".last_active").append(activity_rendered);
return $row;

View File

@ -34,7 +34,7 @@
<td>
<span class="user-status-settings">
{{#if is_active}}
<button class="button rounded small deactivate btn-danger">
<button class="button rounded small deactivate btn-danger" {{#if ../is_current_user}}disabled="disabled"{{/if}}>
{{t "Deactivate" }}
</button>
{{else}}