##// END OF EJS Templates
Speed up gallery loading a bit. Removed duplicate getting of post list in...
neko259 -
r467:a0c69560 default
parent child Browse files
Show More
@@ -33,7 +33,7 b''
33 </div>
33 </div>
34 {% endif %}
34 {% endif %}
35 <div class="thread">
35 <div class="thread">
36 {% for post in thread.get_replies %}
36 {% for post in posts %}
37 {% if bumpable %}
37 {% if bumpable %}
38 <div class="post" id="{{ post.id }}">
38 <div class="post" id="{{ post.id }}">
39 {% else %}
39 {% else %}
@@ -22,8 +22,7 b''
22 </div>
22 </div>
23
23
24 <div id="posts-table">
24 <div id="posts-table">
25 {% for post in thread.get_replies %}
25 {% for post in posts %}
26 {% if post.image %}
27 <div class="gallery_image">
26 <div class="gallery_image">
28 <div>
27 <div>
29 <a
28 <a
@@ -42,7 +41,6 b''
42 {% image_actions post.image.url request.get_host %}
41 {% image_actions post.image.url request.get_host %}
43 </div>
42 </div>
44 </div>
43 </div>
45 {% endif %}
46 {% endfor %}
44 {% endfor %}
47 </div>
45 </div>
48 {% endcache %}
46 {% endcache %}
@@ -203,6 +203,10 b' def thread(request, post_id, mode=MODE_N'
203
203
204 posts = thread_to_show.get_replies()
204 posts = thread_to_show.get_replies()
205 context['form'] = form
205 context['form'] = form
206 context["last_update"] = _datetime_to_epoch(thread_to_show.last_edit_time)
207 context["thread"] = thread_to_show
208
209 if MODE_NORMAL == mode:
206 context['bumpable'] = thread_to_show.can_bump()
210 context['bumpable'] = thread_to_show.can_bump()
207 if context['bumpable']:
211 if context['bumpable']:
208 context['posts_left'] = neboard.settings.MAX_POSTS_PER_THREAD - posts \
212 context['posts_left'] = neboard.settings.MAX_POSTS_PER_THREAD - posts \
@@ -210,12 +214,13 b' def thread(request, post_id, mode=MODE_N'
210 context['bumplimit_progress'] = str(
214 context['bumplimit_progress'] = str(
211 float(context['posts_left']) /
215 float(context['posts_left']) /
212 neboard.settings.MAX_POSTS_PER_THREAD * 100)
216 neboard.settings.MAX_POSTS_PER_THREAD * 100)
213 context["last_update"] = _datetime_to_epoch(thread_to_show.last_edit_time)
214 context["thread"] = thread_to_show
215
217
216 if MODE_NORMAL == mode:
218 context['posts'] = posts
219
217 document = 'boards/thread.html'
220 document = 'boards/thread.html'
218 elif MODE_GALLERY == mode:
221 elif MODE_GALLERY == mode:
222 context['posts'] = posts.filter(image_width__gt=0)
223
219 document = 'boards/thread_gallery.html'
224 document = 'boards/thread_gallery.html'
220 else:
225 else:
221 raise Http404
226 raise Http404
General Comments 0
You need to be logged in to leave comments. Login now