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