##// END OF EJS Templates
Merged with default
neko259 -
r1020:0e2fda16 merge decentral
parent child Browse files
Show More
@@ -1,56 +1,93 b''
1 /*
1 /*
2 @licstart The following is the entire license notice for the
2 @licstart The following is the entire license notice for the
3 JavaScript code in this page.
3 JavaScript code in this page.
4
4
5
5
6 Copyright (C) 2013 neko259
6 Copyright (C) 2013 neko259
7
7
8 The JavaScript code in this page is free software: you can
8 The JavaScript code in this page is free software: you can
9 redistribute it and/or modify it under the terms of the GNU
9 redistribute it and/or modify it under the terms of the GNU
10 General Public License (GNU GPL) as published by the Free Software
10 General Public License (GNU GPL) as published by the Free Software
11 Foundation, either version 3 of the License, or (at your option)
11 Foundation, either version 3 of the License, or (at your option)
12 any later version. The code is distributed WITHOUT ANY WARRANTY;
12 any later version. The code is distributed WITHOUT ANY WARRANTY;
13 without even the implied warranty of MERCHANTABILITY or FITNESS
13 without even the implied warranty of MERCHANTABILITY or FITNESS
14 FOR A PARTICULAR PURPOSE. See the GNU GPL for more details.
14 FOR A PARTICULAR PURPOSE. See the GNU GPL for more details.
15
15
16 As additional permission under GNU GPL version 3 section 7, you
16 As additional permission under GNU GPL version 3 section 7, you
17 may distribute non-source (e.g., minimized or compacted) forms of
17 may distribute non-source (e.g., minimized or compacted) forms of
18 that code without the copy of the GNU GPL normally required by
18 that code without the copy of the GNU GPL normally required by
19 section 4, provided you include this license notice and a URL
19 section 4, provided you include this license notice and a URL
20 through which recipients can access the Corresponding Source.
20 through which recipients can access the Corresponding Source.
21
21
22 @licend The above is the entire license notice
22 @licend The above is the entire license notice
23 for the JavaScript code in this page.
23 for the JavaScript code in this page.
24 */
24 */
25
25
26 var LOCALE = window.navigator.language;
27 var FORMATTER = new Intl.DateTimeFormat(
28 LOCALE,
29 {
30 weekday: 'short', year: 'numeric', month: 'short', day: 'numeric',
31 hour: 'numeric', minute: '2-digit', second: '2-digit'
32 }
33 );
34
26 /**
35 /**
27 * An email is a hidden file to prevent spam bots from posting. It has to be
36 * An email is a hidden file to prevent spam bots from posting. It has to be
28 * hidden.
37 * hidden.
29 */
38 */
30 function hideEmailFromForm() {
39 function hideEmailFromForm() {
31 $('.form-email').parent().parent().hide();
40 $('.form-email').parent().parent().hide();
32 }
41 }
33
42
34 /**
43 /**
35 * Highlight code blocks with code highlighter
44 * Highlight code blocks with code highlighter
36 */
45 */
37 function highlightCode(node) {
46 function highlightCode(node) {
38 node.find('pre code').each(function(i, e) {
47 node.find('pre code').each(function(i, e) {
39 hljs.highlightBlock(e);
48 hljs.highlightBlock(e);
40 });
49 });
41 }
50 }
42
51
52 /**
53 * Translate timestamps to local ones for all <time> tags inside node.
54 */
55 function translate_time(node) {
56 var elements;
57
58 if (node === null) {
59 elements = $('time');
60 } else {
61 elements = node.find('time');
62 }
63
64 if (!elements.length) {
65 return;
66 }
67
68 elements.each(function() {
69 var element = $(this);
70 var dateAttr = element.attr('datetime');
71 if (dateAttr) {
72 var date = new Date(dateAttr);
73 element.text(FORMATTER.format(date));
74 }
75 });
76 }
77
43 $( document ).ready(function() {
78 $( document ).ready(function() {
44 hideEmailFromForm();
79 hideEmailFromForm();
45
80
46 $("a[href='#top']").click(function() {
81 $("a[href='#top']").click(function() {
47 $("html, body").animate({ scrollTop: 0 }, "slow");
82 $("html, body").animate({ scrollTop: 0 }, "slow");
48 return false;
83 return false;
49 });
84 });
50
85
51 addImgPreview();
86 addImgPreview();
52
87
53 addRefLinkPreview();
88 addRefLinkPreview();
54
89
55 highlightCode($(document));
90 highlightCode($(document));
91
92 translate_time(null);
56 });
93 });
@@ -1,100 +1,101 b''
1 function $X(path, root) {
1 function $X(path, root) {
2 return document.evaluate(path, root || document, null, 6, null);
2 return document.evaluate(path, root || document, null, 6, null);
3 }
3 }
4 function $x(path, root) {
4 function $x(path, root) {
5 return document.evaluate(path, root || document, null, 8, null).singleNodeValue;
5 return document.evaluate(path, root || document, null, 8, null).singleNodeValue;
6 }
6 }
7
7
8 function $del(el) {
8 function $del(el) {
9 if(el) el.parentNode.removeChild(el);
9 if(el) el.parentNode.removeChild(el);
10 }
10 }
11
11
12 function $each(list, fn) {
12 function $each(list, fn) {
13 if(!list) return;
13 if(!list) return;
14 var i = list.snapshotLength;
14 var i = list.snapshotLength;
15 if(i > 0) while(i--) fn(list.snapshotItem(i), i);
15 if(i > 0) while(i--) fn(list.snapshotItem(i), i);
16 }
16 }
17
17
18 function addRefLinkPreview(node) {
18 function addRefLinkPreview(node) {
19 $each($X('.//a[starts-with(text(),">>")]', node || document), function(link) {
19 $each($X('.//a[starts-with(text(),">>")]', node || document), function(link) {
20 link.addEventListener('mouseover', showPostPreview, false);
20 link.addEventListener('mouseover', showPostPreview, false);
21 link.addEventListener('mouseout', delPostPreview, false);
21 link.addEventListener('mouseout', delPostPreview, false);
22 });
22 });
23 }
23 }
24
24
25 function showPostPreview(e) {
25 function showPostPreview(e) {
26 var doc = document;
26 var doc = document;
27 //ref id
27 //ref id
28 var pNum = $(this).text().match(/\d+/);
28 var pNum = $(this).text().match(/\d+/);
29
29
30 if (pNum == null || pNum.length == 0) {
30 if (pNum == null || pNum.length == 0) {
31 return;
31 return;
32 }
32 }
33
33
34 //position
34 //position
35 //var x = e.clientX + (doc.documentElement.scrollLeft || doc.body.scrollLeft) - doc.documentElement.clientLeft + 1;
35 //var x = e.clientX + (doc.documentElement.scrollLeft || doc.body.scrollLeft) - doc.documentElement.clientLeft + 1;
36 //var y = e.clientY + (doc.documentElement.scrollTop || doc.body.scrollTop) - doc.documentElement.clientTop;
36 //var y = e.clientY + (doc.documentElement.scrollTop || doc.body.scrollTop) - doc.documentElement.clientTop;
37
37
38 var x = e.clientX + (doc.documentElement.scrollLeft || doc.body.scrollLeft) + 2;
38 var x = e.clientX + (doc.documentElement.scrollLeft || doc.body.scrollLeft) + 2;
39 var y = e.clientY + (doc.documentElement.scrollTop || doc.body.scrollTop);
39 var y = e.clientY + (doc.documentElement.scrollTop || doc.body.scrollTop);
40
40
41 var cln = doc.createElement('div');
41 var cln = doc.createElement('div');
42 cln.id = 'pstprev_' + pNum;
42 cln.id = 'pstprev_' + pNum;
43 cln.className = 'post_preview';
43 cln.className = 'post_preview';
44
44
45 cln.style.cssText = 'top:' + y + 'px;' + (x < doc.body.clientWidth/2 ? 'left:' + x + 'px' : 'right:' + parseInt(doc.body.clientWidth - x + 1) + 'px');
45 cln.style.cssText = 'top:' + y + 'px;' + (x < doc.body.clientWidth/2 ? 'left:' + x + 'px' : 'right:' + parseInt(doc.body.clientWidth - x + 1) + 'px');
46
46
47 cln.addEventListener('mouseout', delPostPreview, false);
47 cln.addEventListener('mouseout', delPostPreview, false);
48
48
49
49
50 var mkPreview = function(cln, html) {
50 var mkPreview = function(cln, html) {
51 cln.innerHTML = html;
51 cln.innerHTML = html;
52
52
53 highlightCode($(cln));
53 highlightCode($(cln));
54 addRefLinkPreview(cln);
54 addRefLinkPreview(cln);
55 translate_time($(cln));
55 };
56 };
56
57
57
58
58 cln.innerHTML = "<div class=\"post\">" + gettext('Loading...') + "</div>";
59 cln.innerHTML = "<div class=\"post\">" + gettext('Loading...') + "</div>";
59
60
60 if($('div[id='+pNum+']').length > 0) {
61 if($('div[id='+pNum+']').length > 0) {
61 var postdata = $('div[id='+pNum+']').clone().wrap("<div/>").parent().html();
62 var postdata = $('div[id='+pNum+']').clone().wrap("<div/>").parent().html();
62
63
63 mkPreview(cln, postdata);
64 mkPreview(cln, postdata);
64 } else {
65 } else {
65 $.ajax({
66 $.ajax({
66 url: '/api/post/' + pNum + '/?truncated'
67 url: '/api/post/' + pNum + '/?truncated'
67 })
68 })
68 .success(function(data) {
69 .success(function(data) {
69 var postdata = $(data).wrap("<div/>").parent().html();
70 var postdata = $(data).wrap("<div/>").parent().html();
70
71
71 //make preview
72 //make preview
72 mkPreview(cln, postdata);
73 mkPreview(cln, postdata);
73
74
74 })
75 })
75 .error(function() {
76 .error(function() {
76 cln.innerHTML = "<div class=\"post\">"
77 cln.innerHTML = "<div class=\"post\">"
77 + gettext('Post not found') + "</div>";
78 + gettext('Post not found') + "</div>";
78 });
79 });
79 }
80 }
80
81
81 $del(doc.getElementById(cln.id));
82 $del(doc.getElementById(cln.id));
82
83
83 //add preview
84 //add preview
84 $(cln).fadeIn(200);
85 $(cln).fadeIn(200);
85 $('body').append(cln);
86 $('body').append(cln);
86 }
87 }
87
88
88 function delPostPreview(e) {
89 function delPostPreview(e) {
89 var el = $x('ancestor-or-self::*[starts-with(@id,"pstprev")]', e.relatedTarget);
90 var el = $x('ancestor-or-self::*[starts-with(@id,"pstprev")]', e.relatedTarget);
90 if(!el) $each($X('.//div[starts-with(@id,"pstprev")]'), function(clone) {
91 if(!el) $each($X('.//div[starts-with(@id,"pstprev")]'), function(clone) {
91 $del(clone)
92 $del(clone)
92 });
93 });
93 else while(el.nextSibling) $del(el.nextSibling);
94 else while(el.nextSibling) $del(el.nextSibling);
94 }
95 }
95
96
96 function addPreview() {
97 function addPreview() {
97 $('.post').find('a').each(function() {
98 $('.post').find('a').each(function() {
98 showPostPreview($(this));
99 showPostPreview($(this));
99 });
100 });
100 }
101 }
@@ -1,332 +1,334 b''
1 /*
1 /*
2 @licstart The following is the entire license notice for the
2 @licstart The following is the entire license notice for the
3 JavaScript code in this page.
3 JavaScript code in this page.
4
4
5
5
6 Copyright (C) 2013-2014 neko259
6 Copyright (C) 2013-2014 neko259
7
7
8 The JavaScript code in this page is free software: you can
8 The JavaScript code in this page is free software: you can
9 redistribute it and/or modify it under the terms of the GNU
9 redistribute it and/or modify it under the terms of the GNU
10 General Public License (GNU GPL) as published by the Free Software
10 General Public License (GNU GPL) as published by the Free Software
11 Foundation, either version 3 of the License, or (at your option)
11 Foundation, either version 3 of the License, or (at your option)
12 any later version. The code is distributed WITHOUT ANY WARRANTY;
12 any later version. The code is distributed WITHOUT ANY WARRANTY;
13 without even the implied warranty of MERCHANTABILITY or FITNESS
13 without even the implied warranty of MERCHANTABILITY or FITNESS
14 FOR A PARTICULAR PURPOSE. See the GNU GPL for more details.
14 FOR A PARTICULAR PURPOSE. See the GNU GPL for more details.
15
15
16 As additional permission under GNU GPL version 3 section 7, you
16 As additional permission under GNU GPL version 3 section 7, you
17 may distribute non-source (e.g., minimized or compacted) forms of
17 may distribute non-source (e.g., minimized or compacted) forms of
18 that code without the copy of the GNU GPL normally required by
18 that code without the copy of the GNU GPL normally required by
19 section 4, provided you include this license notice and a URL
19 section 4, provided you include this license notice and a URL
20 through which recipients can access the Corresponding Source.
20 through which recipients can access the Corresponding Source.
21
21
22 @licend The above is the entire license notice
22 @licend The above is the entire license notice
23 for the JavaScript code in this page.
23 for the JavaScript code in this page.
24 */
24 */
25
25
26 var wsUser = '';
26 var wsUser = '';
27
27
28 var unreadPosts = 0;
28 var unreadPosts = 0;
29 var documentOriginalTitle = '';
29 var documentOriginalTitle = '';
30
30
31 // Thread ID does not change, can be stored one time
31 // Thread ID does not change, can be stored one time
32 var threadId = $('div.thread').children('.post').first().attr('id');
32 var threadId = $('div.thread').children('.post').first().attr('id');
33
33
34 /**
34 /**
35 * Connect to websocket server and subscribe to thread updates. On any update we
35 * Connect to websocket server and subscribe to thread updates. On any update we
36 * request a thread diff.
36 * request a thread diff.
37 *
37 *
38 * @returns {boolean} true if connected, false otherwise
38 * @returns {boolean} true if connected, false otherwise
39 */
39 */
40 function connectWebsocket() {
40 function connectWebsocket() {
41 var metapanel = $('.metapanel')[0];
41 var metapanel = $('.metapanel')[0];
42
42
43 var wsHost = metapanel.getAttribute('data-ws-host');
43 var wsHost = metapanel.getAttribute('data-ws-host');
44 var wsPort = metapanel.getAttribute('data-ws-port');
44 var wsPort = metapanel.getAttribute('data-ws-port');
45
45
46 if (wsHost.length > 0 && wsPort.length > 0)
46 if (wsHost.length > 0 && wsPort.length > 0)
47 var centrifuge = new Centrifuge({
47 var centrifuge = new Centrifuge({
48 "url": 'ws://' + wsHost + ':' + wsPort + "/connection/websocket",
48 "url": 'ws://' + wsHost + ':' + wsPort + "/connection/websocket",
49 "project": metapanel.getAttribute('data-ws-project'),
49 "project": metapanel.getAttribute('data-ws-project'),
50 "user": wsUser,
50 "user": wsUser,
51 "timestamp": metapanel.getAttribute('data-last-update'),
51 "timestamp": metapanel.getAttribute('data-last-update'),
52 "token": metapanel.getAttribute('data-ws-token'),
52 "token": metapanel.getAttribute('data-ws-token'),
53 "debug": false
53 "debug": false
54 });
54 });
55
55
56 centrifuge.on('error', function(error_message) {
56 centrifuge.on('error', function(error_message) {
57 console.log("Error connecting to websocket server.");
57 console.log("Error connecting to websocket server.");
58 return false;
58 return false;
59 });
59 });
60
60
61 centrifuge.on('connect', function() {
61 centrifuge.on('connect', function() {
62 var channelName = 'thread:' + threadId;
62 var channelName = 'thread:' + threadId;
63 centrifuge.subscribe(channelName, function(message) {
63 centrifuge.subscribe(channelName, function(message) {
64 getThreadDiff();
64 getThreadDiff();
65 });
65 });
66
66
67 // For the case we closed the browser and missed some updates
67 // For the case we closed the browser and missed some updates
68 getThreadDiff();
68 getThreadDiff();
69 $('#autoupdate').hide();
69 $('#autoupdate').hide();
70 });
70 });
71
71
72 centrifuge.connect();
72 centrifuge.connect();
73
73
74 return true;
74 return true;
75 }
75 }
76
76
77 /**
77 /**
78 * Get diff of the posts from the current thread timestamp.
78 * Get diff of the posts from the current thread timestamp.
79 * This is required if the browser was closed and some post updates were
79 * This is required if the browser was closed and some post updates were
80 * missed.
80 * missed.
81 */
81 */
82 function getThreadDiff() {
82 function getThreadDiff() {
83 var lastUpdateTime = $('.metapanel').attr('data-last-update');
83 var lastUpdateTime = $('.metapanel').attr('data-last-update');
84
84
85 var diffUrl = '/api/diff_thread/' + threadId + '/' + lastUpdateTime + '/';
85 var diffUrl = '/api/diff_thread/' + threadId + '/' + lastUpdateTime + '/';
86
86
87 $.getJSON(diffUrl)
87 $.getJSON(diffUrl)
88 .success(function(data) {
88 .success(function(data) {
89 var addedPosts = data.added;
89 var addedPosts = data.added;
90
90
91 for (var i = 0; i < addedPosts.length; i++) {
91 for (var i = 0; i < addedPosts.length; i++) {
92 var postText = addedPosts[i];
92 var postText = addedPosts[i];
93 var post = $(postText);
93 var post = $(postText);
94
94
95 updatePost(post)
95 updatePost(post)
96 }
96 }
97
97
98 var updatedPosts = data.updated;
98 var updatedPosts = data.updated;
99
99
100 for (var i = 0; i < updatedPosts.length; i++) {
100 for (var i = 0; i < updatedPosts.length; i++) {
101 var postText = updatedPosts[i];
101 var postText = updatedPosts[i];
102 var post = $(postText);
102 var post = $(postText);
103
103
104 updatePost(post)
104 updatePost(post)
105 }
105 }
106
106
107 // TODO Process removed posts if any
107 // TODO Process removed posts if any
108 $('.metapanel').attr('data-last-update', data.last_update);
108 $('.metapanel').attr('data-last-update', data.last_update);
109 })
109 })
110 }
110 }
111
111
112 /**
112 /**
113 * Add or update the post on html page.
113 * Add or update the post on html page.
114 */
114 */
115 function updatePost(postHtml) {
115 function updatePost(postHtml) {
116 // This needs to be set on start because the page is scrolled after posts
116 // This needs to be set on start because the page is scrolled after posts
117 // are added or updated
117 // are added or updated
118 var bottom = isPageBottom();
118 var bottom = isPageBottom();
119
119
120 var post = $(postHtml);
120 var post = $(postHtml);
121
121
122 var threadBlock = $('div.thread');
122 var threadBlock = $('div.thread');
123
123
124 var lastUpdate = '';
124 var lastUpdate = '';
125
125
126 var postId = post.attr('id');
126 var postId = post.attr('id');
127
127
128 // If the post already exists, replace it. Otherwise add as a new one.
128 // If the post already exists, replace it. Otherwise add as a new one.
129 var existingPosts = threadBlock.children('.post[id=' + postId + ']');
129 var existingPosts = threadBlock.children('.post[id=' + postId + ']');
130
130
131 if (existingPosts.size() > 0) {
131 if (existingPosts.size() > 0) {
132 existingPosts.replaceWith(post);
132 existingPosts.replaceWith(post);
133 } else {
133 } else {
134 var threadPosts = threadBlock.children('.post');
134 var threadPosts = threadBlock.children('.post');
135 var lastPost = threadPosts.last();
135 var lastPost = threadPosts.last();
136
136
137 post.appendTo(lastPost.parent());
137 post.appendTo(lastPost.parent());
138
138
139 updateBumplimitProgress(1);
139 updateBumplimitProgress(1);
140 showNewPostsTitle(1);
140 showNewPostsTitle(1);
141
141
142 lastUpdate = post.children('.post-info').first()
142 lastUpdate = post.children('.post-info').first()
143 .children('.pub_time').first().text();
143 .children('.pub_time').first().html();
144
144
145 if (bottom) {
145 if (bottom) {
146 scrollToBottom();
146 scrollToBottom();
147 }
147 }
148 }
148 }
149
149
150 processNewPost(post);
150 processNewPost(post);
151 updateMetadataPanel(lastUpdate)
151 updateMetadataPanel(lastUpdate)
152 }
152 }
153
153
154 /**
154 /**
155 * Initiate a blinking animation on a node to show it was updated.
155 * Initiate a blinking animation on a node to show it was updated.
156 */
156 */
157 function blink(node) {
157 function blink(node) {
158 var blinkCount = 2;
158 var blinkCount = 2;
159
159
160 var nodeToAnimate = node;
160 var nodeToAnimate = node;
161 for (var i = 0; i < blinkCount; i++) {
161 for (var i = 0; i < blinkCount; i++) {
162 nodeToAnimate = nodeToAnimate.fadeTo('fast', 0.5).fadeTo('fast', 1.0);
162 nodeToAnimate = nodeToAnimate.fadeTo('fast', 0.5).fadeTo('fast', 1.0);
163 }
163 }
164 }
164 }
165
165
166 function isPageBottom() {
166 function isPageBottom() {
167 var scroll = $(window).scrollTop() / ($(document).height()
167 var scroll = $(window).scrollTop() / ($(document).height()
168 - $(window).height());
168 - $(window).height());
169
169
170 return scroll == 1
170 return scroll == 1
171 }
171 }
172
172
173 function initAutoupdate() {
173 function initAutoupdate() {
174 return connectWebsocket();
174 return connectWebsocket();
175 }
175 }
176
176
177 function getReplyCount() {
177 function getReplyCount() {
178 return $('.thread').children('.post').length
178 return $('.thread').children('.post').length
179 }
179 }
180
180
181 function getImageCount() {
181 function getImageCount() {
182 return $('.thread').find('img').length
182 return $('.thread').find('img').length
183 }
183 }
184
184
185 /**
185 /**
186 * Update post count, images count and last update time in the metadata
186 * Update post count, images count and last update time in the metadata
187 * panel.
187 * panel.
188 */
188 */
189 function updateMetadataPanel(lastUpdate) {
189 function updateMetadataPanel(lastUpdate) {
190 var replyCountField = $('#reply-count');
190 var replyCountField = $('#reply-count');
191 var imageCountField = $('#image-count');
191 var imageCountField = $('#image-count');
192
192
193 replyCountField.text(getReplyCount());
193 replyCountField.text(getReplyCount());
194 imageCountField.text(getImageCount());
194 imageCountField.text(getImageCount());
195
195
196 if (lastUpdate !== '') {
196 if (lastUpdate !== '') {
197 var lastUpdateField = $('#last-update');
197 var lastUpdateField = $('#last-update');
198 lastUpdateField.text(lastUpdate);
198 lastUpdateField.html(lastUpdate);
199 translate_time(lastUpdateField);
199 blink(lastUpdateField);
200 blink(lastUpdateField);
200 }
201 }
201
202
202 blink(replyCountField);
203 blink(replyCountField);
203 blink(imageCountField);
204 blink(imageCountField);
204 }
205 }
205
206
206 /**
207 /**
207 * Update bumplimit progress bar
208 * Update bumplimit progress bar
208 */
209 */
209 function updateBumplimitProgress(postDelta) {
210 function updateBumplimitProgress(postDelta) {
210 var progressBar = $('#bumplimit_progress');
211 var progressBar = $('#bumplimit_progress');
211 if (progressBar) {
212 if (progressBar) {
212 var postsToLimitElement = $('#left_to_limit');
213 var postsToLimitElement = $('#left_to_limit');
213
214
214 var oldPostsToLimit = parseInt(postsToLimitElement.text());
215 var oldPostsToLimit = parseInt(postsToLimitElement.text());
215 var postCount = getReplyCount();
216 var postCount = getReplyCount();
216 var bumplimit = postCount - postDelta + oldPostsToLimit;
217 var bumplimit = postCount - postDelta + oldPostsToLimit;
217
218
218 var newPostsToLimit = bumplimit - postCount;
219 var newPostsToLimit = bumplimit - postCount;
219 if (newPostsToLimit <= 0) {
220 if (newPostsToLimit <= 0) {
220 $('.bar-bg').remove();
221 $('.bar-bg').remove();
221 $('.thread').children('.post').addClass('dead_post');
222 $('.thread').children('.post').addClass('dead_post');
222 } else {
223 } else {
223 postsToLimitElement.text(newPostsToLimit);
224 postsToLimitElement.text(newPostsToLimit);
224 progressBar.width((100 - postCount / bumplimit * 100.0) + '%');
225 progressBar.width((100 - postCount / bumplimit * 100.0) + '%');
225 }
226 }
226 }
227 }
227 }
228 }
228
229
229 /**
230 /**
230 * Show 'new posts' text in the title if the document is not visible to a user
231 * Show 'new posts' text in the title if the document is not visible to a user
231 */
232 */
232 function showNewPostsTitle(newPostCount) {
233 function showNewPostsTitle(newPostCount) {
233 if (document.hidden) {
234 if (document.hidden) {
234 if (documentOriginalTitle === '') {
235 if (documentOriginalTitle === '') {
235 documentOriginalTitle = document.title;
236 documentOriginalTitle = document.title;
236 }
237 }
237 unreadPosts = unreadPosts + newPostCount;
238 unreadPosts = unreadPosts + newPostCount;
238 document.title = '[' + unreadPosts + '] ' + documentOriginalTitle;
239 document.title = '[' + unreadPosts + '] ' + documentOriginalTitle;
239
240
240 document.addEventListener('visibilitychange', function() {
241 document.addEventListener('visibilitychange', function() {
241 if (documentOriginalTitle !== '') {
242 if (documentOriginalTitle !== '') {
242 document.title = documentOriginalTitle;
243 document.title = documentOriginalTitle;
243 documentOriginalTitle = '';
244 documentOriginalTitle = '';
244 unreadPosts = 0;
245 unreadPosts = 0;
245 }
246 }
246
247
247 document.removeEventListener('visibilitychange', null);
248 document.removeEventListener('visibilitychange', null);
248 });
249 });
249 }
250 }
250 }
251 }
251
252
252 /**
253 /**
253 * Clear all entered values in the form fields
254 * Clear all entered values in the form fields
254 */
255 */
255 function resetForm(form) {
256 function resetForm(form) {
256 form.find('input:text, input:password, input:file, select, textarea').val('');
257 form.find('input:text, input:password, input:file, select, textarea').val('');
257 form.find('input:radio, input:checkbox')
258 form.find('input:radio, input:checkbox')
258 .removeAttr('checked').removeAttr('selected');
259 .removeAttr('checked').removeAttr('selected');
259 $('.file_wrap').find('.file-thumb').remove();
260 $('.file_wrap').find('.file-thumb').remove();
260 }
261 }
261
262
262 /**
263 /**
263 * When the form is posted, this method will be run as a callback
264 * When the form is posted, this method will be run as a callback
264 */
265 */
265 function updateOnPost(response, statusText, xhr, form) {
266 function updateOnPost(response, statusText, xhr, form) {
266 var json = $.parseJSON(response);
267 var json = $.parseJSON(response);
267 var status = json.status;
268 var status = json.status;
268
269
269 showAsErrors(form, '');
270 showAsErrors(form, '');
270
271
271 if (status === 'ok') {
272 if (status === 'ok') {
272 resetForm(form);
273 resetForm(form);
273 getThreadDiff();
274 getThreadDiff();
274 } else {
275 } else {
275 var errors = json.errors;
276 var errors = json.errors;
276 for (var i = 0; i < errors.length; i++) {
277 for (var i = 0; i < errors.length; i++) {
277 var fieldErrors = errors[i];
278 var fieldErrors = errors[i];
278
279
279 var error = fieldErrors.errors;
280 var error = fieldErrors.errors;
280
281
281 showAsErrors(form, error);
282 showAsErrors(form, error);
282 }
283 }
283 }
284 }
284
285
285 scrollToBottom();
286 scrollToBottom();
286 }
287 }
287
288
288 /**
289 /**
289 * Show text in the errors row of the form.
290 * Show text in the errors row of the form.
290 * @param form
291 * @param form
291 * @param text
292 * @param text
292 */
293 */
293 function showAsErrors(form, text) {
294 function showAsErrors(form, text) {
294 form.children('.form-errors').remove();
295 form.children('.form-errors').remove();
295
296
296 if (text.length > 0) {
297 if (text.length > 0) {
297 var errorList = $('<div class="form-errors">' + text + '<div>');
298 var errorList = $('<div class="form-errors">' + text + '<div>');
298 errorList.appendTo(form);
299 errorList.appendTo(form);
299 }
300 }
300 }
301 }
301
302
302 /**
303 /**
303 * Run js methods that are usually run on the document, on the new post
304 * Run js methods that are usually run on the document, on the new post
304 */
305 */
305 function processNewPost(post) {
306 function processNewPost(post) {
306 addRefLinkPreview(post[0]);
307 addRefLinkPreview(post[0]);
307 highlightCode(post);
308 highlightCode(post);
309 translate_time(post);
308 blink(post);
310 blink(post);
309 }
311 }
310
312
311 $(document).ready(function(){
313 $(document).ready(function(){
312 if (initAutoupdate()) {
314 if (initAutoupdate()) {
313 // Post form data over AJAX
315 // Post form data over AJAX
314 var threadId = $('div.thread').children('.post').first().attr('id');
316 var threadId = $('div.thread').children('.post').first().attr('id');
315
317
316 var form = $('#form');
318 var form = $('#form');
317
319
318 var options = {
320 var options = {
319 beforeSubmit: function(arr, $form, options) {
321 beforeSubmit: function(arr, $form, options) {
320 showAsErrors($('form'), gettext('Sending message...'));
322 showAsErrors($('form'), gettext('Sending message...'));
321 },
323 },
322 success: updateOnPost,
324 success: updateOnPost,
323 url: '/api/add_post/' + threadId + '/'
325 url: '/api/add_post/' + threadId + '/'
324 };
326 };
325
327
326 form.ajaxForm(options);
328 form.ajaxForm(options);
327
329
328 resetForm(form);
330 resetForm(form);
329 }
331 }
330
332
331 $('#autoupdate').click(getThreadDiff);
333 $('#autoupdate').click(getThreadDiff);
332 });
334 });
@@ -1,102 +1,102 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 {% if thread.archived %}
7 {% if thread.archived %}
8 <div class="post archive_post" id="{{ post.id }}">
8 <div class="post archive_post" id="{{ post.id }}">
9 {% elif bumpable %}
9 {% elif bumpable %}
10 <div class="post" id="{{ post.id }}">
10 <div class="post" id="{{ post.id }}">
11 {% else %}
11 {% else %}
12 <div class="post dead_post" id="{{ post.id }}">
12 <div class="post dead_post" id="{{ post.id }}">
13 {% endif %}
13 {% endif %}
14
14
15 <div class="post-info">
15 <div class="post-info">
16 <a class="post_id" href="{{ post.get_url }}"
16 <a class="post_id" href="{{ post.get_url }}"
17 {% if not truncated and not thread.archived %}
17 {% if not truncated and not thread.archived %}
18 onclick="javascript:addQuickReply('{{ post.id }}'); return false;"
18 onclick="javascript:addQuickReply('{{ post.id }}'); return false;"
19 title="{% trans 'Quote' %}" {% endif %}>({{ post.get_absolute_id }})</a>
19 title="{% trans 'Quote' %}" {% endif %}>({{ post.get_absolute_id }})</a>
20 <span class="title">{{ post.title }}</span>
20 <span class="title">{{ post.title }}</span>
21 <span class="pub_time">{{ post.pub_time|date:'r' }}</span>
21 <span class="pub_time"><time datetime="{{ post.pub_time|date:'c' }}">{{ post.pub_time|date:'r' }}</time></span>
22 {% comment %}
22 {% comment %}
23 Thread death time needs to be shown only if the thread is alredy archived
23 Thread death time needs to be shown only if the thread is alredy archived
24 and this is an opening post (thread death time) or a post for popup
24 and this is an opening post (thread death time) or a post for popup
25 (we don't see OP here so we show the death time in the post itself).
25 (we don't see OP here so we show the death time in the post itself).
26 {% endcomment %}
26 {% endcomment %}
27 {% if thread.archived %}
27 {% if thread.archived %}
28 {% if is_opening %}
28 {% if is_opening %}
29 β€” {{ thread.bump_time }}
29 β€” {{ thread.bump_time }}
30 {% endif %}
30 {% endif %}
31 {% endif %}
31 {% endif %}
32 {% if is_opening and need_open_link %}
32 {% if is_opening and need_open_link %}
33 {% if thread.archived %}
33 {% if thread.archived %}
34 [<a class="link" href="{% url 'thread' post.id %}">{% trans "Open" %}</a>]
34 [<a class="link" href="{% url 'thread' post.id %}">{% trans "Open" %}</a>]
35 {% else %}
35 {% else %}
36 [<a class="link" href="{% url 'thread' post.id %}#form">{% trans "Reply" %}</a>]
36 [<a class="link" href="{% url 'thread' post.id %}#form">{% trans "Reply" %}</a>]
37 {% endif %}
37 {% endif %}
38 {% endif %}
38 {% endif %}
39
39
40 {% if post.global_id %}
40 {% if post.global_id %}
41 <a class="global-id" href="
41 <a class="global-id" href="
42 {% url 'post_sync_data' post.id %}"> [RAW] </a>
42 {% url 'post_sync_data' post.id %}"> [RAW] </a>
43 {% endif %}
43 {% endif %}
44
44
45 {% if moderator %}
45 {% if moderator %}
46 <span class="moderator_info">
46 <span class="moderator_info">
47 [<a href="{% url 'admin:boards_post_change' post.id %}">{% trans 'Edit' %}</a>]
47 [<a href="{% url 'admin:boards_post_change' post.id %}">{% trans 'Edit' %}</a>]
48 {% if is_opening %}
48 {% if is_opening %}
49 [<a href="{% url 'admin:boards_thread_change' thread.id %}">{% trans 'Edit thread' %}</a>]
49 [<a href="{% url 'admin:boards_thread_change' thread.id %}">{% trans 'Edit thread' %}</a>]
50 {% endif %}
50 {% endif %}
51 </span>
51 </span>
52 {% endif %}
52 {% endif %}
53 </div>
53 </div>
54 {% comment %}
54 {% comment %}
55 Post images. Currently only 1 image can be posted and shown, but post model
55 Post images. Currently only 1 image can be posted and shown, but post model
56 supports multiple.
56 supports multiple.
57 {% endcomment %}
57 {% endcomment %}
58 {% if post.images.exists %}
58 {% if post.images.exists %}
59 {% with post.images.all.0 as image %}
59 {% with post.images.all.0 as image %}
60 {% autoescape off %}
60 {% autoescape off %}
61 {{ image.get_view }}
61 {{ image.get_view }}
62 {% endautoescape %}
62 {% endautoescape %}
63 {% endwith %}
63 {% endwith %}
64 {% endif %}
64 {% endif %}
65 {% comment %}
65 {% comment %}
66 Post message (text)
66 Post message (text)
67 {% endcomment %}
67 {% endcomment %}
68 <div class="message">
68 <div class="message">
69 {% autoescape off %}
69 {% autoescape off %}
70 {% if truncated %}
70 {% if truncated %}
71 {{ post.get_text|truncatewords_html:50|truncate_lines:3 }}
71 {{ post.get_text|truncatewords_html:50 }}
72 {% else %}
72 {% else %}
73 {{ post.get_text }}
73 {{ post.get_text }}
74 {% endif %}
74 {% endif %}
75 {% endautoescape %}
75 {% endautoescape %}
76 {% if post.is_referenced %}
76 {% if post.is_referenced %}
77 <div class="refmap">
77 <div class="refmap">
78 {% autoescape off %}
78 {% autoescape off %}
79 {% trans "Replies" %}: {{ post.refmap }}
79 {% trans "Replies" %}: {{ post.refmap }}
80 {% endautoescape %}
80 {% endautoescape %}
81 </div>
81 </div>
82 {% endif %}
82 {% endif %}
83 </div>
83 </div>
84 {% comment %}
84 {% comment %}
85 Thread metadata: counters, tags etc
85 Thread metadata: counters, tags etc
86 {% endcomment %}
86 {% endcomment %}
87 {% if is_opening %}
87 {% if is_opening %}
88 <div class="metadata">
88 <div class="metadata">
89 {% if is_opening and need_open_link %}
89 {% if is_opening and need_open_link %}
90 {{ thread.get_reply_count }} {% trans 'messages' %},
90 {{ thread.get_reply_count }} {% trans 'messages' %},
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 {% autoescape off %}
94 {% autoescape off %}
95 {% for tag in thread.get_tags %}
95 {% for tag in thread.get_tags %}
96 {{ tag.get_view }}{% if not forloop.last %},{% endif %}
96 {{ tag.get_view }}{% if not forloop.last %},{% endif %}
97 {% endfor %}
97 {% endfor %}
98 {% endautoescape %}
98 {% endautoescape %}
99 </span>
99 </span>
100 </div>
100 </div>
101 {% endif %}
101 {% endif %}
102 </div>
102 </div>
@@ -1,93 +1,93 b''
1 {% extends "boards/base.html" %}
1 {% extends "boards/base.html" %}
2
2
3 {% load i18n %}
3 {% load i18n %}
4 {% load cache %}
4 {% load cache %}
5 {% load static from staticfiles %}
5 {% load static from staticfiles %}
6 {% load board %}
6 {% load board %}
7
7
8 {% block head %}
8 {% block head %}
9 <title>{{ opening_post.get_title|striptags|truncatewords:10 }}
9 <title>{{ opening_post.get_title|striptags|truncatewords:10 }}
10 - {{ site_name }}</title>
10 - {{ site_name }}</title>
11 {% endblock %}
11 {% endblock %}
12
12
13 {% block content %}
13 {% block content %}
14 {% get_current_language as LANGUAGE_CODE %}
14 {% get_current_language as LANGUAGE_CODE %}
15
15
16 {% cache 600 thread_view thread.id thread.last_edit_time moderator LANGUAGE_CODE %}
16 {% cache 600 thread_view thread.id thread.last_edit_time moderator LANGUAGE_CODE %}
17
17
18 <div class="image-mode-tab">
18 <div class="image-mode-tab">
19 <a class="current_mode" href="{% url 'thread' opening_post.id %}">{% trans 'Normal mode' %}</a>,
19 <a class="current_mode" href="{% url 'thread' opening_post.id %}">{% trans 'Normal mode' %}</a>,
20 <a href="{% url 'thread_gallery' opening_post.id %}">{% trans 'Gallery mode' %}</a>
20 <a href="{% url 'thread_gallery' opening_post.id %}">{% trans 'Gallery mode' %}</a>
21 </div>
21 </div>
22
22
23 {% if bumpable %}
23 {% if bumpable %}
24 <div class="bar-bg">
24 <div class="bar-bg">
25 <div class="bar-value" style="width:{{ bumplimit_progress }}%" id="bumplimit_progress">
25 <div class="bar-value" style="width:{{ bumplimit_progress }}%" id="bumplimit_progress">
26 </div>
26 </div>
27 <div class="bar-text">
27 <div class="bar-text">
28 <span id="left_to_limit">{{ posts_left }}</span> {% trans 'posts to bumplimit' %}
28 <span id="left_to_limit">{{ posts_left }}</span> {% trans 'posts to bumplimit' %}
29 </div>
29 </div>
30 </div>
30 </div>
31 {% endif %}
31 {% endif %}
32
32
33 <div class="thread">
33 <div class="thread">
34 {% with can_bump=thread.can_bump %}
34 {% with can_bump=thread.can_bump %}
35 {% for post in thread.get_replies %}
35 {% for post in thread.get_replies %}
36 {% with is_opening=forloop.first %}
36 {% with is_opening=forloop.first %}
37 {% post_view post moderator=moderator is_opening=is_opening bumpable=can_bump opening_post_id=opening_post.id %}
37 {% post_view post moderator=moderator is_opening=is_opening bumpable=can_bump opening_post_id=opening_post.id %}
38 {% endwith %}
38 {% endwith %}
39 {% endfor %}
39 {% endfor %}
40 {% endwith %}
40 {% endwith %}
41 </div>
41 </div>
42
42
43 {% if not thread.archived %}
43 {% if not thread.archived %}
44 <div class="post-form-w">
44 <div class="post-form-w">
45 <script src="{% static 'js/panel.js' %}"></script>
45 <script src="{% static 'js/panel.js' %}"></script>
46 <div class="form-title">{% trans "Reply to thread" %} #{{ opening_post.id }}</div>
46 <div class="form-title">{% trans "Reply to thread" %} #{{ opening_post.id }}</div>
47 <div class="post-form" id="compact-form">
47 <div class="post-form" id="compact-form">
48 <div class="swappable-form-full">
48 <div class="swappable-form-full">
49 <form enctype="multipart/form-data" method="post" id="form">{% csrf_token %}
49 <form enctype="multipart/form-data" method="post" id="form">{% csrf_token %}
50 <div class="compact-form-text"></div>
50 <div class="compact-form-text"></div>
51 {{ form.as_div }}
51 {{ form.as_div }}
52 <div class="form-submit">
52 <div class="form-submit">
53 <input type="submit" value="{% trans "Post" %}"/>
53 <input type="submit" value="{% trans "Post" %}"/>
54 </div>
54 </div>
55 (ctrl-enter)
55 (ctrl-enter)
56 </form>
56 </form>
57 </div>
57 </div>
58 <div><a href="{% url "staticpage" name="help" %}">
58 <div><a href="{% url "staticpage" name="help" %}">
59 {% trans 'Text syntax' %}</a></div>
59 {% trans 'Text syntax' %}</a></div>
60 </div>
60 </div>
61 </div>
61 </div>
62
62
63 <script src="{% static 'js/jquery.form.min.js' %}"></script>
63 <script src="{% static 'js/jquery.form.min.js' %}"></script>
64 <script src="{% static 'js/thread_update.js' %}"></script>
64 <script src="{% static 'js/thread_update.js' %}"></script>
65 <script src="{% static 'js/3party/centrifuge.js' %}"></script>
65 <script src="{% static 'js/3party/centrifuge.js' %}"></script>
66 {% endif %}
66 {% endif %}
67
67
68 <script src="{% static 'js/form.js' %}"></script>
68 <script src="{% static 'js/form.js' %}"></script>
69 <script src="{% static 'js/thread.js' %}"></script>
69 <script src="{% static 'js/thread.js' %}"></script>
70
70
71 {% endcache %}
71 {% endcache %}
72 {% endblock %}
72 {% endblock %}
73
73
74 {% block metapanel %}
74 {% block metapanel %}
75
75
76 {% get_current_language as LANGUAGE_CODE %}
76 {% get_current_language as LANGUAGE_CODE %}
77
77
78 <span class="metapanel"
78 <span class="metapanel"
79 data-last-update="{{ last_update }}"
79 data-last-update="{{ last_update }}"
80 data-ws-token="{{ ws_token }}"
80 data-ws-token="{{ ws_token }}"
81 data-ws-project="{{ ws_project }}"
81 data-ws-project="{{ ws_project }}"
82 data-ws-host="{{ ws_host }}"
82 data-ws-host="{{ ws_host }}"
83 data-ws-port="{{ ws_port }}">
83 data-ws-port="{{ ws_port }}">
84 {% cache 600 thread_meta thread.last_edit_time moderator LANGUAGE_CODE %}
84 {% cache 600 thread_meta thread.last_edit_time moderator LANGUAGE_CODE %}
85 <button id="autoupdate">{% trans 'Update' %}</button>
85 <button id="autoupdate">{% trans 'Update' %}</button>
86 <span id="reply-count">{{ thread.get_reply_count }}</span>/{{ max_replies }} {% trans 'messages' %},
86 <span id="reply-count">{{ thread.get_reply_count }}</span>/{{ max_replies }} {% trans 'messages' %},
87 <span id="image-count">{{ thread.get_images_count }}</span> {% trans 'images' %}.
87 <span id="image-count">{{ thread.get_images_count }}</span> {% trans 'images' %}.
88 {% trans 'Last update: ' %}<span id="last-update">{{ thread.last_edit_time|date:'r' }}</span>
88 {% trans 'Last update: ' %}<span id="last-update"><time datetime="{{ thread.last_edit_time|date:'c' }}">{{ thread.last_edit_time|date:'r' }}</time></span>
89 [<a href="rss/">RSS</a>]
89 [<a href="rss/">RSS</a>]
90 {% endcache %}
90 {% endcache %}
91 </span>
91 </span>
92
92
93 {% endblock %}
93 {% endblock %}
@@ -1,66 +1,66 b''
1 {% extends "boards/base.html" %}
1 {% extends "boards/base.html" %}
2
2
3 {% load i18n %}
3 {% load i18n %}
4 {% load cache %}
4 {% load cache %}
5 {% load static from staticfiles %}
5 {% load static from staticfiles %}
6 {% load board %}
6 {% load board %}
7
7
8 {% block head %}
8 {% block head %}
9 <title>{{ thread.get_opening_post.get_title|striptags|truncatewords:10 }}
9 <title>{{ thread.get_opening_post.get_title|striptags|truncatewords:10 }}
10 - {{ site_name }}</title>
10 - {{ site_name }}</title>
11 {% endblock %}
11 {% endblock %}
12
12
13 {% block content %}
13 {% block content %}
14 {% spaceless %}
14 {% spaceless %}
15 {% get_current_language as LANGUAGE_CODE %}
15 {% get_current_language as LANGUAGE_CODE %}
16
16
17 {% cache 600 thread_gallery_view thread.id thread.last_edit_time LANGUAGE_CODE request.get_host %}
17 {% cache 600 thread_gallery_view thread.id thread.last_edit_time LANGUAGE_CODE request.get_host %}
18 <div class="image-mode-tab">
18 <div class="image-mode-tab">
19 <a href="{% url 'thread' thread.get_opening_post.id %}">{% trans 'Normal mode' %}</a>,
19 <a href="{% url 'thread' thread.get_opening_post.id %}">{% trans 'Normal mode' %}</a>,
20 <a class="current_mode" href="{% url 'thread_gallery' thread.get_opening_post.id %}">{% trans 'Gallery mode' %}</a>
20 <a class="current_mode" href="{% url 'thread_gallery' thread.get_opening_post.id %}">{% trans 'Gallery mode' %}</a>
21 </div>
21 </div>
22
22
23 <div id="posts-table">
23 <div id="posts-table">
24 {% for post in posts %}
24 {% for post in posts %}
25 <div class="gallery_image">
25 <div class="gallery_image">
26 {% with post.get_first_image as image %}
26 {% with post.get_first_image as image %}
27 <div>
27 <div>
28 <a
28 <a
29 class="thumb"
29 class="thumb"
30 href="{{ image.image.url }}"><img
30 href="{{ image.image.url }}"><img
31 src="{{ image.image.url_200x150 }}"
31 src="{{ image.image.url_200x150 }}"
32 alt="{{ post.id }}"
32 alt="{{ post.id }}"
33 width="{{ image.pre_width }}"
33 width="{{ image.pre_width }}"
34 height="{{ image.pre_height }}"
34 height="{{ image.pre_height }}"
35 data-width="{{ image.width }}"
35 data-width="{{ image.width }}"
36 data-height="{{ image.height }}"/>
36 data-height="{{ image.height }}"/>
37 </a>
37 </a>
38 </div>
38 </div>
39 <div class="gallery_image_metadata">
39 <div class="gallery_image_metadata">
40 {{ image.width }}x{{ image.height }}
40 {{ image.width }}x{{ image.height }}
41 {% image_actions image.image.url request.get_host %}
41 {% image_actions image.image.url request.get_host %}
42 </div>
42 </div>
43 {% endwith %}
43 {% endwith %}
44 </div>
44 </div>
45 {% endfor %}
45 {% endfor %}
46 </div>
46 </div>
47 {% endcache %}
47 {% endcache %}
48
48
49 {% endspaceless %}
49 {% endspaceless %}
50 {% endblock %}
50 {% endblock %}
51
51
52 {% block metapanel %}
52 {% block metapanel %}
53
53
54 {% get_current_language as LANGUAGE_CODE %}
54 {% get_current_language as LANGUAGE_CODE %}
55
55
56 <span class="metapanel" data-last-update="{{ last_update }}">
56 <span class="metapanel" data-last-update="{{ last_update }}">
57 {% cache 600 thread_gallery_meta thread.last_edit_time moderator LANGUAGE_CODE %}
57 {% cache 600 thread_gallery_meta thread.last_edit_time moderator LANGUAGE_CODE %}
58 <span id="reply-count">{{ thread.get_reply_count }}</span>/{{ max_replies }}
58 <span id="reply-count">{{ thread.get_reply_count }}</span>/{{ max_replies }}
59 {% trans 'messages' %},
59 {% trans 'messages' %},
60 <span id="image-count">{{ thread.get_images_count }}</span> {% trans 'images' %}.
60 <span id="image-count">{{ thread.get_images_count }}</span> {% trans 'images' %}.
61 {% trans 'Last update: ' %}{{ thread.last_edit_time|date:'r' }}
61 {% trans 'Last update: ' %}<time datetime="{{ thread.last_edit_time|date:'c' }}">{{ thread.last_edit_time|date:'r' }}</time>
62 [<a href="rss/">RSS</a>]
62 [<a href="rss/">RSS</a>]
63 {% endcache %}
63 {% endcache %}
64 </span>
64 </span>
65
65
66 {% endblock %}
66 {% endblock %}
General Comments 0
You need to be logged in to leave comments. Login now