##// END OF EJS Templates
Removed individual post cache. Thread cache is sufficient enough
neko259 -
r897:a211f786 default
parent child Browse files
Show More
@@ -4,95 +4,87 b''
4 4
5 5 {% get_current_language as LANGUAGE_CODE %}
6 6
7 {% spaceless %}
8 {% cache 600 post post.id post.last_edit_time thread.archived bumpable truncated moderator LANGUAGE_CODE need_open_link %}
9 {% if thread.archived %}
10 <div class="post archive_post" id="{{ post.id }}">
11 {% elif bumpable %}
12 <div class="post" id="{{ post.id }}">
13 {% else %}
14 <div class="post dead_post" id="{{ post.id }}">
15 {% endif %}
7 {% if thread.archived %}
8 <div class="post archive_post" id="{{ post.id }}">
9 {% elif bumpable %}
10 <div class="post" id="{{ post.id }}">
11 {% else %}
12 <div class="post dead_post" id="{{ post.id }}">
13 {% endif %}
16 14
17 <div class="post-info">
18 <a class="post_id" href="{% post_object_url post thread=thread %}"
19 {% if not truncated and not thread.archived %}
20 onclick="javascript:addQuickReply('{{ post.id }}'); return false;"
21 title="{% trans 'Quote' %}"
22 {% endif %}
23 >({{ post.id }}) </a>
24 <span class="title">{{ post.title }} </span>
25 <span class="pub_time">{{ post.pub_time }}</span>
26 {% if thread.archived %}
27 β€” {{ thread.bump_time }}
15 <div class="post-info">
16 <a class="post_id" href="{% post_object_url post thread=thread %}"
17 {% if not truncated and not thread.archived %}
18 onclick="javascript:addQuickReply('{{ post.id }}'); return false;"
19 title="{% trans 'Quote' %}" {% endif %}>({{ post.id }})</a>
20 <span class="title">{{ post.title }} </span>
21 <span class="pub_time">{{ post.pub_time }}</span>
22 {% if thread.archived %}
23 β€” {{ thread.bump_time }}
24 {% endif %}
25 {% if is_opening and need_open_link %}
26 {% if thread.archived %}
27 [<a class="link" href="{% url 'thread' post.id %}">{% trans "Open" %}</a>]
28 {% else %}
29 [<a class="link" href="{% url 'thread' post.id %}#form">{% trans "Reply" %}</a>]
30 {% endif %}
31 {% endif %}
32
33 {% if moderator %}
34 <span class="moderator_info">
35 [<a href="{% url 'admin:boards_post_change' post.id %}"
36 >{% trans 'Edit' %}</a>]
37 {% if is_opening %}
38 [<a href="{% url 'admin:boards_thread_change' thread.id %}"
39 >{% trans 'Edit thread' %}</a>]
28 40 {% endif %}
29 {% if is_opening and need_open_link %}
30 {% if thread.archived %}
31 [<a class="link" href="{% url 'thread' post.id %}">{% trans "Open" %}</a>]
32 {% else %}
33 [<a class="link" href="{% url 'thread' post.id %}#form">{% trans "Reply" %}</a>]
34 {% endif %}
35 {% endif %}
36
37 {% if moderator %}
38 <span class="moderator_info">
39 [<a href="{% url 'admin:boards_post_change' post.id %}"
40 >{% trans 'Edit' %}</a>]
41 {% if is_opening %}
42 [<a href="{% url 'admin:boards_thread_change' thread.id %}"
43 >{% trans 'Edit thread' %}</a>]
44 {% endif %}
45 </span>
46 {% endif %}
41 </span>
42 {% endif %}
43 </div>
44 {% if post.images.exists %}
45 {% with post.images.all.0 as image %}
46 <div class="image">
47 <a
48 class="thumb"
49 href="{{ image.image.url }}"><img
50 src="{{ image.image.url_200x150 }}"
51 alt="{{ post.id }}"
52 width="{{ image.pre_width }}"
53 height="{{ image.pre_height }}"
54 data-width="{{ image.width }}"
55 data-height="{{ image.height }}"/>
56 </a>
47 57 </div>
48 {% if post.images.exists %}
49 {% with post.images.all.0 as image %}
50 <div class="image">
51 <a
52 class="thumb"
53 href="{{ image.image.url }}"><img
54 src="{{ image.image.url_200x150 }}"
55 alt="{{ post.id }}"
56 width="{{ image.pre_width }}"
57 height="{{ image.pre_height }}"
58 data-width="{{ image.width }}"
59 data-height="{{ image.height }}"/>
60 </a>
61 </div>
62 {% endwith %}
58 {% endwith %}
59 {% endif %}
60 <div class="message">
61 {% autoescape off %}
62 {% if truncated %}
63 {{ post.get_text|truncatewords_html:50 }}
64 {% else %}
65 {{ post.get_text }}
63 66 {% endif %}
64 <div class="message">
67 {% endautoescape %}
68 {% if post.is_referenced %}
69 <div class="refmap">
65 70 {% autoescape off %}
66 {% if truncated %}
67 {{ post.get_text|truncatewords_html:50 }}
68 {% else %}
69 {{ post.get_text }}
70 {% endif %}
71 {% trans "Replies" %}: {{ post.refmap }}
71 72 {% endautoescape %}
72 {% if post.is_referenced %}
73 <div class="refmap">
74 {% autoescape off %}
75 {% trans "Replies" %}: {{ post.refmap }}
76 {% endautoescape %}
77 </div>
78 {% endif %}
79 73 </div>
80 {% endcache %}
81 {% if is_opening %}
82 {% cache 600 post_thread thread.id thread.last_edit_time LANGUAGE_CODE need_open_link %}
83 <div class="metadata">
84 {% if is_opening and need_open_link %}
85 {{ thread.get_reply_count }} {% trans 'messages' %},
86 {{ thread.get_images_count }} {% trans 'images' %}.
87 {% endif %}
88 <span class="tags">
89 {% for tag in thread.get_tags %}
90 <a class="tag" href="{% url 'tag' tag.name %}">
91 #{{ tag.name }}</a>{% if not forloop.last %},{% endif %}
92 {% endfor %}
93 </span>
94 </div>
95 {% endcache %}
74 {% endif %}
75 </div>
76 {% if is_opening %}
77 <div class="metadata">
78 {% if is_opening and need_open_link %}
79 {{ thread.get_reply_count }} {% trans 'messages' %},
80 {{ thread.get_images_count }} {% trans 'images' %}.
96 81 {% endif %}
97 </div>
98 {% endspaceless %}
82 <span class="tags">
83 {% for tag in thread.get_tags %}
84 <a class="tag" href="{% url 'tag' tag.name %}">
85 #{{ tag.name }}</a>{% if not forloop.last %},{% endif %}
86 {% endfor %}
87 </span>
88 </div>
89 {% endif %}
90 </div>
General Comments 0
You need to be logged in to leave comments. Login now