mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-19 17:38:19 +08:00
core: drop problem-assign
This commit is contained in:
1 parent
7a4681f1e5
commit
8561ce6cd1
10 files changed
+29
-60
No files matched your search
@@ -169,7 +169,7 @@ export class ContestDetailHandler extends ContestDetailBaseHandler {
|
|||||||
&& !this.user.own(this.tdoc)
|
&& !this.user.own(this.tdoc)
|
||||||
&& !this.user.hasPerm(PERM.PERM_VIEW_CONTEST_HIDDEN_SCOREBOARD)
|
&& !this.user.hasPerm(PERM.PERM_VIEW_CONTEST_HIDDEN_SCOREBOARD)
|
||||||
) return;
|
) return;
|
||||||
const pdict = await problem.getList(domainId, this.tdoc.pids, true, undefined, undefined, problem.PROJECTION_CONTEST_LIST);
|
const pdict = await problem.getList(domainId, this.tdoc.pids, true, true, problem.PROJECTION_CONTEST_LIST);
|
||||||
let psdict = {};
|
let psdict = {};
|
||||||
let rdict = {};
|
let rdict = {};
|
||||||
if (this.tsdoc) {
|
if (this.tsdoc) {
|
||||||
@@ -252,7 +252,7 @@ export class ContestScoreboardHandler extends ContestDetailBaseHandler {
|
|||||||
const tdoc = await contest.get(domainId, tid);
|
const tdoc = await contest.get(domainId, tid);
|
||||||
if (!contest.canShowScoreboard.call(this, tdoc)) throw new ContestScoreboardHiddenError(tid);
|
if (!contest.canShowScoreboard.call(this, tdoc)) throw new ContestScoreboardHiddenError(tid);
|
||||||
const [pdict, teams] = await Promise.all([
|
const [pdict, teams] = await Promise.all([
|
||||||
problem.getList(domainId, tdoc.pids, true, undefined, false, undefined, true),
|
problem.getList(domainId, tdoc.pids, true, false, undefined, true),
|
||||||
contest.getMultiStatus(domainId, { docId: tid }).toArray(),
|
contest.getMultiStatus(domainId, { docId: tid }).toArray(),
|
||||||
]);
|
]);
|
||||||
const udict = await user.getList(domainId, teams.map((i) => i.uid));
|
const udict = await user.getList(domainId, teams.map((i) => i.uid));
|
||||||
@@ -373,7 +373,7 @@ export class ContestEditHandler extends Handler {
|
|||||||
if (beginAtMoment.isSameOrAfter(endAt)) throw new ValidationError('duration');
|
if (beginAtMoment.isSameOrAfter(endAt)) throw new ValidationError('duration');
|
||||||
const beginAt = beginAtMoment.toDate();
|
const beginAt = beginAtMoment.toDate();
|
||||||
const lockAt = lock ? moment(endAt).add(-lock, 'minutes').toDate() : null;
|
const lockAt = lock ? moment(endAt).add(-lock, 'minutes').toDate() : null;
|
||||||
await problem.getList(domainId, pids, this.user.hasPerm(PERM.PERM_VIEW_PROBLEM_HIDDEN) || this.user._id, this.user.group, true);
|
await problem.getList(domainId, pids, this.user.hasPerm(PERM.PERM_VIEW_PROBLEM_HIDDEN) || this.user._id, true);
|
||||||
if (tid) {
|
if (tid) {
|
||||||
await contest.edit(domainId, tid, {
|
await contest.edit(domainId, tid, {
|
||||||
title, content, rule, beginAt, endAt, pids, rated, duration: contestDuration,
|
title, content, rule, beginAt, endAt, pids, rated, duration: contestDuration,
|
||||||
|
|||||||
@@ -64,7 +64,6 @@ registerValue('Problem', [
|
|||||||
['difficulty', 'Int'],
|
['difficulty', 'Int'],
|
||||||
['tag', '[String]'],
|
['tag', '[String]'],
|
||||||
['hidden', 'Boolean'],
|
['hidden', 'Boolean'],
|
||||||
['assign', '[String]'],
|
|
||||||
]);
|
]);
|
||||||
|
|
||||||
registerResolver(
|
registerResolver(
|
||||||
@@ -74,11 +73,6 @@ registerResolver(
|
|||||||
const pdoc = await problem.get(ctx.args.domainId, arg.pid || arg.id);
|
const pdoc = await problem.get(ctx.args.domainId, arg.pid || arg.id);
|
||||||
if (!pdoc) return null;
|
if (!pdoc) return null;
|
||||||
if (pdoc.hidden) ctx.checkPerm(PERM.PERM_VIEW_PROBLEM_HIDDEN);
|
if (pdoc.hidden) ctx.checkPerm(PERM.PERM_VIEW_PROBLEM_HIDDEN);
|
||||||
if (pdoc.assign.length && !ctx.user.own(pdoc)) {
|
|
||||||
if (!Set.intersection(new Set(pdoc.assign), new Set(ctx.user.group)).size) {
|
|
||||||
throw new PermissionError(PERM.PERM_VIEW_PROBLEM_HIDDEN);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ctx.pdoc = pdoc;
|
ctx.pdoc = pdoc;
|
||||||
return pdoc;
|
return pdoc;
|
||||||
},
|
},
|
||||||
@@ -86,7 +80,7 @@ registerResolver(
|
|||||||
registerResolver('Query', 'problems(ids: [Int])', '[Problem]', async (arg, ctx) => {
|
registerResolver('Query', 'problems(ids: [Int])', '[Problem]', async (arg, ctx) => {
|
||||||
ctx.checkPerm(PERM.PERM_VIEW);
|
ctx.checkPerm(PERM.PERM_VIEW);
|
||||||
const res = await problem.getList(ctx.args.domainId, arg.ids, ctx.user.hasPerm(PERM.PERM_VIEW_PROBLEM_HIDDEN) || ctx.user._id,
|
const res = await problem.getList(ctx.args.domainId, arg.ids, ctx.user.hasPerm(PERM.PERM_VIEW_PROBLEM_HIDDEN) || ctx.user._id,
|
||||||
ctx.user.group, undefined, undefined, true);
|
undefined, undefined, true);
|
||||||
return Object.keys(res).map((id) => res[+id]);
|
return Object.keys(res).map((id) => res[+id]);
|
||||||
}, 'Get a list of problem by ids');
|
}, 'Get a list of problem by ids');
|
||||||
registerResolver(
|
registerResolver(
|
||||||
@@ -105,7 +99,7 @@ registerResolver(
|
|||||||
},
|
},
|
||||||
);
|
);
|
||||||
registerResolver(
|
registerResolver(
|
||||||
'ProblemManage', 'edit(title: String, content: String, tag: [String], hidden: Boolean, assign: [String])', 'Problem!',
|
'ProblemManage', 'edit(title: String, content: String, tag: [String], hidden: Boolean)', 'Problem!',
|
||||||
(arg, ctx) => problem.edit(ctx.args.domainId, ctx.pdoc.docId, arg),
|
(arg, ctx) => problem.edit(ctx.args.domainId, ctx.pdoc.docId, arg),
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -640,14 +634,13 @@ export class ProblemEditHandler extends ProblemManageHandler {
|
|||||||
@post('hidden', Types.Boolean)
|
@post('hidden', Types.Boolean)
|
||||||
@post('tag', Types.Content, true, null, parseCategory)
|
@post('tag', Types.Content, true, null, parseCategory)
|
||||||
@post('difficulty', Types.PositiveInt, (i) => +i <= 10, true)
|
@post('difficulty', Types.PositiveInt, (i) => +i <= 10, true)
|
||||||
@post('assign', Types.CommaSeperatedArray, true)
|
|
||||||
async post(
|
async post(
|
||||||
domainId: string, pid: string | number, title: string, content: string,
|
domainId: string, pid: string | number, title: string, content: string,
|
||||||
newPid: string = '', hidden = false, tag: string[] = [], difficulty = 0, assign: string[] = [],
|
newPid: string = '', hidden = false, tag: string[] = [], difficulty = 0,
|
||||||
) {
|
) {
|
||||||
if (newPid !== this.pdoc.pid && await problem.get(domainId, newPid)) throw new BadRequestError('new pid exists');
|
if (newPid !== this.pdoc.pid && await problem.get(domainId, newPid)) throw new BadRequestError('new pid exists');
|
||||||
const $update: Partial<ProblemDoc> = {
|
const $update: Partial<ProblemDoc> = {
|
||||||
title, content, pid: newPid, hidden, assign, tag: tag ?? [], difficulty, html: false,
|
title, content, pid: newPid, hidden, tag: tag ?? [], difficulty, html: false,
|
||||||
};
|
};
|
||||||
const pdoc = await problem.edit(domainId, this.pdoc.docId, $update);
|
const pdoc = await problem.edit(domainId, this.pdoc.docId, $update);
|
||||||
this.response.redirect = this.url('problem_detail', { pid: newPid || pdoc.docId });
|
this.response.redirect = this.url('problem_detail', { pid: newPid || pdoc.docId });
|
||||||
@@ -972,13 +965,12 @@ export class ProblemCreateHandler extends Handler {
|
|||||||
@post('hidden', Types.Boolean)
|
@post('hidden', Types.Boolean)
|
||||||
@post('difficulty', Types.PositiveInt, (i) => +i <= 10, true)
|
@post('difficulty', Types.PositiveInt, (i) => +i <= 10, true)
|
||||||
@post('tag', Types.Content, true, null, parseCategory)
|
@post('tag', Types.Content, true, null, parseCategory)
|
||||||
@post('assign', Types.CommaSeperatedArray, true)
|
|
||||||
async post(
|
async post(
|
||||||
domainId: string, title: string, content: string, pid: string,
|
domainId: string, title: string, content: string, pid: string,
|
||||||
hidden = false, difficulty = 0, tag: string[] = [], assign: string[] = [],
|
hidden = false, difficulty = 0, tag: string[] = [],
|
||||||
) {
|
) {
|
||||||
if (pid && await problem.get(domainId, pid)) throw new BadRequestError('ProblemID already exists');
|
if (pid && await problem.get(domainId, pid)) throw new BadRequestError('ProblemID already exists');
|
||||||
const docId = await problem.add(domainId, pid, title, content, this.user._id, tag ?? [], hidden, assign);
|
const docId = await problem.add(domainId, pid, title, content, this.user._id, tag ?? [], hidden);
|
||||||
const files = new Set(Array.from(content.matchAll(/file:\/\/([a-zA-Z0-9_-]+\.[a-zA-Z0-9]+)/g)).map((i) => i[1]));
|
const files = new Set(Array.from(content.matchAll(/file:\/\/([a-zA-Z0-9_-]+\.[a-zA-Z0-9]+)/g)).map((i) => i[1]));
|
||||||
const tasks = [];
|
const tasks = [];
|
||||||
for (const file of files) {
|
for (const file of files) {
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ class RecordListHandler extends ContestDetailBaseHandler {
|
|||||||
: await Promise.all([
|
: await Promise.all([
|
||||||
user.getList(domainId, rdocs.map((rdoc) => rdoc.uid)),
|
user.getList(domainId, rdocs.map((rdoc) => rdoc.uid)),
|
||||||
canViewProblem
|
canViewProblem
|
||||||
? problem.getList(domainId, rdocs.map((rdoc) => rdoc.pid), canViewHiddenProblem, this.user.group, false)
|
? problem.getList(domainId, rdocs.map((rdoc) => rdoc.pid), canViewHiddenProblem, false)
|
||||||
: Object.fromEntries([rdocs.map((rdoc) => [rdoc.pid, { ...problem.default, pid: rdoc.pid }])]),
|
: Object.fromEntries([rdocs.map((rdoc) => [rdoc.pid, { ...problem.default, pid: rdoc.pid }])]),
|
||||||
]);
|
]);
|
||||||
this.response.body = {
|
this.response.body = {
|
||||||
|
|||||||
@@ -98,7 +98,7 @@ class TrainingDetailHandler extends Handler {
|
|||||||
const canViewHidden = this.user.hasPerm(PERM.PERM_VIEW_PROBLEM_HIDDEN) || this.user._id;
|
const canViewHidden = this.user.hasPerm(PERM.PERM_VIEW_PROBLEM_HIDDEN) || this.user._id;
|
||||||
const [owner, pdict] = await Promise.all([
|
const [owner, pdict] = await Promise.all([
|
||||||
user.getById(domainId, tdoc.owner),
|
user.getById(domainId, tdoc.owner),
|
||||||
problem.getList(domainId, pids, canViewHidden, this.user.group, true),
|
problem.getList(domainId, pids, canViewHidden, true),
|
||||||
]);
|
]);
|
||||||
const psdict = await problem.getListStatus(domainId, this.user._id, pids);
|
const psdict = await problem.getListStatus(domainId, this.user._id, pids);
|
||||||
const donePids = new Set<number>();
|
const donePids = new Set<number>();
|
||||||
|
|||||||
@@ -344,7 +344,7 @@ class UserDetailHandler extends Handler {
|
|||||||
pdocs.push(...Object.values(
|
pdocs.push(...Object.values(
|
||||||
await problem.getList(
|
await problem.getList(
|
||||||
did, psdocs.map((i) => i.docId), canViewHidden,
|
did, psdocs.map((i) => i.docId), canViewHidden,
|
||||||
this.user.group, false, problem.PROJECTION_LIST, true,
|
false, problem.PROJECTION_LIST, true,
|
||||||
),
|
),
|
||||||
));
|
));
|
||||||
}));
|
}));
|
||||||
@@ -366,7 +366,7 @@ class UserDetailHandler extends Handler {
|
|||||||
if (this.user.hasPerm(PERM.PERM_VIEW_PROBLEM)) {
|
if (this.user.hasPerm(PERM.PERM_VIEW_PROBLEM)) {
|
||||||
this.response.body.pdict = await problem.getList(
|
this.response.body.pdict = await problem.getList(
|
||||||
domainId, psdocs.map((i) => i.parentId), canViewHidden,
|
domainId, psdocs.map((i) => i.parentId), canViewHidden,
|
||||||
this.user.group, false, problem.PROJECTION_LIST,
|
false, problem.PROJECTION_LIST,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -229,7 +229,6 @@ declare module './model/problem' {
|
|||||||
data: FileInfo[];
|
data: FileInfo[];
|
||||||
additional_file: FileInfo[];
|
additional_file: FileInfo[];
|
||||||
hidden?: boolean;
|
hidden?: boolean;
|
||||||
assign: string[];
|
|
||||||
html?: boolean;
|
html?: boolean;
|
||||||
stats?: any;
|
stats?: any;
|
||||||
difficulty?: number;
|
difficulty?: number;
|
||||||
|
|||||||
@@ -726,7 +726,7 @@ export async function getScoreboard(
|
|||||||
const tdoc = await get(domainId, tid);
|
const tdoc = await get(domainId, tid);
|
||||||
if (!canShowScoreboard.call(this, tdoc)) throw new ContestScoreboardHiddenError(tid);
|
if (!canShowScoreboard.call(this, tdoc)) throw new ContestScoreboardHiddenError(tid);
|
||||||
const tsdocsCursor = getMultiStatus(domainId, { docId: tid }).sort(RULES[tdoc.rule].statusSort);
|
const tsdocsCursor = getMultiStatus(domainId, { docId: tid }).sort(RULES[tdoc.rule].statusSort);
|
||||||
const pdict = await problem.getList(domainId, tdoc.pids, true, problem.PROJECTION_CONTEST_DETAIL);
|
const pdict = await problem.getList(domainId, tdoc.pids, true, true, problem.PROJECTION_CONTEST_DETAIL);
|
||||||
const [rows, udict] = await RULES[tdoc.rule].scoreboard(
|
const [rows, udict] = await RULES[tdoc.rule].scoreboard(
|
||||||
isExport, this.translate.bind(this),
|
isExport, this.translate.bind(this),
|
||||||
tdoc, pdict, tsdocsCursor,
|
tdoc, pdict, tsdocsCursor,
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ function sortable(source: string) {
|
|||||||
export class ProblemModel {
|
export class ProblemModel {
|
||||||
static PROJECTION_CONTEST_LIST: Field[] = [
|
static PROJECTION_CONTEST_LIST: Field[] = [
|
||||||
'_id', 'domainId', 'docType', 'docId', 'pid',
|
'_id', 'domainId', 'docType', 'docId', 'pid',
|
||||||
'owner', 'title', 'assign',
|
'owner', 'title',
|
||||||
];
|
];
|
||||||
|
|
||||||
static PROJECTION_LIST: Field[] = [
|
static PROJECTION_LIST: Field[] = [
|
||||||
@@ -66,7 +66,6 @@ export class ProblemModel {
|
|||||||
additional_file: [],
|
additional_file: [],
|
||||||
stats: {},
|
stats: {},
|
||||||
hidden: true,
|
hidden: true,
|
||||||
assign: [],
|
|
||||||
config: '',
|
config: '',
|
||||||
difficulty: 0,
|
difficulty: 0,
|
||||||
};
|
};
|
||||||
@@ -88,31 +87,30 @@ export class ProblemModel {
|
|||||||
additional_file: [],
|
additional_file: [],
|
||||||
stats: {},
|
stats: {},
|
||||||
hidden: true,
|
hidden: true,
|
||||||
assign: [],
|
|
||||||
config: '',
|
config: '',
|
||||||
difficulty: 0,
|
difficulty: 0,
|
||||||
};
|
};
|
||||||
|
|
||||||
static async add(
|
static async add(
|
||||||
domainId: string, pid: string = '', title: string, content: string, owner: number,
|
domainId: string, pid: string = '', title: string, content: string, owner: number,
|
||||||
tag: string[] = [], hidden = false, assign: string[] = [],
|
tag: string[] = [], hidden = false,
|
||||||
) {
|
) {
|
||||||
const [doc] = await ProblemModel.getMulti(domainId, {})
|
const [doc] = await ProblemModel.getMulti(domainId, {})
|
||||||
.sort({ docId: -1 }).limit(1).project({ docId: 1 })
|
.sort({ docId: -1 }).limit(1).project({ docId: 1 })
|
||||||
.toArray();
|
.toArray();
|
||||||
const result = await ProblemModel.addWithId(
|
const result = await ProblemModel.addWithId(
|
||||||
domainId, (doc?.docId || 0) + 1, pid,
|
domainId, (doc?.docId || 0) + 1, pid,
|
||||||
title, content, owner, tag, hidden, assign,
|
title, content, owner, tag, hidden,
|
||||||
);
|
);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
static async addWithId(
|
static async addWithId(
|
||||||
domainId: string, docId: number, pid: string = '', title: string,
|
domainId: string, docId: number, pid: string = '', title: string,
|
||||||
content: string, owner: number, tag: string[] = [], hidden = false, assign: string[] = [],
|
content: string, owner: number, tag: string[] = [], hidden = false,
|
||||||
) {
|
) {
|
||||||
const args: Partial<ProblemDoc> = {
|
const args: Partial<ProblemDoc> = {
|
||||||
title, tag, hidden, assign, nSubmit: 0, nAccept: 0, sort: sortable(pid || `P${docId}`),
|
title, tag, hidden, nSubmit: 0, nAccept: 0, sort: sortable(pid || `P${docId}`),
|
||||||
};
|
};
|
||||||
if (pid) args.pid = pid;
|
if (pid) args.pid = pid;
|
||||||
await bus.parallel('problem/before-add', domainId, content, owner, docId, args);
|
await bus.parallel('problem/before-add', domainId, content, owner, docId, args);
|
||||||
@@ -298,8 +296,7 @@ export class ProblemModel {
|
|||||||
|
|
||||||
static async getList(
|
static async getList(
|
||||||
domainId: string, pids: number[], canViewHidden: number | boolean = false,
|
domainId: string, pids: number[], canViewHidden: number | boolean = false,
|
||||||
group: string[] = [], doThrow = true, projection = ProblemModel.PROJECTION_PUBLIC,
|
doThrow = true, projection = ProblemModel.PROJECTION_PUBLIC, indexByDocIdOnly = false,
|
||||||
indexByDocIdOnly = false,
|
|
||||||
): Promise<ProblemDict> {
|
): Promise<ProblemDict> {
|
||||||
if (!pids?.length) return [];
|
if (!pids?.length) return [];
|
||||||
const r: Record<number, ProblemDoc> = {};
|
const r: Record<number, ProblemDoc> = {};
|
||||||
@@ -307,9 +304,6 @@ export class ProblemModel {
|
|||||||
const q: any = { docId: { $in: pids } };
|
const q: any = { docId: { $in: pids } };
|
||||||
let pdocs = await document.getMulti(domainId, document.TYPE_PROBLEM, q)
|
let pdocs = await document.getMulti(domainId, document.TYPE_PROBLEM, q)
|
||||||
.project(buildProjection(projection)).toArray();
|
.project(buildProjection(projection)).toArray();
|
||||||
if (group.length > 0 && canViewHidden !== true) {
|
|
||||||
pdocs = pdocs.filter((i) => !i.assign?.length || Set.intersection(group, i.assign).size);
|
|
||||||
}
|
|
||||||
if (canViewHidden !== true) {
|
if (canViewHidden !== true) {
|
||||||
pdocs = pdocs.filter((i) => i.owner === canViewHidden || i.maintainer?.includes(canViewHidden as any) || !i.hidden);
|
pdocs = pdocs.filter((i) => i.owner === canViewHidden || i.maintainer?.includes(canViewHidden as any) || !i.hidden);
|
||||||
}
|
}
|
||||||
@@ -383,8 +377,7 @@ export class ProblemModel {
|
|||||||
if (udoc.own(pdoc)) return true;
|
if (udoc.own(pdoc)) return true;
|
||||||
if (udoc.hasPerm(PERM.PERM_VIEW_PROBLEM_HIDDEN)) return true;
|
if (udoc.hasPerm(PERM.PERM_VIEW_PROBLEM_HIDDEN)) return true;
|
||||||
if (pdoc.hidden) return false;
|
if (pdoc.hidden) return false;
|
||||||
if (!pdoc.assign.length) return true;
|
return true;
|
||||||
return !!Set.intersection(pdoc.assign, udoc.group).size;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -385,14 +385,7 @@ const scripts: UpgradeScript[] = [
|
|||||||
await db.collection('oplog').deleteMany({ type: 'user.login' });
|
await db.collection('oplog').deleteMany({ type: 'user.login' });
|
||||||
return true;
|
return true;
|
||||||
},
|
},
|
||||||
async function _57_58() {
|
null,
|
||||||
const _FRESH_INSTALL_IGNORE = 1;
|
|
||||||
await db.collection('document').updateMany(
|
|
||||||
{ docType: document.TYPE_PROBLEM, assign: null },
|
|
||||||
{ $set: { assign: [] } },
|
|
||||||
);
|
|
||||||
return true;
|
|
||||||
},
|
|
||||||
async function _58_59() {
|
async function _58_59() {
|
||||||
const _FRESH_INSTALL_IGNORE = 1;
|
const _FRESH_INSTALL_IGNORE = 1;
|
||||||
const tasks = await db.collection('task').find({ type: 'schedule', subType: 'contest.problemHide' }).toArray();
|
const tasks = await db.collection('task').find({ type: 'schedule', subType: 'contest.problemHide' }).toArray();
|
||||||
|
|||||||
@@ -6,12 +6,6 @@
|
|||||||
<div class="section__body">
|
<div class="section__body">
|
||||||
<form method="post">
|
<form method="post">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="medium-7 columns">
|
|
||||||
<label>
|
|
||||||
{{ _('Title') }}
|
|
||||||
<input name="title" placeholder="{{ _('title') }}" value="{{ pdoc['title']|default('') }}" class="textbox"{% if page_name == 'problem_create' %} autofocus{% endif %}>
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
<div class="medium-3 columns">
|
<div class="medium-3 columns">
|
||||||
<label>
|
<label>
|
||||||
{{ _('pid') }}
|
{{ _('pid') }}
|
||||||
@@ -21,6 +15,12 @@
|
|||||||
</label>
|
</label>
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="medium-7 columns">
|
||||||
|
<label>
|
||||||
|
{{ _('Title') }}
|
||||||
|
<input name="title" placeholder="{{ _('title') }}" value="{{ pdoc['title']|default('') }}" class="textbox"{% if page_name == 'problem_create' %} autofocus{% endif %}>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
<div class="medium-2 columns">
|
<div class="medium-2 columns">
|
||||||
<label>
|
<label>
|
||||||
<br>
|
<br>
|
||||||
@@ -33,20 +33,12 @@
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
{{ form.form_text({
|
{{ form.form_text({
|
||||||
row:false,
|
row:false,
|
||||||
columns:6,
|
columns:9,
|
||||||
label:'Tags',
|
label:'Tags',
|
||||||
help_text:'Split by \', \'.',
|
help_text:'Split by \', \'.',
|
||||||
name:'tag',
|
name:'tag',
|
||||||
value:pdoc['tag']|default([])|join(', ')
|
value:pdoc['tag']|default([])|join(', ')
|
||||||
}) }}
|
}) }}
|
||||||
{{ form.form_text({
|
|
||||||
row:false,
|
|
||||||
columns:3,
|
|
||||||
label:'Assign',
|
|
||||||
placeholder:_('Group / UID'),
|
|
||||||
name:'assign',
|
|
||||||
value:pdoc.assign|default([])|join(', ')
|
|
||||||
}) }}
|
|
||||||
{{ form.form_text({
|
{{ form.form_text({
|
||||||
row:false,
|
row:false,
|
||||||
columns:3,
|
columns:3,
|
||||||
|
|||||||
Reference in new issue
Block a user