upgrade katex to 0.12, wiki load

This commit is contained in:
undefined committed 2020-07-16 20:00:48 +08:00
1 parent 3b9910529e
commit bf29661eaa
18 files changed
+189 -54

No files matched your search

+3 -2
View File
@@ -35,9 +35,10 @@ class RecordListHandler extends RecordHandler {
page,
await system.get('RECORD_PER_PAGE'),
);
const canViewProblemHidden = this.user.hasPerm(PERM.PERM_VIEW_PROBLEM_HIDDEN);
const [udict, pdict] = await Promise.all([
user.getList(domainId, rdocs.map((rdoc) => rdoc.uid)),
problem.getList(domainId, rdocs.map((rdoc) => rdoc.pid), false, false),
problem.getList(domainId, rdocs.map((rdoc) => rdoc.pid), canViewProblemHidden, false),
]);
const path = [
['Hydro', 'homepage'],
@@ -100,7 +101,7 @@ class RecordRejudgeHandler extends Handler {
const RecordConnectionHandler = contest.ContestHandlerMixin(ConnectionHandler);
class RecordMainConnectionHandler extends RecordConnectionHandler {
@param('tid', Types.ObjectID)
@param('tid', Types.ObjectID, true)
async prepare(domainId: string, tid: ObjectID) {
this.domainId = domainId;
if (tid) {
+2 -1
View File
@@ -10,13 +10,14 @@ class WikiHandler extends Handler {
if (!global.Hydro.wiki[category]) throw new NotFoundError(category);
if (!global.Hydro.wiki[category][page]) throw new NotFoundError(category, page);
const contents = global.Hydro.wiki[category][page];
const pages = Object.keys(global.Hydro.wiki[category]);
const path = [
['Hydro', 'homepage'],
[`wiki_${category}`, null],
[`wiki_${category}_${page}`, null],
];
this.response.body = {
path, contents, page_name: `wiki_${category}_${page}`,
path, contents, pages, page_name: `wiki_${category}_${page}`,
};
this.response.template = 'wiki.html';
}