mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-19 17:38:19 +08:00
core: UserModel.getListForRender: support extra fields
This commit is contained in:
5 files changed
+19
-11
No files matched your search
@@ -562,7 +562,10 @@ export class ContestManagementHandler extends ContestManagementBaseHandler {
|
||||
owner_udoc: await user.getById(domainId, this.tdoc.owner),
|
||||
pdict: await problem.getList(domainId, this.tdoc.pids, true, true, [...problem.PROJECTION_CONTEST_LIST, 'tag']),
|
||||
files: sortFiles(this.tdoc.files || []),
|
||||
udict: await user.getListForRender(domainId, tcdocs.map((i) => i.owner), this.user.hasPerm(PERM.PERM_VIEW_DISPLAYNAME)),
|
||||
udict: await user.getListForRender(
|
||||
domainId, tcdocs.map((i) => i.owner),
|
||||
this.user.hasPerm(PERM.PERM_VIEW_DISPLAYNAME) ? ['displayName'] : []
|
||||
),
|
||||
tcdocs,
|
||||
urlForFile: (filename: string) => this.url('contest_file_download', { tid, filename }),
|
||||
};
|
||||
@@ -668,8 +671,10 @@ export class ContestUserHandler extends ContestManagementBaseHandler {
|
||||
for (const tsdoc of tsdocs) {
|
||||
tsdoc.endAt = (this.tdoc.duration && tsdoc.startAt) ? moment(tsdoc.startAt).add(this.tdoc.duration, 'hours').toDate() : null;
|
||||
}
|
||||
const udict = await user.getListForRender(domainId,
|
||||
[this.tdoc.owner, ...tsdocs.map((i) => i.uid)], this.user.hasPerm(PERM.PERM_VIEW_DISPLAYNAME));
|
||||
const udict = await user.getListForRender(
|
||||
domainId, [this.tdoc.owner, ...tsdocs.map((i) => i.uid)],
|
||||
this.user.hasPerm(PERM.PERM_VIEW_DISPLAYNAME) ? ['displayName'] : []
|
||||
);
|
||||
this.response.body = { tdoc: this.tdoc, tsdocs, udict };
|
||||
this.response.pjax = 'partials/contest_user.html';
|
||||
this.response.template = 'contest_user.html';
|
||||
@@ -709,7 +714,7 @@ export class ContestBalloonHandler extends ContestManagementBaseHandler {
|
||||
owner_udoc: await user.getById(domainId, this.tdoc.owner),
|
||||
pdict: await problem.getList(domainId, this.tdoc.pids, true, true, problem.PROJECTION_CONTEST_LIST),
|
||||
bdocs,
|
||||
udict: await user.getListForRender(domainId, uids, this.user.hasPerm(PERM.PERM_VIEW_DISPLAYNAME)),
|
||||
udict: await user.getListForRender(domainId, uids, this.user.hasPerm(PERM.PERM_VIEW_DISPLAYNAME) ? ['displayName'] : []),
|
||||
};
|
||||
this.response.pjax = 'partials/contest_balloon.html';
|
||||
this.response.template = 'contest_balloon.html';
|
||||
|
||||
Reference in new issue
Block a user