##// END OF EJS Templates
Added error response sample
Added error response sample

File last commit:

r743:668b1fdf 2.0-dev
r790:fcde444b decentral
Show More
post.html
99 lines | 4.0 KiB | text/html | HtmlLexer
{% load i18n %}
{% load board %}
{% load cache %}
{% get_current_language as LANGUAGE_CODE %}
{% spaceless %}
{% cache 600 post post.id post.last_edit_time thread.archived bumpable truncated moderator LANGUAGE_CODE need_open_link %}
{% if thread.archived %}
<div class="post archive_post" id="{{ post.id }}">
{% elif bumpable %}
<div class="post" id="{{ post.id }}">
{% else %}
<div class="post dead_post" id="{{ post.id }}">
{% endif %}
<div class="post-info">
<a class="post_id" href="{% post_object_url post thread=thread %}"
{% if not truncated and not thread.archived %}
onclick="javascript:addQuickReply('{{ post.id }}'); return false;"
title="{% trans 'Quote' %}"
{% endif %}
>({{ post.id }}) </a>
<span class="title">{{ post.title }} </span>
<span class="pub_time">{{ post.pub_time }}</span>
{% if thread.archived %}
— {{ thread.bump_time }}
{% 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 moderator %}
<span class="moderator_info">
[<a href="{% url 'post_admin' post_id=post.id %}"
>{% trans 'Edit' %}</a>]
[<a href="{% url 'delete' post_id=post.id %}"
>{% trans 'Delete' %}</a>]
({{ post.poster_ip }})
[<a href="{% url 'ban' post_id=post.id %}?next={{ request.path }}"
>{% trans 'Ban IP' %}</a>]
</span>
{% endif %}
</div>
{% if post.images.exists %}
{% with post.images.all.0 as image %}
<div class="image">
<a
class="thumb"
href="{{ image.image.url }}"><img
src="{{ image.image.url_200x150 }}"
alt="{{ post.id }}"
width="{{ image.pre_width }}"
height="{{ image.pre_height }}"
data-width="{{ image.width }}"
data-height="{{ image.height }}"/>
</a>
</div>
{% endwith %}
{% endif %}
<div class="message">
{% autoescape off %}
{% if truncated %}
{{ post.text.rendered|truncatewords_html:50 }}
{% else %}
{{ post.text.rendered }}
{% endif %}
{% endautoescape %}
{% if post.is_referenced %}
<div class="refmap">
{% autoescape off %}
{% trans "Replies" %}: {{ post.refmap }}
{% endautoescape %}
</div>
{% endif %}
</div>
{% endcache %}
{% if is_opening %}
{% cache 600 post_thread thread.id thread.last_edit_time LANGUAGE_CODE need_open_link %}
<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">
{% for tag in thread.get_tags %}
<a class="tag" href="{% url 'tag' tag.name %}">
#{{ tag.name }}</a>{% if not forloop.last %},{% endif %}
{% endfor %}
</span>
</div>
{% endcache %}
{% endif %}
</div>
{% endspaceless %}