core: allow view solution & others code after accept

This commit is contained in:
undefined committed 2021-12-14 13:25:20 +08:00
1 parent c0ac4302a2
commit 489327cc0d
7 files changed
+41 -25

No files matched your search

+1 -7
View File
@@ -121,6 +121,7 @@ env.addGlobal('static_url', (assetName) => {
// eslint-disable-next-line no-eval
env.addGlobal('eval', eval);
env.addGlobal('Date', Date);
env.addGlobal('Math', Math);
env.addGlobal('process', process);
env.addGlobal('global', global);
env.addGlobal('typeof', (o) => typeof o);
@@ -141,13 +142,6 @@ 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
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@hydrooj/ui-default",
"version": "4.27.5",
"version": "4.27.6",
"author": "undefined <i@undefined.moe>",
"license": "AGPL-3.0",
"main": "hydro.js",
@@ -108,11 +108,11 @@
<h2 class="section__title">{{ _('Accepted Problems') }}</h2>
</div>
<div class="typo section__body no-media">
{% set _mark = (pdocs.length/4)|int %}
{% set _mark = Math.ceil(pdocs.length/4) %}
{% set _one = pdocs.slice(0, _mark) %}
{% set _two = pdocs.slice(_mark, _mark*2) %}
{% set _three = pdocs.slice(_mark*2, _mark*3) %}
{% set _four = pdocs.slice(_mark*3, pdocs.length) %}
{% set _four = pdocs.slice(_mark*3, pdocs.length - 1) %}
<div class="row">
<div class="medium-3 columns">
<ul>