priv (unstable)

This commit is contained in:
undefined committed 2020-06-29 13:33:44 +08:00
1 parent 554698189c
commit e092efca20
63 files changed
+706 -397

No files matched your search

+7 -7
View File
@@ -79,7 +79,7 @@
<div class="section__body no-padding training__problems">
<table class="data-table">
<colgroup>
{% if handler.hasPerm(perm.PERM_LOGGEDIN) %}
{% if handler.user.hasPriv(PRIV.PRIV_USER_PROFILE) %}
<col class="col--status">
{% endif %}
<col class="col--name">
@@ -89,7 +89,7 @@
</colgroup>
<thead>
<tr>
{% if handler.hasPerm(perm.PERM_LOGGEDIN) %}
{% if handler.user.hasPriv(PRIV.PRIV_USER_PROFILE) %}
<th class="col--status record-status--border">{{ _('Status') }}</th>
{% endif %}
<th class="col--name">{{ _('Problem') }}</th>
@@ -104,7 +104,7 @@
{% set pdoc=pdict[pid] %}
{% set psdoc=psdict[pid] %}
<tr>
{% if handler.hasPerm(perm.PERM_LOGGEDIN) %}
{% if handler.user.hasPriv(PRIV.PRIV_USER_PROFILE) %}
{% if psdoc['rid'] %}
{{ record.render_status_td(psdoc, rid_key='rid') }}
{% else %}
@@ -112,7 +112,7 @@
{% endif %}
{% endif %}
<td class="col--name col--problem-name">
{% if handler.hasPerm(perm.PERM_LOGGEDIN) %}
{% if handler.user.hasPriv(PRIV.PRIV_USER_PROFILE) %}
<form class="form--inline" action="{{ url('problem_main') }}" method="post">
<input type="hidden" name="pid" value="{{ pdoc.docId }}">
<input type="hidden" name="operation" value="{% if not psdoc['star'] %}star{% else %}unstar{% endif %}">
@@ -160,7 +160,7 @@
<div class="section side">
<div>
<ol class="menu">
{% if not tsdoc['enroll'] and handler.hasPerm(perm.PERM_LOGGEDIN) %}
{% if not tsdoc['enroll'] and handler.user.hasPriv(PRIV.PRIV_USER_PROFILE) %}
<li class="menu__item">
<form action="" method="POST">
<input type="hidden" name="operation" value="enroll">
@@ -171,7 +171,7 @@
</form>
</li>
{% endif %}
{% if tdoc.owner == user._id or handler.hasPerm(perm.PERM_EDIT_TRAINING) %}
{% if tdoc.owner == user._id or handler.user.hasPerm(perm.PERM_EDIT_TRAINING) %}
<li class="menu__item"><a class="menu__link" href="{{ url('training_edit', tid=tdoc.docId) }}">
<span class="icon icon-edit"></span> {{ _('Edit') }}
</a></li>
@@ -184,7 +184,7 @@
</div>
<div class="section__body typo">
<dl class="large horizontal">
{% if handler.hasPerm(perm.PERM_LOGGEDIN) %}
{% if handler.user.hasPriv(PRIV.PRIV_USER_PROFILE) %}
<dt>{{ _('Status') }}</dt><dd>{% if tsdoc['enroll'] %}{{ _('Completed' if tsdoc['done'] else 'In Progress') }}{% else %}{{ _('Not Enrolled') }}{% endif %}</dd>
{% endif %}
{% if tsdoc['enroll'] %}