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