mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
修复一些错误
This commit is contained in:
1 parent
bc50913e6e
commit
2b6a510c1e
23 files changed
+321
-191
No files matched your search
@@ -1,8 +1,8 @@
|
||||
{% macro render_problem_title(pdoc, tdoc=none, show_tags=true, show_invisible_flag=true, rp=none, invalid=false) %}
|
||||
{% macro render_problem_title(pdoc, tdoc=none, prefix='/c', show_tags=true, show_invisible_flag=true, rp=none, invalid=false) %}
|
||||
{%- if not invalid %}
|
||||
<a
|
||||
{%- if tdoc %}
|
||||
href="/c/{{ tdoc.docId }}/p/{{ pdoc.docId }}"
|
||||
href="{{ prefix }}/{{ tdoc.docId }}/p/{{ pdoc.docId }}"
|
||||
{%- else %}
|
||||
href="/p/{{ pdoc.pid }}"
|
||||
{%- endif %}
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
{% if handler.canShowRecord(tdoc) %}
|
||||
{{ record.render_status_td(rdoc) }}
|
||||
{% else %}
|
||||
<td class="col--status record-status--border"><a href="/r/{{ rdoc._id }}">{{ _('Submitted') }}</a></td>
|
||||
<td class="col--status record-status--border"><a href="/record/{{ rdoc._id }}">{{ _('Submitted') }}</a></td>
|
||||
{% endif %}
|
||||
<td class="col--submit-at">{{ datetimeSpan(rdoc['_id'])|safe }}</td>
|
||||
{% else %}
|
||||
@@ -57,7 +57,7 @@
|
||||
{% endif %}
|
||||
<td class="col--problem col--problem-name">
|
||||
#{{ loop.index }}:
|
||||
{{ problem.render_problem_title(pdict[pid], tdoc=tdoc, show_invisible_flag=false, show_tags=false) }}
|
||||
{{ problem.render_problem_title(pdict[pid], tdoc=tdoc, prefix='/homework', show_invisible_flag=false, show_tags=false) }}
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
{% import "components/user.html" as user %}
|
||||
{% extends "manage_base.html" %}
|
||||
{% block manage_content %}
|
||||
{% if system.bio %}
|
||||
{% if domain.bulletin %}
|
||||
<div class="section">
|
||||
<div class="section__body typo">
|
||||
{{ system.bio|markdown|safe }}
|
||||
{{ domain.bulletin|markdown|safe }}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
@@ -14,8 +14,8 @@
|
||||
</div>
|
||||
<div class="section__body typo">
|
||||
<dl class="large horizontal">
|
||||
<dt>{{ _('Gravatar') }}</dt><dd><img src="{{ gravatar(system.gravatar) }}" width="32" height="32"></dd>
|
||||
<dt>{{ _('Name') }}</dt><dd>{{ system.uname }}</dd>
|
||||
<dt>{{ _('Gravatar') }}</dt><dd><img src="{{ gravatar(domain.gravatar) }}" width="32" height="32"></dd>
|
||||
<dt>{{ _('Name') }}</dt><dd>{{ domain.name }}</dd>
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
<form method="post">
|
||||
{{ form.form_text({
|
||||
label:'Name',
|
||||
name:'uname',
|
||||
value:system.uname,
|
||||
name:'name',
|
||||
value:domain.name,
|
||||
autofocus:true,
|
||||
required:true
|
||||
}) }}
|
||||
@@ -15,13 +15,13 @@
|
||||
label:'Gravatar Email',
|
||||
help_text:'Will be used as the system icon.',
|
||||
name:'gravatar',
|
||||
value:system.gravatar
|
||||
value:domain.gravatar
|
||||
}) }}
|
||||
{{ form.form_textarea({
|
||||
columns:12,
|
||||
label:'Bulletin',
|
||||
name:'bio',
|
||||
value:system.bio,
|
||||
name:'bulletin',
|
||||
value:domain.bulletin,
|
||||
markdown:true,
|
||||
required:false
|
||||
}) }}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<form method="post">
|
||||
<div class="section">
|
||||
<div class="section__header">
|
||||
<h1 class="section__title">{{ _('{0}: Permissions').format(system.uname) }}</h1>
|
||||
<h1 class="section__title">{{ _('{0}: Permissions').format(domain.name) }}</h1>
|
||||
</div>
|
||||
<div class="section__body no-padding domain-users">
|
||||
<table class="data-table">
|
||||
@@ -36,7 +36,7 @@
|
||||
{% for role in roles %}
|
||||
<td class="col--p">
|
||||
<label class="compact checkbox">
|
||||
<input name="{{ role._id }}" data-checkbox-group="{{ role._id }}" data-checkbox-range value="{{ perm.key }}" type="checkbox"{% if role.perm.includes(perm.key) %} checked{% endif %}{% if role._id == 'root' %} disabled{% endif %}>
|
||||
<input name="{{ role._id }}" data-checkbox-group="{{ role._id }}" data-checkbox-range value="{{ perm.key }}" type="checkbox"{% if role.perm.includes(perm.key) %} checked{% endif %}{% if role._id == 'admin' %} disabled{% endif %}>
|
||||
</label>
|
||||
</td>
|
||||
{% endfor %}
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
</div>
|
||||
<div class="section">
|
||||
<div class="section__header">
|
||||
<h1 class="section__title">{{ _('{0}: Roles').format(system.uname) }}</h1>
|
||||
<h1 class="section__title">{{ _('{0}: Roles').format(domain.name) }}</h1>
|
||||
<div class="section__tools">
|
||||
<button class="primary rounded button" name="create_role">{{ _('Create Role') }}</button>
|
||||
</div>
|
||||
@@ -47,7 +47,7 @@
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for role in roles %}
|
||||
{% set isBuiltin = role._id not in ['default', 'guest', 'root'] %}
|
||||
{% set isBuiltin = role._id in ['default', 'guest', 'admin'] %}
|
||||
<tr{% if isBuiltin %} data-role="{{ role._id }}"{% endif %}>
|
||||
<td class="col--checkbox">
|
||||
<label class="compact checkbox">
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
</div>
|
||||
<div class="section">
|
||||
<div class="section__header">
|
||||
<h1 class="section__title">{{ _('{0}: Users').format(system.uname) }}</h1>
|
||||
<h1 class="section__title">{{ _('{0}: Users').format(domain.name) }}</h1>
|
||||
<div class="section__tools">
|
||||
<button class="primary rounded button" name="add_user">{{ _('Add User') }}</button>
|
||||
</div>
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
{% endif %}
|
||||
{% if user._id == tdoc.owner or handler.hasPerm(perm.PERM_EDIT_CONTEST) %}
|
||||
<li class="menu__item"><a class="menu__link" href="/c/{{ tdoc.docId }}/edit">
|
||||
<span class="icon icon-edit"></span> {{ _('Edit Contest') }}
|
||||
<span class="icon icon-edit"></span> {{ _('Edit Contest') }}
|
||||
</a></li>
|
||||
{% endif %}
|
||||
{% if handler.hasPerm(perm.PERM_READ_RECORD_CODE) %}
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
{% endif %}
|
||||
{% if tdoc.owner == handler.user._id or handler.hasPerm(perm.PERM_EDIT_HOMEWORK) %}
|
||||
<li class="menu__item"><a class="menu__link" href="/homework/{{ tdoc.docId }}/edit">
|
||||
<span class="icon icon-edit"></span> {{ _('Edit Homework') }}
|
||||
<span class="icon icon-edit"></span> {{ _('Edit Homework') }}
|
||||
</a></li>
|
||||
{% endif %}
|
||||
{% if handler.hasPerm(perm.PERM_READ_RECORD_CODE) %}
|
||||
|
||||
@@ -1,7 +1,13 @@
|
||||
{% if tdoc %}
|
||||
{% include "partials/problem_sidebar_contest.html" %}
|
||||
{% set owner_udoc = udoc %}
|
||||
{% include "partials/contest_sidebar.html" %}
|
||||
{% if tdoc.docType == 60 %}
|
||||
{% include "partials/problem_sidebar_homework.html" %}
|
||||
{% set owner_udoc = udoc %}
|
||||
{% include "partials/homework_sidebar.html" %}
|
||||
{% else %}
|
||||
{% include "partials/problem_sidebar_contest.html" %}
|
||||
{% set owner_udoc = udoc %}
|
||||
{% include "partials/contest_sidebar.html" %}
|
||||
{% endif %}
|
||||
{% else %}
|
||||
{% include "partials/problem_sidebar_normal.html" %}
|
||||
{% endif %}
|
||||
@@ -0,0 +1,42 @@
|
||||
{% import "components/user.html" as user with context %}
|
||||
<div class="section side section--problem-sidebar">
|
||||
{% if page_name != 'problem_detail' and page_name != 'homework_detail_problem' %}
|
||||
<div class="section__header">
|
||||
<h1 class="section__title">{{ pdoc['title'] }}</h1>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div>
|
||||
<ol class="menu">
|
||||
{% if model.contest.isOngoing(tdoc) or model.contest.isHomeworkExtended(tdoc) %}
|
||||
{% if page_name == 'homework_detail_problem' %}
|
||||
<li class="menu__item scratchpad--hide"><a class="menu__link highlight" name="problem-sidebar__open-scratchpad" href="javascript:;" data-global-hotkey="alt+e">
|
||||
<span class="icon icon-enlarge"></span> {{ _('Open Scratchpad') }} (Alt+E)
|
||||
</a></li>
|
||||
<li class="menu__item non-scratchpad--hide"><a class="menu__link" name="problem-sidebar__quit-scratchpad" href="javascript:;" data-global-hotkey="alt+q">
|
||||
<span class="icon icon-enlarge"></span> {{ _('Quit Scratchpad') }} (Alt+Q)
|
||||
</a></li>
|
||||
{% else %}
|
||||
<li class="menu__item"><a class="menu__link" href="/homework/{{ tdoc.docId }}/p/{{ pdoc.docId }}">
|
||||
<span class="icon icon-flag"></span> {{ _('View Problem') }}
|
||||
</a></li>
|
||||
{% endif %}
|
||||
<li class="menu__item scratchpad--hide"><a class="menu__link{% if page_name == 'homework_detail_problem_submit' %} active{% endif %}" href="/homework/{{ tdoc.docId }}/p/{{ pdoc.docId }}/submit">
|
||||
<span class="icon icon-send"></span> {{ _('Submit') }}
|
||||
</a></li>
|
||||
{% elif model.contest.isDone(tdoc) %}
|
||||
<li class="menu__item scratchpad--hide"><a class="menu__link" href="/p/{{ pdoc.pid }}">
|
||||
<span class="icon icon-send"></span> {{ _('Open in Problem Set') }}
|
||||
</a></li>
|
||||
{% endif %}
|
||||
{% if pdoc.owner == handler.user._id or handler.hasPerm(perm.PERM_EDIT_PROBLEM) %}
|
||||
<li class="menu__seperator"></li>
|
||||
<li class="menu__item"><a class="menu__link{% if page_name == 'problem_edit' %} active{% endif %}" href="/p/{{ pdoc.pid }}/edit">
|
||||
<span class="icon icon-edit"></span> {{ _('Edit') }}
|
||||
</a></li>
|
||||
<li class="menu__item"><a class="menu__link{% if page_name == 'problem_settings' %} active{% endif %}" href="/p/{{ pdoc.pid }}/settings">
|
||||
<span class="icon icon-wrench"></span> {{ _('Settings') }}
|
||||
</a></li>
|
||||
{% endif %}
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
Reference in new issue
Block a user