##// END OF EJS Templates
Optimized post reflinks caching
neko259 -
r570:4b322d4d 1.7-dev
parent child Browse files
Show More
@@ -1,98 +1,100 b''
1 1 {% load i18n %}
2 2 {% load board %}
3 3 {% load cache %}
4 4
5 5 {% get_current_language as LANGUAGE_CODE %}
6 6
7 {% cache 600 post post.id post.thread_new.last_edit_time truncated moderator LANGUAGE_CODE need_open_link %}
7 {% cache 600 post post.id thread.last_edit_time truncated moderator LANGUAGE_CODE need_open_link %}
8 8 {% spaceless %}
9 9 {% with thread=post.thread_new %}
10 10 {% if thread.archived %}
11 11 <div class="post archive_post" id="{{ post.id }}">
12 12 {% elif thread.can_bump %}
13 13 <div class="post" id="{{ post.id }}">
14 14 {% else %}
15 15 <div class="post dead_post" id="{{ post.id }}">
16 16 {% endif %}
17 17
18 18 {% if post.image %}
19 19 <div class="image">
20 20 <a
21 21 class="thumb"
22 22 href="{{ post.image.url }}"><img
23 23 src="{{ post.image.url_200x150 }}"
24 24 alt="{{ post.id }}"
25 25 width="{{ post.image_pre_width }}"
26 26 height="{{ post.image_pre_height }}"
27 27 data-width="{{ post.image_width }}"
28 28 data-height="{{ post.image_height }}"/>
29 29 </a>
30 30 </div>
31 31 {% endif %}
32 32 <div class="message">
33 33 <div class="post-info">
34 34 <span class="title">{{ post.title }}</span>
35 35 <a class="post_id" href="{% post_url post.id %}">
36 36 ({{ post.id }}) </a>
37 37 [<span class="pub_time">{{ post.pub_time }}</span>]
38 38 {% if thread.archived %}
39 39 β€” [{{ thread.bump_time }}]
40 40 {% endif %}
41 41 {% if not truncated and not thread.archived%}
42 42 [<a href="#" onclick="javascript:addQuickReply('{{ post.id }}')
43 43 ; return false;">&gt;&gt;</a>]
44 44 {% endif %}
45 45 {% if post.is_opening and need_open_link %}
46 46 {% if post.thread_new.archived %}
47 47 [<a class="link" href="{% url 'thread' post.id %}">{% trans "Open" %}</a>]
48 48 {% else %}
49 49 [<a class="link" href="{% url 'thread' post.id %}#form">{% trans "Reply" %}</a>]
50 50 {% endif %}
51 51 {% endif %}
52 52
53 53 {% if moderator %}
54 54 <span class="moderator_info">
55 55 [<a href="{% url 'post_admin' post_id=post.id %}"
56 56 >{% trans 'Edit' %}</a>]
57 57 [<a href="{% url 'delete' post_id=post.id %}"
58 58 >{% trans 'Delete' %}</a>]
59 59 ({{ post.poster_ip }})
60 60 [<a href="{% url 'ban' post_id=post.id %}?next={{ request.path }}"
61 61 >{% trans 'Ban IP' %}</a>]
62 62 </span>
63 63 {% endif %}
64 64 </div>
65 65 {% autoescape off %}
66 66 {% if truncated %}
67 67 {{ post.text.rendered|truncatewords_html:50 }}
68 68 {% else %}
69 69 {{ post.text.rendered }}
70 70 {% endif %}
71 71 {% endautoescape %}
72 {% cache 600 post_replies post.id post.last_edit_time moderator LANGUAGE_CODE %}
72 73 {% if post.is_referenced %}
73 74 <div class="refmap">
74 75 {% trans "Replies" %}:
75 76 {% for ref_post in post.get_sorted_referenced_posts %}
76 77 <a href="{% post_url ref_post.id %}">&gt;&gt;{{ ref_post.id }}</a
77 78 >{% if not forloop.last %},{% endif %}
78 79 {% endfor %}
79 80 </div>
80 81 {% endif %}
82 {% endcache %}
81 83 </div>
82 84 {% if post.is_opening and thread.tags.exists %}
83 85 <div class="metadata">
84 86 {% if post.is_opening and need_open_link %}
85 87 {{ thread.get_images_count }} {% trans 'images' %}.
86 88 {% endif %}
87 89 <span class="tags">
88 90 {% for tag in thread.get_tags %}
89 91 <a class="tag" href="{% url 'tag' tag.name %}">
90 92 #{{ tag.name }}</a>{% if not forloop.last %},{% endif %}
91 93 {% endfor %}
92 94 </span>
93 95 </div>
94 96 {% endif %}
95 97 </div>
96 98 {% endwith %}
97 99 {% endspaceless %}
98 100 {% endcache %}
General Comments 0
You need to be logged in to leave comments. Login now