aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Terry 2019-03-29 03:04:07 -0300
committerLibravatar Terry 2019-03-29 03:04:07 -0300
commit11fabc50d72e4eeea65cca25c93d292d87e541ce (patch)
tree6b9224b17ea393aad59b190c2cd9003ec60e04d5
parente1c761b546e14eb3c8200a31f9e4758e47c3c45b (diff)
downloadweabot-11fabc50d72e4eeea65cca25c93d292d87e541ce.tar.gz
weabot-11fabc50d72e4eeea65cca25c93d292d87e541ce.tar.xz
weabot-11fabc50d72e4eeea65cca25c93d292d87e541ce.zip
Paginación hilos BBS
-rw-r--r--cgi/templates/txt_thread.en.html6
-rw-r--r--cgi/templates/txt_thread.html6
-rw-r--r--static/js/autorefresh.js4
3 files changed, 8 insertions, 8 deletions
diff --git a/cgi/templates/txt_thread.en.html b/cgi/templates/txt_thread.en.html
index 2e811cb..f7a6519 100644
--- a/cgi/templates/txt_thread.en.html
+++ b/cgi/templates/txt_thread.en.html
@@ -6,9 +6,9 @@
<a href="/" name="top" target="_top">Bienvenido a Internet</a>
<a href="#{boards_url}#{board}/">■Return to BBS■</a>
<a href="#{boards_url}#{board}/read/#{thread['timestamp']}/">Entire thread</a>
- <?py if thread['length'] > 100: ?>
- <a href="#{boards_url}#{board}/read/#{thread['timestamp']}/-100">First 100</a>
- <?py #endif ?>
+ <?py for i in range(thread['length'] / 100): ?>
+ <a href="#{boards_url}#{board}/read/#{thread['timestamp']}/#{(i+1)*100+1}-#{(i+2)*100}">#{(i+1)*100+1}-</a>
+ <?py #endfor ?>
<?py if thread['length'] > 51: ?>
<a href="#{boards_url}#{board}/read/#{thread['timestamp']}/l50">Last 50</a>
<?py #endif ?>
diff --git a/cgi/templates/txt_thread.html b/cgi/templates/txt_thread.html
index b01a126..6765630 100644
--- a/cgi/templates/txt_thread.html
+++ b/cgi/templates/txt_thread.html
@@ -6,9 +6,9 @@
<a href="/" name="top" target="_top">Bienvenido a Internet</a>
<a href="#{boards_url}#{board}/">■Volver al BBS■</a>
<a href="#{boards_url}#{board}/read/#{thread['timestamp']}/">Hilo completo</a>
- <?py if thread['length'] > 100: ?>
- <a href="#{boards_url}#{board}/read/#{thread['timestamp']}/-100">Primeros 100</a>
- <?py #endif ?>
+ <?py for i in range(thread['length'] / 100): ?>
+ <a href="#{boards_url}#{board}/read/#{thread['timestamp']}/#{(i+1)*100+1}-#{(i+2)*100}">#{(i+1)*100+1}-</a>
+ <?py #endfor ?>
<?py if thread['length'] > 51: ?>
<a href="#{boards_url}#{board}/read/#{thread['timestamp']}/l50">Últimos 50</a>
<?py #endif ?>
diff --git a/static/js/autorefresh.js b/static/js/autorefresh.js
index aa04bf1..9aa6e0e 100644
--- a/static/js/autorefresh.js
+++ b/static/js/autorefresh.js
@@ -58,7 +58,7 @@ function updateThread(posts, total_replies, serverTime) {
if (post.IS_DELETED == 1) div.innerHTML = '<h4 class="deleted">' + num + ' : Mensaje eliminado por el usuario.</h4>';
else if (post.IS_DELETED == 2) div.innerHTML = '<h4 class="deleted">' + num + ' : Mensaje eliminado por miembro del staff.</h4>';
else
- div.innerHTML = '<h4>' + num + ' : ' + s_name + ' : <span class="date" data-unix="' + post.timestamp + '">' + post.timestamp_formatted + '</span> <span class="del"><a href="/cgi/report/' + board + '/' + post.id + '/' + num + '" rel="nofollow">rep</a> <a href="#">del</a></span></h4>' + s_img + '<div class="msg">' + post.message + '</div>';
+ div.innerHTML = '<h4>' + num + ' : ' + s_name + ' : <span class="date" data-unix="' + post.timestamp + '">' + post.timestamp_formatted + '</span> <span class="del"><a href="/cgi/report/' + board + '/' + post.id + '/' + num + '">rep</a> <a href="#">del</a></span></h4>' + s_img + '<div class="msg">' + post.message + '</div>';
} else {
if (post.file) {
if (post.image_width != 0) {
@@ -73,7 +73,7 @@ function updateThread(posts, total_replies, serverTime) {
s_msg = '<blockquote>' + post.message + '</blockquote>';
}
if (post.IS_DELETED == 0) {
- div.innerHTML = '<table border="0"><tr><td class="ell">…</td><td class="reply" id="reply' + post.id + '"><div class="info"><input type="checkbox" name="delete" value="' + post.id + '" />' + (post.subject ? (' <span class="subj">' + post.subject + '</span>') : '') + ' ' + s_name + ' ' + '<span class="date" data-unix="' + post.timestamp + '">' + post.timestamp_formatted + '</span> <span class="reflink"><a href="#' + post.id + '">No.</a><a href="#" class="postid">' + post.id + '</a></span> <a class="rep" href="/cgi/report/' + board + '/' + post.id + '" rel="nofollow">rep</a></div>' + s_img + s_msg + '</td></tr></table>';
+ div.innerHTML = '<table border="0"><tr><td class="ell">…</td><td class="reply" id="reply' + post.id + '"><div class="info"><input type="checkbox" name="delete" value="' + post.id + '" />' + (post.subject ? (' <span class="subj">' + post.subject + '</span>') : '') + ' ' + s_name + ' ' + '<span class="date" data-unix="' + post.timestamp + '">' + post.timestamp_formatted + '</span> <span class="reflink"><a href="#' + post.id + '">No.</a><a href="#" class="postid">' + post.id + '</a></span> <a class="rep" href="/cgi/report/' + board + '/' + post.id + '">rep</a></div>' + s_img + s_msg + '</td></tr></table>';
}
}