##// END OF EJS Templates
Removed threads list cache cause it's causing problems with tags view.
neko259 -
r192:ae8703f0 default
parent child Browse files
Show More
@@ -1,193 +1,191 b''
1 1 {% extends "boards/base.html" %}
2 2
3 3 {% load i18n %}
4 4 {% load markup %}
5 5 {% load cache %}
6 6
7 7 {% block head %}
8 8 {% if tag %}
9 9 <title>Neboard - {{ tag.name }}</title>
10 10 {% else %}
11 11 <title>Neboard</title>
12 12 {% endif %}
13 13 {% endblock %}
14 14
15 15 {% block content %}
16 16
17 17 {% if tag %}
18 18 <div class="tag_info">
19 19 <h2>{% trans 'Tag: ' %}{{ tag.name }}
20 20 {% if tag in user.fav_tags.all %}
21 21 <a href="{% url 'tag_unsubscribe' tag.name %}?next={{ request.path }}"
22 22 class="fav">β˜…</a>
23 23 {% else %}
24 24 <a href="{% url 'tag_subscribe' tag.name %}?next={{ request.path }}"
25 25 class="not_fav">β˜…</a>
26 26 {% endif %}
27 27 </h2>
28 28 </div>
29 29 {% endif %}
30 30
31 31 {% if threads %}
32 {% cache 600 thread_cache threads.0.thread.last_edit_time moderator %}
33 32 {% for thread in threads %}
34 33 <div class="thread">
35 34 {% if thread.bumpable %}
36 35 <div class="post" id="{{ thread.thread.id }}">
37 36 {% else %}
38 37 <div class="post dead_post" id="{{ thread.thread.id }}">
39 38 {% endif %}
40 39 {% if thread.thread.image %}
41 40 <div class="image">
42 41 <a class="fancy"
43 42 href="{{ thread.thread.image.url }}"><img
44 43 src="{{ thread.thread.image.url_200x150 }}"
45 44 alt="{% trans 'Post image' %}"
46 45 data-width="{{ thread.thread.image_width }}"
47 46 data-height="{{ thread.thread.image_height }}" />
48 47 </a>
49 48 </div>
50 49 {% endif %}
51 50 <div class="message">
52 51 <div class="post-info">
53 52 <span class="title">{{ thread.thread.title }}</span>
54 53 <a class="post_id" href="{% url 'thread' thread.thread.id %}"
55 54 >(#{{ thread.thread.id }})</a>
56 55 [{{ thread.thread.pub_time }}]
57 56 [<a class="link" href="{% url 'thread' thread.thread.id %}#form"
58 57 >{% trans "Reply" %}</a>]
59 58
60 59 {% if moderator %}
61 60 <span class="moderator_info">
62 61 [<a href="{% url 'delete' post_id=thread.thread.id %}?next={{ request.path }}"
63 62 >{% trans 'Delete' %}</a>]
64 63 ({{ thread.thread.poster_ip }})
65 64 [<a href="{% url 'ban' post_id=thread.thread.id %}?next={{ request.path }}"
66 65 >{% trans 'Ban IP' %}</a>]
67 66 </span>
68 67 {% endif %}
69 68 </div>
70 69 {% autoescape off %}
71 70 {{ thread.thread.text.rendered|truncatewords_html:50 }}
72 71 {% endautoescape %}
73 72 </div>
74 73 <div class="metadata">
75 74 {{ thread.thread.get_reply_count }} {% trans 'replies' %},
76 75 {{ thread.thread.get_images_count }} {% trans 'images' %}.
77 76 {% if thread.thread.tags %}
78 77 <span class="tags">{% trans 'Tags' %}:
79 78 {% for tag in thread.thread.tags.all %}
80 79 <a class="tag" href="
81 80 {% url 'tag' tag_name=tag.name %}">
82 81 {{ tag.name }}</a>
83 82 {% endfor %}
84 83 </span>
85 84 {% endif %}
86 85 </div>
87 86 </div>
88 87 {% if thread.thread.get_last_replies.exists %}
89 88 <div class="last-replies">
90 89 {% for post in thread.thread.get_last_replies %}
91 90 {% if thread.bumpable %}
92 91 <div class="post" id="{{ post.id }}">
93 92 {% else %}
94 93 <div class="post dead_post" id="{{ post.id }}">
95 94 {% endif %}
96 95 {% if post.image %}
97 96 <div class="image">
98 97 <a class="fancy"
99 98 href="{{ post.image.url }}"><img
100 99 src=" {{ post.image.url_200x150 }}"
101 100 alt="{% trans 'Post image' %}"
102 101 data-width="{{ post.image_width }}"
103 102 data-height="{{ post.image_height }}"/>
104 103 </a>
105 104 </div>
106 105 {% endif %}
107 106 <div class="message">
108 107 <div class="post-info">
109 108 <span class="title">{{ post.title }}</span>
110 109 <a class="post_id" href="
111 110 {% url 'thread' thread.thread.id %}#{{ post.id }}">
112 111 (#{{ post.id }})</a>
113 112 [{{ post.pub_time }}]
114 113 </div>
115 114 {% autoescape off %}
116 115 {{ post.text.rendered|truncatewords_html:50 }}
117 116 {% endautoescape %}
118 117 </div>
119 118 </div>
120 119 {% endfor %}
121 120 </div>
122 121 {% endif %}
123 122 </div>
124 123 {% endfor %}
125 {% endcache %}
126 124 {% else %}
127 125 <div class="post">
128 126 {% trans 'No threads exist. Create the first one!' %}</div>
129 127 {% endif %}
130 128
131 129 <form enctype="multipart/form-data" method="post">{% csrf_token %}
132 130 <div class="post-form-w">
133 131
134 132 <div class="form-title">{% trans "Create new thread" %}</div>
135 133 <div class="post-form">
136 134 <div class="form-row">
137 135 <div class="form-label">{% trans 'Title' %}</div>
138 136 <div class="form-input">{{ form.title }}</div>
139 137 <div class="form-errors">{{ form.title.errors }}</div>
140 138 </div>
141 139 <div class="form-row">
142 140 <div class="form-label">{% trans 'Text' %}</div>
143 141 <div class="form-input">{{ form.text }}</div>
144 142 <div class="form-errors">{{ form.text.errors }}</div>
145 143 </div>
146 144 <div class="form-row">
147 145 <div class="form-label">{% trans 'Image' %}</div>
148 146 <div class="form-input">{{ form.image }}</div>
149 147 <div class="form-errors">{{ form.image.errors }}</div>
150 148 </div>
151 149 <div class="form-row">
152 150 <div class="form-label">{% trans 'Tags' %}</div>
153 151 <div class="form-input">{{ form.tags }}</div>
154 152 <div class="form-errors">{{ form.tags.errors }}</div>
155 153 </div>
156 154 <div class="form-row">
157 155 {{ form.captcha }}
158 156 <div class="form-errors">{{ form.captcha.errors }}</div>
159 157 </div>
160 158 <div class="form-row">
161 159 <div class="form-errors">{{ form.other.errors }}</div>
162 160 </div>
163 161 </div>
164 162 <div class="form-submit">
165 163 <input type="submit" value="{% trans "Post" %}"/></div>
166 164 <div>
167 165 {% trans 'Tags must be delimited by spaces. Text or image is required.' %}
168 166 </div>
169 167 <div><a href="{% url "staticpage" name="help" %}">
170 168 {% trans 'Text syntax' %}</a></div>
171 169 </div>
172 170 </form>
173 171
174 172 {% endblock %}
175 173
176 174 {% block metapanel %}
177 175
178 176 <span class="metapanel">
179 177 <b><a href="{% url "authors" %}">Neboard</a> 1.1</b>
180 178 {% trans "Pages:" %}
181 179 {% for page in pages %}
182 180 [<a href="
183 181 {% if tag %}
184 182 {% url "tag" tag_name=tag page=page %}
185 183 {% else %}
186 184 {% url "index" page=page %}
187 185 {% endif %}
188 186 ">{{ page }}</a>]
189 187 {% endfor %}
190 188 [<a href="rss/">RSS</a>]
191 189 </span>
192 190
193 191 {% endblock %}
General Comments 0
You need to be logged in to leave comments. Login now