##// END OF EJS Templates
Added thread metadata (replies, images, gets) to the threads list.
Added thread metadata (replies, images, gets) to the threads list.

File last commit:

r30:0d6932e0 default
r30:0d6932e0 default
Show More
posting_general.html
67 lines | 2.5 KiB | text/html | HtmlLexer
{% extends "base.html" %}
{% load i18n %}
{% block content %}
{% if threads %}
{% for thread in threads %}
<div class="post">
{% if thread.image %}
<div class="block">
<a href="{{ thread.image.url }}"><img
src="{{ thread.image.url_200x150 }}" />
</a>
</div>
{% endif %}
<div class="block">
<span class="title">{{ thread.title }}</span>
<span class="post_id">(#{{ thread.id }})</span>
[{{ thread.pub_time }}]
[<a class="link" href="/thread/{{ thread.id }}/">{% trans "View" %}</a>]<br />
{{ thread.text|truncatechars:300 }}<br />
<div class="metadata">
({{ thread.get_reply_count }} {% trans 'replies' %},
{{ thread.get_images_count }} {% trans 'images' %},
{{ thread.get_gets_count }} {% trans 'gets' %})
<br />
{% if thread.tags.all %}
<span class="tags">{% trans 'Tags' %}:
{% for tag in thread.tags.all %}
<a class="tag" href="/tag/{{ tag.name }}">
{{ tag.name }}</a>
{% endfor %}
</span>
{% endif %}
</div>
</div>
</div>
{% endfor %}
{% else %}
No threads found.
<hr />
{% endif %}
<div class="post-form">
<span class="form-title">{% trans "Create new thread" %}</span>
<form enctype="multipart/form-data" method="post">{% csrf_token %}
<div class="form-row">
<div class="form-input">{% trans 'Title' %}</div>
<div class="form-input">{{ form.title }}</div>
</div>
<div class="form-row">
<div class="form-input">{% trans 'Text' %}</div>
<div class="form-input">{{ form.text }}</div>
</div>
<div class="form-row">
<div class="form-input">{% trans 'Image' %}</div>
<div class="form-input">{{ form.image }}</div>
</div>
<div class="form-row">
<div class="form-input">{% trans 'Tags' %}</div>
<div class="form-input">{{ form.tags }}</div>
</div>
<input type="submit" value="{% trans 'Post' %}" />
</form>
</div>
{% endblock %}