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