mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
core: admin can remove contestant before contest start (#1196)
This commit is contained in:
1 parent
52f811cf98
commit
f29971a30d
11 files changed
+50
-3
No files matched your search
@@ -1,6 +1,6 @@
|
||||
import $ from 'jquery';
|
||||
import UserSelectAutoComplete from 'vj/components/autocomplete/UserSelectAutoComplete';
|
||||
import { ActionDialog } from 'vj/components/dialog';
|
||||
import { ActionDialog, confirm } from 'vj/components/dialog';
|
||||
import Notification from 'vj/components/notification';
|
||||
import { NamedPage } from 'vj/misc/Page';
|
||||
import {
|
||||
@@ -93,9 +93,20 @@ const page = new NamedPage('contest_user', () => {
|
||||
}, i18n('Contest resumed.'));
|
||||
}
|
||||
|
||||
async function handleCancelRegistration(ev) {
|
||||
const uid = $(ev.target).data('uid');
|
||||
const yes = await confirm(i18n('Are you sure to cancel the registration of this user?'));
|
||||
if (!yes) return;
|
||||
await handlePostRequest({
|
||||
operation: 'remove_user',
|
||||
uid,
|
||||
}, i18n('Registration cancelled.'));
|
||||
}
|
||||
|
||||
$('[name="add_user"]').on('click', () => handleClickAddUser());
|
||||
$(document).on('click', '[name="edit_rank"]', handleEditRank);
|
||||
$(document).on('click', '[name="resume_contest"]', handleResume);
|
||||
$(document).on('click', '[name="cancel_registration"]', handleCancelRegistration);
|
||||
});
|
||||
|
||||
export default page;
|
||||
Reference in new issue
Block a user