##// END OF EJS Templates
Fixed thread cache.
neko259 -
r190:ef6c4e9c default
parent child Browse files
Show More
@@ -1,123 +1,123 b''
1 {% extends "boards/base.html" %}
1 {% extends "boards/base.html" %}
2
2
3 {% load i18n %}
3 {% load i18n %}
4 {% load markup %}
4 {% load markup %}
5 {% load cache %}
5 {% load cache %}
6
6
7 {% block head %}
7 {% block head %}
8 <title>Neboard - {{ posts.0.get_title }}</title>
8 <title>Neboard - {{ posts.0.get_title }}</title>
9 {% endblock %}
9 {% endblock %}
10
10
11 {% block content %}
11 {% block content %}
12 <script src="{{ STATIC_URL }}js/thread.js"></script>
12 <script src="{{ STATIC_URL }}js/thread.js"></script>
13
13
14 {% if posts %}
14 {% if posts %}
15 {% cache 600 thread_view posts.0.last_edit_time moderator %}
15 {% cache 600 thread_view posts.0.last_edit_time moderator %}
16 <div id="posts">
16 <div id="posts">
17 {% for post in posts %}
17 {% for post in posts %}
18 {% if bumpable %}
18 {% if bumpable %}
19 <div class="post" id="{{ post.id }}">
19 <div class="post" id="{{ post.id }}">
20 {% else %}
20 {% else %}
21 <div class="post dead_post" id="{{ post.id }}">
21 <div class="post dead_post" id="{{ post.id }}">
22 {% endif %}
22 {% endif %}
23 {% if post.image %}
23 {% if post.image %}
24 <div class="image">
24 <div class="image">
25 <a
25 <a
26 class="fancy"
26 class="fancy"
27 href="{{ post.image.url }}"><img
27 href="{{ post.image.url }}"><img
28 src="{{ post.image.url_200x150 }}"
28 src="{{ post.image.url_200x150 }}"
29 alt="{% trans 'Post image' %}"v
29 alt="{% trans 'Post image' %}"v
30 data-width="{{ post.image_width }}"
30 data-width="{{ post.image_width }}"
31 data-height="{{ post.image_height }}"/>
31 data-height="{{ post.image_height }}"/>
32 </a>
32 </a>
33 </div>
33 </div>
34 {% endif %}
34 {% endif %}
35 <div class="message">
35 <div class="message">
36 <div class="post-info">
36 <div class="post-info">
37 <span class="title">{{ post.title }}</span>
37 <span class="title">{{ post.title }}</span>
38 <a class="post_id" href="#{{ post.id }}">
38 <a class="post_id" href="#{{ post.id }}">
39 (#{{ post.id }})</a>
39 (#{{ post.id }})</a>
40 [{{ post.pub_time }}]
40 [{{ post.pub_time }}]
41 [<a href="#" onclick="javascript:addQuickReply('{{ post.id }}')
41 [<a href="#" onclick="javascript:addQuickReply('{{ post.id }}')
42 ; return false;">&gt;&gt;</a>]
42 ; return false;">&gt;&gt;</a>]
43
43
44 {% if moderator %}
44 {% if moderator %}
45 <span class="moderator_info">
45 <span class="moderator_info">
46 [<a href="{% url 'delete' post_id=post.id %}"
46 [<a href="{% url 'delete' post_id=post.id %}"
47 >{% trans 'Delete' %}</a>]
47 >{% trans 'Delete' %}</a>]
48 ({{ post.poster_ip }})
48 ({{ post.poster_ip }})
49 [<a href="{% url 'ban' post_id=post.id %}?next={{ request.path }}"
49 [<a href="{% url 'ban' post_id=post.id %}?next={{ request.path }}"
50 >{% trans 'Ban IP' %}</a>]
50 >{% trans 'Ban IP' %}</a>]
51 </span>
51 </span>
52 {% endif %}
52 {% endif %}
53 </div>
53 </div>
54 {% autoescape off %}
54 {% autoescape off %}
55 {{ post.text.rendered }}
55 {{ post.text.rendered }}
56 {% endautoescape %}
56 {% endautoescape %}
57 </div>
57 </div>
58 {% if post.id == posts.0.id %}
58 {% if post.id == posts.0.id %}
59 <div class="metadata">
59 <div class="metadata">
60 <span class="tags">{% trans 'Tags' %}:
60 <span class="tags">{% trans 'Tags' %}:
61 {% for tag in post.tags.all %}
61 {% for tag in post.tags.all %}
62 <a class="tag" href="{% url 'tag' tag.name %}">
62 <a class="tag" href="{% url 'tag' tag.name %}">
63 {{ tag.name }}</a>
63 {{ tag.name }}</a>
64 {% endfor %}
64 {% endfor %}
65 </span>
65 </span>
66 </div>
66 </div>
67 {% endif %}
67 {% endif %}
68 </div>
68 </div>
69 {% endfor %}
69 {% endfor %}
70 </div>
70 </div>
71 {% endcache %}
71 {% endcache %}
72 {% endif %}
72 {% endif %}
73
73
74 <form id="form" enctype="multipart/form-data" method="post"
74 <form id="form" enctype="multipart/form-data" method="post"
75 >{% csrf_token %}
75 >{% csrf_token %}
76 <div class="post-form-w">
76 <div class="post-form-w">
77 <div class="form-title">{% trans "Reply to thread" %} #{{ posts.0.id }}</div>
77 <div class="form-title">{% trans "Reply to thread" %} #{{ posts.0.id }}</div>
78 <div class="post-form">
78 <div class="post-form">
79 <div class="form-row">
79 <div class="form-row">
80 <div class="form-label">{% trans 'Title' %}</div>
80 <div class="form-label">{% trans 'Title' %}</div>
81 <div class="form-input">{{ form.title }}</div>
81 <div class="form-input">{{ form.title }}</div>
82 <div class="form-errors">{{ form.title.errors }}</div>
82 <div class="form-errors">{{ form.title.errors }}</div>
83 </div>
83 </div>
84 <div class="form-row">
84 <div class="form-row">
85 <div class="form-label">{% trans 'Text' %}</div>
85 <div class="form-label">{% trans 'Text' %}</div>
86 <div class="form-input">{{ form.text }}</div>
86 <div class="form-input">{{ form.text }}</div>
87 <div class="form-errors">{{ form.text.errors }}</div>
87 <div class="form-errors">{{ form.text.errors }}</div>
88 </div>
88 </div>
89 <div class="form-row">
89 <div class="form-row">
90 <div class="form-label">{% trans 'Image' %}</div>
90 <div class="form-label">{% trans 'Image' %}</div>
91 <div class="form-input">{{ form.image }}</div>
91 <div class="form-input">{{ form.image }}</div>
92 <div class="form-errors">{{ form.image.errors }}</div>
92 <div class="form-errors">{{ form.image.errors }}</div>
93 </div>
93 </div>
94 <div class="form-row">
94 <div class="form-row">
95 {{ form.captcha }}
95 {{ form.captcha }}
96 <div class="form-errors">{{ form.captcha.errors }}</div>
96 <div class="form-errors">{{ form.captcha.errors }}</div>
97 </div>
97 </div>
98 <div class="form-row">
98 <div class="form-row">
99 <div class="form-errors">{{ form.other.errors }}</div>
99 <div class="form-errors">{{ form.other.errors }}</div>
100 </div>
100 </div>
101 </div>
101 </div>
102
102
103 <div class="form-submit"><input type="submit"
103 <div class="form-submit"><input type="submit"
104 value="{% trans "Post" %}"/></div>
104 value="{% trans "Post" %}"/></div>
105 <div><a href="{% url "staticpage" name="help" %}">
105 <div><a href="{% url "staticpage" name="help" %}">
106 {% trans 'Text syntax' %}</a></div>
106 {% trans 'Text syntax' %}</a></div>
107 </div>
107 </div>
108 </form>
108 </form>
109
109
110 {% endblock %}
110 {% endblock %}
111
111
112 {% block metapanel %}
112 {% block metapanel %}
113
113
114 <span class="metapanel">
114 <span class="metapanel">
115 {% cache 600 thread_view posts.0.last_edit_time moderator %}
115 {% cache 600 thread_meta posts.0.last_edit_time moderator %}
116 {{ posts.0.get_reply_count }} {% trans 'replies' %},
116 {{ posts.0.get_reply_count }} {% trans 'replies' %},
117 {{ posts.0.get_images_count }} {% trans 'images' %}.
117 {{ posts.0.get_images_count }} {% trans 'images' %}.
118 {% trans 'Last update: ' %}{{ posts.0.last_edit_time }}
118 {% trans 'Last update: ' %}{{ posts.0.last_edit_time }}
119 [<a href="rss/">RSS</a>]
119 [<a href="rss/">RSS</a>]
120 {% endcache %}
120 {% endcache %}
121 </span>
121 </span>
122
122
123 {% endblock %}
123 {% endblock %}
General Comments 0
You need to be logged in to leave comments. Login now