##// END OF EJS Templates
Slightly changed and optimized tag thread counters
Slightly changed and optimized tag thread counters

File last commit:

r2087:1a07d841 default
r2087:1a07d841 default
Show More
all_threads.html
152 lines | 6.0 KiB | text/html | HtmlLexer
{% extends "boards/paginated.html" %}
{% load i18n %}
{% load board %}
{% load static %}
{% load tz %}
{% block head %}
<meta name="robots" content="noindex">
{% if tag %}
<title>{{ tag.get_localized_name }} - {{ site_name }}</title>
{% else %}
<title>{{ site_name }}</title>
{% endif %}
{% if prev_page_link %}
<link rel="prev" href="{{ prev_page_link|safe }}" />
{% endif %}
{% if next_page_link %}
<link rel="next" href="{{ next_page_link|safe }}" />
{% endif %}
{% endblock %}
{% block content %}
{% get_current_language as LANGUAGE_CODE %}
{% get_current_timezone as TIME_ZONE %}
{% for banner in banners %}
<div class="post">
<div class="title">{{ banner.title }}</div>
<div>{{ banner.get_text|safe }}</div>
<div>{% trans 'Details' %}: <a href="{{ banner.post.get_absolute_url|safe }}">>>{{ banner.post.id }}</a></div>
</div>
{% endfor %}
{% if tag %}
<div class="tag_info" style="border: solid .5ex #{{ tag.get_color }}">
{% if random_image_post %}
<div class="tag-image">
{% with image=random_image_post.get_first_image %}
<a href="{{ random_image_post.get_absolute_url|safe }}"><img
src="{{ image.get_thumb_url|safe }}"
width="{{ image.get_preview_size.0 }}"
height="{{ image.get_preview_size.1 }}"
alt="{{ random_image_post.id }}"/></a>
{% endwith %}
</div>
{% endif %}
<div class="tag-text-data">
<h2>
/{{ tag.get_view|safe }}/
</h2>
{% if perms.change_tag %}
<div class="moderator_info"><a href="{% url 'admin:boards_tag_change' tag.id %}">{% trans 'Edit tag' %}</a></div>
{% endif %}
<p>
<form action="{% url 'tag' tag.get_name %}" method="post" class="post-button-form">
{% if is_favorite %}
<button name="method" value="unsubscribe" class="fav">★ {% trans "Remove from favorites" %}</button>
{% else %}
<button name="method" value="subscribe" class="not_fav">★ {% trans "Add to favorites" %}</button>
{% endif %}
</form>
&bull;
<form action="{% url 'tag' tag.get_name %}" method="post" class="post-button-form">
{% if is_hidden %}
<button name="method" value="unhide" class="fav">{% trans "Show" %}</button>
{% else %}
<button name="method" value="hide" class="not_fav">{% trans "Hide" %}</button>
{% endif %}
</form>
&bull;
<a href="{% url 'tag_gallery' tag.get_name %}">{% trans 'Gallery' %}</a>
</p>
{% if tag.get_description %}
<p>{{ tag.get_description|safe }}</p>
{% endif %}
<p>
● {{ tag_thread_count_active }} + {{ tag_thread_count_bumplimit }} + {{ tag_thread_count_archive }} = {{ tag_thread_count }}<br/>
♥ {{ tag.get_post_count }}
</p>
{% if tag.get_all_parents %}
<p>
{% for parent in tag.get_all_parents %}
{{ parent.get_view|safe }} &gt;
{% endfor %}
{{ tag.get_view|safe }}
</p>
{% endif %}
{% if tag.get_children.all %}
<p>
{% trans "Subsections: " %}
{% for child in tag.get_children.all %}
{{ child.get_view|safe }}{% if not forloop.last%}, {% endif %}
{% endfor %}
</p>
{% endif %}
</div>
</div>
{% endif %}
{% if threads %}
{% if prev_page_link %}
<div class="page_link">
<a href="{{ prev_page_link }}">&lt;&lt; {% trans "Previous page" %} &lt;&lt;</a>
</div>
{% endif %}
{% for thread in threads %}
<div class="thread">
{% post_view thread.get_opening_post thread=thread truncated=True need_open_link=True %}
{% if not thread.archived %}
{% with last_replies=thread.get_last_replies %}
{% if last_replies %}
{% with skipped_replies_count=thread.get_skipped_replies_count %}
{% if skipped_replies_count %}
<div class="skipped_replies">
<a href="{% url 'thread' thread.get_opening_post_id %}">
{% blocktrans count count=skipped_replies_count %}Skipped {{ count }} reply. Open thread to see all replies.{% plural %}Skipped {{ count }} replies. Open thread to see all replies.{% endblocktrans %}
</a>
</div>
{% endif %}
{% endwith %}
<div class="last-replies">
{% for post in last_replies %}
{% post_view post truncated=True %}
{% endfor %}
</div>
{% endif %}
{% endwith %}
{% endif %}
</div>
{% endfor %}
{% if next_page_link %}
<div class="page_link">
<a href="{{ next_page_link }}">&gt;&gt; {% trans "Next page" %} &gt;&gt;</a>
</div>
{% endif %}
{% else %}
<div class="post">
{% trans 'No threads exist. Create the first one!' %}</div>
{% endif %}
{% form_view form=form new_thread=True %}
<script src="{% static 'js/thread_create.js' %}"></script>
{% endblock %}