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