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