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