ui: 优化ACM计分板显示

This commit is contained in:
undefined committed 2021-05-17 22:05:06 +08:00
1 parent 09db5a9108
commit e5b1304bd9
7 files changed
+15 -11

No files matched your search

+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "hydrooj", "name": "hydrooj",
"version": "2.26.7", "version": "2.26.8",
"bin": "bin/hydrooj.js", "bin": "bin/hydrooj.js",
"main": "dist/loader.js", "main": "dist/loader.js",
"typings": "dist/loader.d.ts", "typings": "dist/loader.d.ts",
+5 -5
View File
@@ -116,14 +116,14 @@ const acm: ContestRule = {
let colTimeStr; let colTimeStr;
if (doc.accept) { if (doc.accept) {
rid = doc.rid; rid = doc.rid;
colAccepted = _('Accepted'); colAccepted = `${_('Accepted')} ${doc.naccept ? ` (-${doc.naccept})` : ''}`;
colTime = doc.time; colTime = doc.time;
colTimeStr = misc.formatSeconds(colTime) + (doc.naccept ? ` (-${doc.naccept})` : ''); colTimeStr = misc.formatSeconds(colTime);
} else { } else {
rid = null; rid = null;
colAccepted = '-'; colAccepted = doc.naccept ? `(-${doc.naccept})` : '-';
colTime = '-'; colTime = '-';
colTimeStr = doc.naccept ? `(-${doc.naccept})` : '-'; colTimeStr = '';
} }
if (isExport) { if (isExport) {
row.push({ type: 'string', value: colAccepted }); row.push({ type: 'string', value: colAccepted });
@@ -132,7 +132,7 @@ const acm: ContestRule = {
} else { } else {
row.push({ row.push({
type: 'record', type: 'record',
value: '{0}\n{1}'.format(colAccepted, colTimeStr), value: '{0}<br>{1}'.format(colAccepted, colTimeStr),
raw: rid, raw: rid,
}); });
} }
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "@hydrooj/ui-default", "name": "@hydrooj/ui-default",
"version": "4.8.22", "version": "4.8.23",
"author": "undefined <i@undefined.moe>", "author": "undefined <i@undefined.moe>",
"license": "AGPL-3.0", "license": "AGPL-3.0",
"main": "hydro.js", "main": "hydro.js",
@@ -6,7 +6,6 @@ import substitute from 'vj/utils/substitute';
import Notification from 'vj/components/notification'; import Notification from 'vj/components/notification';
import i18n from 'vj/utils/i18n'; import i18n from 'vj/utils/i18n';
import base64 from 'vj/utils/base64'; import base64 from 'vj/utils/base64';
import request from 'vj/utils/request';
const page = new NamedPage('user_detail', async () => { const page = new NamedPage('user_detail', async () => {
$('[name="profile_contact_copy"]').get().forEach((el) => { $('[name="profile_contact_copy"]').get().forEach((el) => {
@@ -20,8 +19,7 @@ const page = new NamedPage('user_detail', async () => {
Notification.error(substitute(i18n('Copy "{data}" failed :('), { data: decoded })); Notification.error(substitute(i18n('Copy "{data}" failed :('), { data: decoded }));
}); });
}); });
const data = await request.get(''); const history = UiContext.udoc?.ratingHistory || [];
const history = data.udoc?.ratingHistory || [];
while (history.length > 30) history.shift(); while (history.length > 30) history.shift();
while (history.length < 30) history.unshift(1500); while (history.length < 30) history.unshift(1500);
const $dom = document.getElementById('rating-placeholder'); const $dom = document.getElementById('rating-placeholder');
@@ -41,7 +41,7 @@
{{ user.render_inline(udict[column.raw], badge=false) }} {{ user.render_inline(udict[column.raw], badge=false) }}
{% elif column.type == 'record' and column.raw %} {% elif column.type == 'record' and column.raw %}
<a href="{{ url('record_detail', rid=column.raw) }}"> <a href="{{ url('record_detail', rid=column.raw) }}">
<span style="font-weight:bold;color:{{ utils.status.getScoreColor(column.value) }}">{{ column.value }}</span> <span style="font-weight:bold;color:{{ utils.status.getScoreColor(column.value) }}">{{ column.value|safe }}</span>
</a> </a>
{% else %} {% else %}
{{ column.value }} {{ column.value }}
@@ -74,6 +74,11 @@
<li class="footer__extra-link-item">{{ html|safe }}</li> <li class="footer__extra-link-item">{{ html|safe }}</li>
{%- endfor -%} {%- endfor -%}
<li class="footer__extra-link-item">Powered by <a href="https://hydro.js.org">Hydro v{{ global.Hydro.version.hydrooj }}</a></li> <li class="footer__extra-link-item">Powered by <a href="https://hydro.js.org">Hydro v{{ global.Hydro.version.hydrooj }}</a></li>
{% if model.system.get('server.pro') %}
<li class="footer__extra-link-item">Professional Version</li>
{% else %}
<li class="footer__extra-link-item">Community Version (for non-commercial use only)</li>
{% endif %}
</ol> </ol>
</div> </div>
</div> </div>
@@ -1,6 +1,7 @@
{% import "components/home.html" as home with context %} {% import "components/home.html" as home with context %}
{% extends "layout/basic.html" %} {% extends "layout/basic.html" %}
{% block content %} {% block content %}
{{ set(UiContext, 'udoc', udoc) }}
<style> <style>
.user-profile-bg { .user-profile-bg {
background-image : url("{{ udoc.backgroundImage }}"); background-image : url("{{ udoc.backgroundImage }}");