template: problem_detail

This commit is contained in:
masnn committed 2020-04-03 22:37:30 +08:00
1 parent 2e23d05a59
commit ffa193b5dd
43 files changed
+265 -242

No files matched your search

@@ -9,7 +9,7 @@
<div>
<ol class="menu">
{% if page_name == 'discussion_node' or page_name == 'discussion_detail' %}
{% if handler.has_perm(vj4.model.builtin.PERM_CREATE_DISCUSSION) %}
{% if handler.has_perm(perm.PERM_CREATE_DISCUSSION) %}
<li class="menu__item"><a class="menu__link highlight" href="{{ reverse_url('discussion_create_document_as_node', doc_type=pdoc['doc_type'], doc_id=pdoc['_id']) }}">
<span class="icon icon-add"></span> {{ _('Create a Discussion') }}
</a></li>
@@ -25,7 +25,7 @@
<li class="menu__seperator"></li>
{% endif %}
{% if page_name == 'problem_detail' %}
{% if handler.has_perm(vj4.model.builtin.PERM_SUBMIT_PROBLEM) %}
{% if handler.has_perm(perm.PERM_SUBMIT_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>
@@ -34,11 +34,11 @@
</a></li>
{% endif %}
{% else %}
<li class="menu__item"><a class="menu__link" href="{{ reverse_url('problem_detail', pid=pdoc['_id']) }}">
<li class="menu__item"><a class="menu__link" href="/p/{{ pdoc.pid }}">
<span class="icon icon-flag"></span> {{ _('View Problem') }}
</a></li>
{% endif %}
{% if handler.has_perm(vj4.model.builtin.PERM_SUBMIT_PROBLEM) %}
{% if handler.has_perm(perm.PERM_SUBMIT_PROBLEM) %}
<li class="menu__item scratchpad--hide"><a class="menu__link{% if page_name == 'problem_submit' %} active{% endif %}" href="{{ reverse_url('problem_submit', pid=pdoc['_id']) }}">
<span class="icon icon-send"></span> {{ _('Submit') }}
</a></li>
@@ -51,15 +51,15 @@
<span class="icon icon-send"></span> {{ _('No Permission to Submit') }}
</a></li>
{% endif %}
{% if handler.has_perm(vj4.model.builtin.PERM_VIEW_DISCUSSION) or handler.has_perm(vj4.model.builtin.PERM_VIEW_PROBLEM_SOLUTION) %}
{% if handler.has_perm(perm.PERM_VIEW_DISCUSSION) or handler.has_perm(perm.PERM_VIEW_PROBLEM_SOLUTION) %}
<li class="menu__seperator"></li>
{% endif %}
{% if handler.has_perm(vj4.model.builtin.PERM_VIEW_DISCUSSION) %}
{% if handler.has_perm(perm.PERM_VIEW_DISCUSSION) %}
<li class="menu__item"><a class="menu__link{% if page_name == 'discussion_node' or page_name == 'discussion_detail' %} active{% endif %}" href="{{ reverse_url('discussion_node_document_as_node', doc_type=pdoc['doc_type'], doc_id=pdoc['_id']) }}">
<span class="icon icon-comment--text"></span> {{ _('Discussions') }}
</a></li>
{% endif %}
{% if handler.has_perm(vj4.model.builtin.PERM_VIEW_PROBLEM_SOLUTION) %}
{% if handler.has_perm(perm.PERM_VIEW_PROBLEM_SOLUTION) %}
<li class="menu__item"><a class="menu__link{% if page_name == 'problem_solution' %} active{% endif %}" href="{{ reverse_url('problem_solution', pid=pdoc['_id']) }}">
<span class="icon icon-comment--text"></span> {{ _('Solutions') }}
</a></li>
@@ -70,7 +70,7 @@
<span class="icon icon-copy"></span> {{ _('Copy Problem') }}
</a></li>
{% endif %}
{% if handler.own(pdoc, vj4.model.builtin.PERM_EDIT_PROBLEM_SELF) or handler.has_perm(vj4.model.builtin.PERM_EDIT_PROBLEM) %}
{% if handler.user._id == pdoc.owner or handler.has_perm(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="{{ reverse_url('problem_edit', pid=pdoc['_id']) }}">
<span class="icon icon-edit"></span> {{ _('Edit') }}