Show objects and subjects on the view page.
This commit is contained in:
parent
206562a8f9
commit
f9b510a967
|
@ -89,7 +89,7 @@
|
|||
{%- for start, line in iter_lines(text) if line != '\r\n' -%}
|
||||
{# <p data-start="{{ start }}">{% if line != "\n" and line != "\r\n" %}{{ line }}{% else %} {% endif
|
||||
%}</p>#}
|
||||
<p class="card-text{% if line.startswith('-') %} margin-bottom-zero{% endif %}" data-start="{{ start }}">{{ nbsp_at_start(line) }}</p>
|
||||
<p class="card-text{% if doc.type != 'xanadoc' or line.startswith('-') %} margin-bottom-zero{% endif %}" data-start="{{ start }}">{{ nbsp_at_start(line) }}</p>
|
||||
{%- endfor -%}
|
||||
{% endif %}
|
||||
</div>
|
||||
|
@ -103,9 +103,40 @@
|
|||
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<h4>references</h4>
|
||||
<ul>
|
||||
</ul>
|
||||
<h4>References</h4>
|
||||
{% set subject_count = doc.subjects.count() %}
|
||||
{% if subject_count %}
|
||||
<p>There are {{ subject_count }} documents that refer to this {{ doc.type }}.</p>
|
||||
<ul>
|
||||
{% for item in doc.subjects %}
|
||||
<li><a href="{{ item.url }}">{{ item.title() }}</a>
|
||||
— {{ item.user.username }} — {{ item.created | datetime }}
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% else %}
|
||||
<p>There are no documents that refer to this {{ doc.type }}.</p>
|
||||
{% endif %}
|
||||
|
||||
{% if doc.type == 'xanalink' %}
|
||||
<h4>Documents referred to</h4>
|
||||
{% set object_count = doc.objects.count() %}
|
||||
{% if object_count %}
|
||||
<p>There are {{ object_count }} document(s) referred to by this {{ doc.type }}.</p>
|
||||
<ul>
|
||||
{% for item in doc.objects %}
|
||||
<li><a href="{{ item.url }}">{{ item.title() }}</a>
|
||||
— {{ item.user.username }} — {{ item.created | datetime }}
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% else %}
|
||||
<p>This link doesn't refer to any documents.</p>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
Loading…
Reference in a new issue