##// END OF EJS Templates
Refmap is a separate block, not a part of a message
Refmap is a separate block, not a part of a message

File last commit:

r1288:5e8376c2 default
r1288:5e8376c2 default
Show More
post.html
110 lines | 4.1 KiB | text/html | HtmlLexer
{% load i18n %}
{% load board %}
{% get_current_language as LANGUAGE_CODE %}
<div class="{{ css_class }}" id="{{ post.id }}" data-uid="{{ post.uid }}">
<div class="post-info">
<a class="post_id" href="{{ post.get_absolute_url }}">#{{ post.get_absolute_id }}</a>
<span class="title">{{ post.title }}</span>
<span class="pub_time"><time datetime="{{ post.pub_time|date:'c' }}">{{ post.pub_time }}</time></span>
{% comment %}
Thread death time needs to be shown only if the thread is alredy archived
and this is an opening post (thread death time) or a post for popup
(we don't see OP here so we show the death time in the post itself).
{% endcomment %}
{% if thread.archived %}
{% if is_opening %}
<time datetime="{{ thread.bump_time|date:'c' }}">{{ thread.bump_time }}</time>
{% endif %}
{% endif %}
{% if is_opening %}
{% if need_open_link %}
{% if thread.archived %}
<a class="link" href="{% url 'thread' post.id %}">{% trans "Open" %}</a>
{% else %}
<a class="link" href="{% url 'thread' post.id %}#form">{% trans "Reply" %}</a>
{% endif %}
{% endif %}
{% else %}
{% if need_op_data %}
{% with thread.get_opening_post as op %}
{% trans " in " %}<a href="{{ op.get_absolute_url }}">&gt;&gt;{{ op.id }}</a> <span class="title">{{ op.get_title|striptags|truncatewords:5 }}</span>
{% endwith %}
{% endif %}
{% endif %}
{% if reply_link and not thread.archived %}
<a href="#form" onclick="addQuickReply('{{ post.id }}'); return false;">{% trans 'Reply' %}</a>
{% endif %}
{% if moderator %}
<span class="moderator_info">
| <a href="{% url 'admin:boards_post_change' post.id %}">{% trans 'Edit' %}</a>
{% if is_opening %}
| <a href="{% url 'admin:boards_thread_change' thread.id %}">{% trans 'Edit thread' %}</a>
{% endif %}
</span>
{% endif %}
</div>
{% comment %}
Post images. Currently only 1 image can be posted and shown, but post model
supports multiple.
{% endcomment %}
{% if post.images.exists %}
{% with post.images.first as image %}
{% autoescape off %}
{{ image.get_view }}
{% endautoescape %}
{% endwith %}
{% endif %}
{% if post.attachments.exists %}
{% with post.attachments.first as file %}
{% autoescape off %}
{{ file.get_view }}
{% endautoescape %}
{% endwith %}
{% endif %}
{% comment %}
Post message (text)
{% endcomment %}
<div class="message">
{% autoescape off %}
{% if truncated %}
{{ post.get_text|truncatewords_html:50 }}
{% else %}
{{ post.get_text }}
{% endif %}
{% endautoescape %}
</div>
{% if post.is_referenced %}
{% if mode_tree %}
<div class="tree_reply">
{% for refpost in post.get_referenced_posts %}
{% post_view refpost mode_tree=True %}
{% endfor %}
</div>
{% else %}
<div class="refmap">
{% autoescape off %}
{% trans "Replies" %}: {{ post.refmap }}
{% endautoescape %}
</div>
{% endif %}
{% endif %}
{% comment %}
Thread metadata: counters, tags etc
{% endcomment %}
{% if is_opening %}
<div class="metadata">
{% if is_opening and need_open_link %}
{{ thread.get_reply_count }} {% trans 'messages' %},
{{ thread.get_images_count }} {% trans 'images' %}.
{% endif %}
<span class="tags">
{% autoescape off %}
{{ thread.get_tag_url_list }}
{% endautoescape %}
</span>
</div>
{% endif %}
</div>