##// END OF EJS Templates
Prettier tag view in the tag threads list page
neko259 -
r1406:e5b2dd80 default
parent child Browse files
Show More
@@ -1,196 +1,196 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 {{ tag.get_view|safe }}
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 76 {% with active_count=tag.get_active_thread_count bumplimit_count=tag.get_bumplimit_thread_count archived_count=tag.get_archived_thread_count %}
77 77 {% if active_count %}
78 78 {% blocktrans count count=active_count %}{{ count }} active thread{% plural %}active threads{% endblocktrans %},
79 79 {% endif %}
80 80 {% if bumplimit_count %}
81 81 {% blocktrans count count=bumplimit_count %}{{ count }} thread in bumplimit{% plural %} threads in bumplimit{% endblocktrans %},
82 82 {% endif %}
83 83 {% if archived_count %}
84 84 {% blocktrans count count=archived_count %}{{ count }} archived thread{% plural %}archived threads{% endblocktrans %},
85 85 {% endif %}
86 86 {% endwith %}
87 87 {% blocktrans count count=tag.get_post_count %}{{ count }} message{% plural %}messages{% endblocktrans %}.
88 88 </p>
89 89 {% if tag.get_all_parents %}
90 90 <p>
91 91 {% for parent in tag.get_all_parents %}
92 92 {{ parent.get_view|safe }} &gt;
93 93 {% endfor %}
94 94 {{ tag.get_view|safe }}
95 95 </p>
96 96 {% endif %}
97 97 </div>
98 98 </div>
99 99 {% endif %}
100 100
101 101 {% if threads %}
102 102 {% if prev_page_link %}
103 103 <div class="page_link">
104 104 <a href="{{ prev_page_link }}">{% trans "Previous page" %}</a>
105 105 </div>
106 106 {% endif %}
107 107
108 108 {% for thread in threads %}
109 109 <div class="thread">
110 110 {% post_view thread.get_opening_post thread=thread truncated=True need_open_link=True %}
111 111 {% if not thread.archived %}
112 112 {% with last_replies=thread.get_last_replies %}
113 113 {% if last_replies %}
114 114 {% with skipped_replies_count=thread.get_skipped_replies_count %}
115 115 {% if skipped_replies_count %}
116 116 <div class="skipped_replies">
117 117 <a href="{% url 'thread' thread.get_opening_post_id %}">
118 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 %}
119 119 </a>
120 120 </div>
121 121 {% endif %}
122 122 {% endwith %}
123 123 <div class="last-replies">
124 124 {% for post in last_replies %}
125 125 {% post_view post truncated=True %}
126 126 {% endfor %}
127 127 </div>
128 128 {% endif %}
129 129 {% endwith %}
130 130 {% endif %}
131 131 </div>
132 132 {% endfor %}
133 133
134 134 {% if next_page_link %}
135 135 <div class="page_link">
136 136 <a href="{{ next_page_link }}">{% trans "Next page" %}</a>
137 137 </div>
138 138 {% endif %}
139 139 {% else %}
140 140 <div class="post">
141 141 {% trans 'No threads exist. Create the first one!' %}</div>
142 142 {% endif %}
143 143
144 144 <div class="post-form-w">
145 145 <script src="{% static 'js/panel.js' %}"></script>
146 146 <div class="post-form">
147 147 <div class="form-title">{% trans "Create new thread" %}</div>
148 148 <div class="swappable-form-full">
149 149 <form enctype="multipart/form-data" method="post" id="form">{% csrf_token %}
150 150 {{ form.as_div }}
151 151 <div class="form-submit">
152 152 <input type="submit" value="{% trans "Post" %}"/>
153 153 <button id="preview-button" onclick="return false;">{% trans 'Preview' %}</button>
154 154 </div>
155 155 </form>
156 156 </div>
157 157 <div>
158 158 {% trans 'Tags must be delimited by spaces. Text or image is required.' %}
159 159 {% with size=max_file_size|filesizeformat %}
160 160 {% blocktrans %}Max file size is {{ size }}.{% endblocktrans %}
161 161 {% endwith %}
162 162 </div>
163 163 <div id="preview-text"></div>
164 164 <div><a href="{% url "staticpage" name="help" %}">{% trans 'Text syntax' %}</a></div>
165 165 <div><a href="{% url "tags" "required" %}">{% trans 'Tags' %}</a></div>
166 166 </div>
167 167 </div>
168 168
169 169 <script src="{% static 'js/form.js' %}"></script>
170 170 <script src="{% static 'js/thread_create.js' %}"></script>
171 171
172 172 {% endblock %}
173 173
174 174 {% block metapanel %}
175 175
176 176 <span class="metapanel">
177 177 <b><a href="{% url "authors" %}">{{ site_name }}</a> {{ version }}</b>
178 178 {% trans "Pages:" %}
179 179 [
180 180 {% with dividers=paginator.get_dividers %}
181 181 {% for page in paginator.get_divided_range %}
182 182 {% if page in dividers %}
183 183 …,
184 184 {% endif %}
185 185 <a
186 186 {% ifequal page current_page.number %}
187 187 class="current_page"
188 188 {% endifequal %}
189 189 href="{% page_url paginator page %}">{{ page }}</a>
190 190 {% if not forloop.last %},{% endif %}
191 191 {% endfor %}
192 192 {% endwith %}
193 193 ]
194 194 </span>
195 195
196 196 {% endblock %}
General Comments 0
You need to be logged in to leave comments. Login now