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