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