重构框架,增加比赛功能

This commit is contained in:
masnn committed 2020-04-11 20:37:47 +08:00
1 parent 0e590ebe0d
commit 9bf3343a64
54 files changed
+1196 -868

No files matched your search

+4 -4
View File
@@ -24,7 +24,7 @@
{% endif %}
{% if not attended and not handler.is_done(tdoc) %}
<li class="menu__item">
{% if handler.has_perm(perm.PERM_ATTEND_HOMEWORK) and handler.has_perm(perm.PERM_LOGGEDIN) %}
{% if handler.hasPerm(perm.PERM_ATTEND_HOMEWORK) and handler.hasPerm(perm.PERM_LOGGEDIN) %}
<form action="{{ reverse_url('homework_detail', tid=tdoc['doc_id']) }}" method="POST">
<input type="hidden" name="operation" value="attend">
<input type="hidden" name="csrf_token" value="{{ handler.csrf_token }}">
@@ -32,7 +32,7 @@
<span class="icon icon-add"></span> {{ _('Claim Homework') }}
</button>
</form>
{% elif not handler.has_perm(perm.PERM_LOGGEDIN) %}
{% elif not handler.hasPerm(perm.PERM_LOGGEDIN) %}
<a class="menu__link" href="javascript:showSignInDialog()">
<span class="icon icon-add"></span> {{ _('Login to Claim Homework') }}
</a>
@@ -52,12 +52,12 @@
<span class="icon icon-statistics"></span> {{ _('Scoreboard (Hidden)') }}
</a></li>
{% endif %}
{% if handler.own(tdoc, perm.PERM_EDIT_HOMEWORK_SELF) or handler.has_perm(perm.PERM_EDIT_HOMEWORK) %}
{% if handler.own(tdoc, perm.PERM_EDIT_HOMEWORK_SELF) or handler.hasPerm(perm.PERM_EDIT_HOMEWORK) %}
<li class="menu__item"><a class="menu__link" href="{{ reverse_url('homework_edit', tid=tdoc['doc_id']) }}">
<span class="icon icon-edit"></span> {{ _('Edit Homework') }}
</a></li>
{% endif %}
{% if handler.has_perm(perm.PERM_READ_RECORD_CODE) %}
{% if handler.hasPerm(perm.PERM_READ_RECORD_CODE) %}
<li class="menu__item"><a class="menu__link" href="{{ reverse_url('homework_code', tid=tdoc['doc_id']) }}">
<span class="icon icon-download"></span> {{ _('Export All Code') }}
</a></li>