##// END OF EJS Templates
Fixed issue in rendering post without having a request
Fixed issue in rendering post without having a request

File last commit:

r1102:59933a18 default
r1117:899891b1 default
Show More
post.html
87 lines | 3.2 KiB | text/html | HtmlLexer
{% load i18n %}
{% load board %}
{% get_current_language as LANGUAGE_CODE %}
<div class="{{ css_class }}" id="{{ post.id }}">
<div class="post-info">
<a class="post_id" href="{{ post.get_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 and 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 %}
{% 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.all.0 as image %}
{% autoescape off %}
{{ image.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 %}
{% if post.is_referenced %}
<div class="refmap">
{% autoescape off %}
{% trans "Replies" %}: {{ post.refmap }}
{% endautoescape %}
</div>
{% endif %}
</div>
{% 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>