##// END OF EJS Templates
Show only non-zero thread count in the tag detailed info
neko259 -
r1397:b2b4d7e6 default
parent child Browse files
Show More
@@ -1,189 +1,197 b''
1 1 {% extends "boards/base.html" %}
2 2
3 3 {% load i18n %}
4 4 {% load board %}
5 5 {% load static %}
6 6 {% load tz %}
7 7
8 8 {% block head %}
9 9 <meta name="robots" content="noindex">
10 10
11 11 {% if tag %}
12 12 <title>{{ tag.name }} - {{ site_name }}</title>
13 13 {% else %}
14 14 <title>{{ site_name }}</title>
15 15 {% endif %}
16 16
17 17 {% if prev_page_link %}
18 18 <link rel="prev" href="{{ prev_page_link }}" />
19 19 {% endif %}
20 20 {% if next_page_link %}
21 21 <link rel="next" href="{{ next_page_link }}" />
22 22 {% endif %}
23 23
24 24 {% endblock %}
25 25
26 26 {% block content %}
27 27
28 28 {% get_current_language as LANGUAGE_CODE %}
29 29 {% get_current_timezone as TIME_ZONE %}
30 30
31 31 {% for banner in banners %}
32 32 <div class="post">
33 33 <div class="title">{{ banner.title }}</div>
34 34 <div>{{ banner.text }}</div>
35 35 <div>{% trans 'Related message' %}: <a href="{{ banner.post.get_absolute_url }}">>>{{ banner.post.id }}</a></div>
36 36 </div>
37 37 {% endfor %}
38 38
39 39 {% if tag %}
40 40 <div class="tag_info" style="border-bottom: solid .5ex #{{ tag.get_color }}">
41 41 {% if random_image_post %}
42 42 <div class="tag-image">
43 43 {% with image=random_image_post.images.first %}
44 44 <a href="{{ random_image_post.get_absolute_url }}"><img
45 45 src="{{ image.image.url_200x150 }}"
46 46 width="{{ image.pre_width }}"
47 47 height="{{ image.pre_height }}"/></a>
48 48 {% endwith %}
49 49 </div>
50 50 {% endif %}
51 51 <div class="tag-text-data">
52 52 <h2>
53 53 <form action="{% url 'tag' tag.name %}" method="post" class="post-button-form">
54 54 {% if is_favorite %}
55 55 <button name="method" value="unsubscribe" class="fav"></button>
56 56 {% else %}
57 57 <button name="method" value="subscribe" class="not_fav"></button>
58 58 {% endif %}
59 59 </form>
60 60 <form action="{% url 'tag' tag.name %}" method="post" class="post-button-form">
61 61 {% if is_hidden %}
62 62 <button name="method" value="unhide" class="fav">H</button>
63 63 {% else %}
64 64 <button name="method" value="hide" class="not_fav">H</button>
65 65 {% endif %}
66 66 </form>
67 67 {{ tag.get_view|safe }}
68 68 {% if perms.change_tag %}
69 69 <span class="moderator_info">| <a href="{% url 'admin:boards_tag_change' tag.id %}">{% trans 'Edit tag' %}</a></span>
70 70 {% endif %}
71 71 </h2>
72 72 {% if tag.get_description %}
73 73 <p>{{ tag.get_description|safe }}</p>
74 74 {% endif %}
75 75 <p>
76 {% blocktrans count count=tag.get_active_thread_count %}{{ count }} active thread{% plural %}active threads{% endblocktrans %},
77 {% blocktrans count count=tag.get_bumplimit_thread_count %}{{ count }} thread in bumplimit{% plural %} threads in bumplimit{% endblocktrans %},
78 {% blocktrans count count=tag.get_archived_thread_count %}{{ count }} archived thread{% plural %}archived threads{% endblocktrans %},
76 {% with active_count=tag.get_active_thread_count bumplimit_count=tag.get_bumplimit_thread_count archived_count=tag.get_archived_thread_count %}
77 {% if active_count %}
78 {% blocktrans count count=active_count %}{{ count }} active thread{% plural %}active threads{% endblocktrans %},
79 {% endif %}
80 {% if bumplimit_count %}
81 {% blocktrans count count=bumplimit_count %}{{ count }} thread in bumplimit{% plural %} threads in bumplimit{% endblocktrans %},
82 {% endif %}
83 {% if archived_count %}
84 {% blocktrans count count=archived_count %}{{ count }} archived thread{% plural %}archived threads{% endblocktrans %},
85 {% endif %}
86 {% endwith %}
79 87 {% blocktrans count count=tag.get_post_count %}{{ count }} message{% plural %}messages{% endblocktrans %}.
80 88 </p>
81 89 {% if tag.get_all_parents %}
82 90 <p>
83 91 {% for parent in tag.get_all_parents %}
84 92 {{ parent.get_view|safe }} &gt;
85 93 {% endfor %}
86 94 {{ tag.get_view|safe }}
87 95 </p>
88 96 {% endif %}
89 97 </div>
90 98 </div>
91 99 {% endif %}
92 100
93 101 {% if threads %}
94 102 {% if prev_page_link %}
95 103 <div class="page_link">
96 104 <a href="{{ prev_page_link }}">{% trans "Previous page" %}</a>
97 105 </div>
98 106 {% endif %}
99 107
100 108 {% for thread in threads %}
101 109 <div class="thread">
102 110 {% post_view thread.get_opening_post thread=thread truncated=True need_open_link=True %}
103 111 {% if not thread.archived %}
104 112 {% with last_replies=thread.get_last_replies %}
105 113 {% if last_replies %}
106 114 {% with skipped_replies_count=thread.get_skipped_replies_count %}
107 115 {% if skipped_replies_count %}
108 116 <div class="skipped_replies">
109 117 <a href="{% url 'thread' thread.get_opening_post_id %}">
110 118 {% 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 %}
111 119 </a>
112 120 </div>
113 121 {% endif %}
114 122 {% endwith %}
115 123 <div class="last-replies">
116 124 {% for post in last_replies %}
117 125 {% post_view post truncated=True %}
118 126 {% endfor %}
119 127 </div>
120 128 {% endif %}
121 129 {% endwith %}
122 130 {% endif %}
123 131 </div>
124 132 {% endfor %}
125 133
126 134 {% if next_page_link %}
127 135 <div class="page_link">
128 136 <a href="{{ next_page_link }}">{% trans "Next page" %}</a>
129 137 </div>
130 138 {% endif %}
131 139 {% else %}
132 140 <div class="post">
133 141 {% trans 'No threads exist. Create the first one!' %}</div>
134 142 {% endif %}
135 143
136 144 <div class="post-form-w">
137 145 <script src="{% static 'js/panel.js' %}"></script>
138 146 <div class="post-form">
139 147 <div class="form-title">{% trans "Create new thread" %}</div>
140 148 <div class="swappable-form-full">
141 149 <form enctype="multipart/form-data" method="post" id="form">{% csrf_token %}
142 150 {{ form.as_div }}
143 151 <div class="form-submit">
144 152 <input type="submit" value="{% trans "Post" %}"/>
145 153 <button id="preview-button" onclick="return false;">{% trans 'Preview' %}</button>
146 154 </div>
147 155 </form>
148 156 </div>
149 157 <div>
150 158 {% trans 'Tags must be delimited by spaces. Text or image is required.' %}
151 159 {% with size=max_file_size|filesizeformat %}
152 160 {% blocktrans %}Max file size is {{ size }}.{% endblocktrans %}
153 161 {% endwith %}
154 162 </div>
155 163 <div id="preview-text"></div>
156 164 <div><a href="{% url "staticpage" name="help" %}">{% trans 'Text syntax' %}</a></div>
157 165 <div><a href="{% url "tags" "required" %}">{% trans 'Tags' %}</a></div>
158 166 </div>
159 167 </div>
160 168
161 169 <script src="{% static 'js/form.js' %}"></script>
162 170 <script src="{% static 'js/thread_create.js' %}"></script>
163 171
164 172 {% endblock %}
165 173
166 174 {% block metapanel %}
167 175
168 176 <span class="metapanel">
169 177 <b><a href="{% url "authors" %}">{{ site_name }}</a> {{ version }}</b>
170 178 {% trans "Pages:" %}
171 179 [
172 180 {% with dividers=paginator.get_dividers %}
173 181 {% for page in paginator.get_divided_range %}
174 182 {% if page in dividers %}
175 183 …,
176 184 {% endif %}
177 185 <a
178 186 {% ifequal page current_page.number %}
179 187 class="current_page"
180 188 {% endifequal %}
181 189 href="{% page_url paginator page %}">{{ page }}</a>
182 190 {% if not forloop.last %},{% endif %}
183 191 {% endfor %}
184 192 {% endwith %}
185 193 ]
186 194 [<a href="rss/">RSS</a>]
187 195 </span>
188 196
189 197 {% endblock %}
General Comments 0
You need to be logged in to leave comments. Login now