mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 09:36:08 +08:00
ui: fix link display
This commit is contained in:
1 parent
43d589c84d
commit
385b8f4fe6
4 files changed
+16
-8
No files matched your search
@@ -11,7 +11,7 @@ const markdown = require('./markdown');
|
||||
|
||||
const { misc, buildContent, avatar } = global.Hydro.lib;
|
||||
|
||||
let template = argv.options.template;
|
||||
let { template } = argv.options;
|
||||
if (template && typeof template !== 'string') template = findFileSync('@hydrooj/ui-default/templates');
|
||||
else if (template) template = findFileSync(template);
|
||||
|
||||
@@ -139,6 +139,13 @@ env.addGlobal('set', (obj, key, val) => {
|
||||
env.addGlobal('findSubModule', (prefix) => {
|
||||
filter(Object.keys(global.Hydro.ui.template), (n) => n.startsWith(prefix));
|
||||
});
|
||||
env.addGlobal('parseContestProblemId', (pdoc, tdoc) => {
|
||||
if (tdoc.pids[parseInt(pdoc.pid, 36) - 10]) return pdoc.pid;
|
||||
let cur = tdoc.pids.indexOf(pdoc.docId);
|
||||
if (cur !== -1) return (cur + 10).toString(36).toUpperCase();
|
||||
cur = tdoc.pids.indexOf(`${pdoc.domainId}:${pdoc.docId}`);
|
||||
return (cur + 10).toString(36).toUpperCase();
|
||||
});
|
||||
|
||||
async function render(name, state) {
|
||||
// eslint-disable-next-line no-return-await
|
||||
|
||||
Reference in new issue
Block a user