mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
ui: fix contest_files ui (#385)
This commit is contained in:
1 parent
2a54b0aa25
commit
b8a4ed4c52
7 files changed
+27
-9
No files matched your search
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "hydrooj",
|
"name": "hydrooj",
|
||||||
"version": "3.14.7",
|
"version": "3.14.8",
|
||||||
"bin": "bin/hydrooj.js",
|
"bin": "bin/hydrooj.js",
|
||||||
"main": "src/loader",
|
"main": "src/loader",
|
||||||
"module": "src/loader",
|
"module": "src/loader",
|
||||||
@@ -68,7 +68,6 @@
|
|||||||
"@types/mongodb": "^3.6.20",
|
"@types/mongodb": "^3.6.20",
|
||||||
"@types/nodemailer": "^6.4.4",
|
"@types/nodemailer": "^6.4.4",
|
||||||
"@types/notp": "^2.0.2",
|
"@types/notp": "^2.0.2",
|
||||||
"@types/path-to-regexp": "^1.7.0",
|
|
||||||
"@types/semver": "^7.3.10",
|
"@types/semver": "^7.3.10",
|
||||||
"@types/serialize-javascript": "^5.0.2",
|
"@types/serialize-javascript": "^5.0.2",
|
||||||
"@types/source-map-support": "^0.5.4",
|
"@types/source-map-support": "^0.5.4",
|
||||||
|
|||||||
@@ -108,6 +108,11 @@ export class ContestDetailHandler extends Handler {
|
|||||||
tdoc, tsdoc, udict, page,
|
tdoc, tsdoc, udict, page,
|
||||||
};
|
};
|
||||||
if (contest.isNotStarted(tdoc)) return;
|
if (contest.isNotStarted(tdoc)) return;
|
||||||
|
if (!this.request.json) {
|
||||||
|
this.response.body.tdoc.content = this.response.body.tdoc.content
|
||||||
|
.replace(/\(file:\/\//g, `(./${tdoc.docId}/file/`)
|
||||||
|
.replace(/="file:\/\//g, `="./${tdoc.docId}/file/`);
|
||||||
|
}
|
||||||
const pdict = await problem.getList(domainId, tdoc.pids, true, undefined, undefined, problem.PROJECTION_CONTEST_LIST);
|
const pdict = await problem.getList(domainId, tdoc.pids, true, undefined, undefined, problem.PROJECTION_CONTEST_LIST);
|
||||||
const psdict = {};
|
const psdict = {};
|
||||||
let rdict = {};
|
let rdict = {};
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@hydrooj/ui-default",
|
"name": "@hydrooj/ui-default",
|
||||||
"version": "4.38.9",
|
"version": "4.38.10",
|
||||||
"author": "undefined <i@undefined.moe>",
|
"author": "undefined <i@undefined.moe>",
|
||||||
"license": "AGPL-3.0",
|
"license": "AGPL-3.0",
|
||||||
"main": "hydro.js",
|
"main": "hydro.js",
|
||||||
|
|||||||
@@ -25,6 +25,13 @@ const page = new NamedPage(['contest_edit', 'contest_create', 'homework_create',
|
|||||||
ev.target.click();
|
ev.target.click();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
setInterval(() => {
|
||||||
|
$('img').each(function () {
|
||||||
|
if ($(this).attr('src').startsWith('file://')) {
|
||||||
|
$(this).attr('src', $(this).attr('src').replace('file://', './file/'));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}, 500);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,9 @@
|
|||||||
|
.page--home_files,.page--contest_files
|
||||||
|
.col--checkbox
|
||||||
|
width: 60px
|
||||||
|
|
||||||
|
.col--size
|
||||||
|
width: 120px
|
||||||
|
|
||||||
|
.col--operation
|
||||||
|
width: 40px
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
.page--home_files
|
|
||||||
.col--checkbox
|
|
||||||
width: 60px
|
|
||||||
|
|
||||||
.col--size
|
|
||||||
width: 120px
|
|
||||||
@@ -16,6 +16,7 @@
|
|||||||
</th>
|
</th>
|
||||||
<th class="col--name">{{ _('Filename') }}</th>
|
<th class="col--name">{{ _('Filename') }}</th>
|
||||||
<th class="col--size">{{ _('Size') }}</th>
|
<th class="col--size">{{ _('Size') }}</th>
|
||||||
|
<th class="col--operation"></th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
@@ -30,6 +31,9 @@
|
|||||||
<a href="{{ urlForFile(file.name) }}">{{ file.name }}</a>
|
<a href="{{ urlForFile(file.name) }}">{{ file.name }}</a>
|
||||||
</td>
|
</td>
|
||||||
<td class="col--size">{{ size(file.size) }}</td>
|
<td class="col--size">{{ size(file.size) }}</td>
|
||||||
|
<td class="col--operation">
|
||||||
|
<a href="{{ urlForFile(file.name) }}" class="icon icon-download"></a>
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
{%- endfor -%}
|
{%- endfor -%}
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|||||||
Reference in new issue
Block a user