core&ui: show homework relate on problem_detail (#396)

This commit is contained in:
panda authored and GitHub committed 2022-08-04 08:59:55 +08:00
1 parent 7101a3096c
commit 008c30c8e0
8 files changed
+26 -5

No files matched your search

@@ -0,0 +1,3 @@
<a class="discussion-node-tag media-link" href="{{ url('homework_detail', domainId=tdoc.domainId, tid=tdoc.docId) }}">
<span class="v-center icon icon-homework"></span>{{ tdoc.title }}
</a>
@@ -121,7 +121,7 @@
<div id="submission-score-placeholder" style="width: 100%; height:230px"></div>
</div>
{% endif %}
{% if page_name == 'problem_detail' and (tdocs.length or ctdocs.length) %}
{% if page_name == 'problem_detail' and (tdocs.length or ctdocs.length or htdocs.length) %}
<div class="section side">
<div class="section__header">
<h1 class="section__title">{{ _('Related') }}</h1>
@@ -139,6 +139,12 @@
<p><a href="{{ url('contest_detail', tid=tdoc.docId) }}">{{ tdoc.title }}</a></p>
{%- endfor -%}
{% endif %}
{% if htdocs.length %}
<p>{{ _('In following homework') }}: </p>
{%- for tdoc in htdocs -%}
<p><a href="{{ url('homework_detail', tid=tdoc.docId) }}">{{ tdoc.title }}</a></p>
{%- endfor -%}
{% endif %}
</div>
</div>
{% endif %}