From 65fd303962d7744a5268db83a72fe66c7378565a Mon Sep 17 00:00:00 2001 From: Choom Date: Fri, 30 Dec 2022 04:33:10 -0300 Subject: Devolviendo previews --- cgi/manage.py | 21 +++++++++++---------- cgi/templates/board.html | 24 +++++++++++++++--------- cgi/templates/board.jp.html | 10 ++++++++-- cgi/templates/txt_board.en.html | 23 ++++++++++++----------- cgi/templates/txt_board.html | 19 ++++++++++--------- cgi/templates/txt_thread.html | 10 ++++++---- cgi/templates/txt_threadlist.html | 35 +++++++++++++++++++++++++---------- 7 files changed, 87 insertions(+), 55 deletions(-) (limited to 'cgi') diff --git a/cgi/manage.py b/cgi/manage.py index 690c807..5fb38d7 100644 --- a/cgi/manage.py +++ b/cgi/manage.py @@ -381,13 +381,13 @@ def manage(self, path_split): # Nos vamos al board y ubicamos el post board = setBoard(path_split[3]) - postid = int(path_split[4]) - post = FetchOne('SELECT `parentid`, `locked` FROM `posts` WHERE `boardid` = %s AND `id` = %s LIMIT 1', (board['id'], pid) ) + pid = int(path_split[4]) + post = FetchOne('SELECT id, parentid, locked FROM posts WHERE boardid = %s AND id = %s LIMIT 1', (board['id'], pid) ) if not post: message = _('Unable to locate a post with that ID.') template_filename = "message.html" else: - if not post['parentid']: + if post['parentid'] != 0: message = _('Post is not a thread opener.') template_filename = "message.html" else: @@ -401,13 +401,14 @@ def manage(self, path_split): UpdateDb("UPDATE `posts` SET `locked` = %s WHERE `boardid` = %s AND `id` = %s LIMIT 1", (setLocked, board["id"], post["id"])) threadUpdated(pid) - if setLocked == 1: - message = _('Thread successfully closed.') - logAction(staff_account['username'], _('Closed thread %s') % ('/' + board['dir'] + '/' + pid) ) - else: - message = _('Thread successfully opened.') - logAction(staff_account['username'], _('Opened thread %s') % ('/' + board['dir'] + '/' + pid) ) - template_filename = "message.html" + + if setLocked == 1: + message = _('Thread successfully closed.') + logAction(staff_account['username'], _('Closed thread %s') % ('/' + board['dir'] + '/' + str(pid)) ) + else: + message = _('Thread successfully opened.') + logAction(staff_account['username'], _('Opened thread %s') % ('/' + board['dir'] + '/' + str(pid)) ) + template_filename = "message.html" elif path_split[2] == 'permasage': setPermasaged = 0 diff --git a/cgi/templates/board.html b/cgi/templates/board.html index 486c380..2f02408 100644 --- a/cgi/templates/board.html +++ b/cgi/templates/board.html @@ -35,10 +35,10 @@ -
+
-
No hay dibujo
+
No hay dibujo
@@ -51,7 +51,7 @@ -
Trampa:
+
No tocar:
@@ -87,7 +87,7 @@
Archivo - + @@ -116,7 +116,7 @@
  • Los hilos son automáticamente eliminados a los #{maxage} días de edad.
  • ¿Eres nuevo? Leer antes de postear · Preguntas frecuentes · Contacto
  • -