From dcd6e1d63a46ff957ce6eb519915b4a9e8fe625b Mon Sep 17 00:00:00 2001 From: Choom Date: Wed, 14 Dec 2022 18:05:09 -0300 Subject: Mejor pantalla de borrado Fix imágenes en BBS --- cgi/manage.py | 21 +++++++++++---------- cgi/template.py | 2 +- cgi/templates/base_top.html | 2 +- cgi/templates/manage/delete.html | 40 +++++++++++++++++++++++++++++++--------- cgi/templates/manage/recent.html | 2 +- static/css/txt/bbs.css | 8 ++++++-- 6 files changed, 51 insertions(+), 24 deletions(-) diff --git a/cgi/manage.py b/cgi/manage.py index 93a9921..0cf2f66 100644 --- a/cgi/manage.py +++ b/cgi/manage.py @@ -317,9 +317,15 @@ def manage(self, path_split): do_ban = True except: pass + + + board = setBoard(path_split[3]) + post = FetchOne('SELECT id, message, thumb, name, tripcode FROM posts WHERE boardid = %s AND id = %s LIMIT 1' % (board['id'], path_split[4])) template_filename = "delete.html" - template_values = {'do_ban': do_ban, 'curboard': path_split[3], 'postid': path_split[4]} + template_values = {'do_ban': do_ban, + 'curboard': board, + 'post': post } elif path_split[2] == 'delete_confirmed': if not moderator: return @@ -330,8 +336,7 @@ def manage(self, path_split): board = setBoard(path_split[3]) postid = int(path_split[4]) - post = FetchOne('SELECT id, message, parentid, INET6_NTOA(ip) AS ip FROM posts WHERE boardid = %s AND id = %s' % ( - board['id'], postid)) + post = FetchOne('SELECT id, message, parentid, INET6_NTOA(ip) AS ip FROM posts WHERE boardid = %s AND id = %s' % (board['id'], postid)) if not permanently: deletePost(path_split[4], None, 2, imageonly) @@ -342,8 +347,7 @@ def manage(self, path_split): # Borrar denuncias UpdateDb("DELETE FROM `reports` WHERE `postid` = %s", (int(path_split[4]),)) - boards = FetchAll( - 'SELECT `name`, `dir` FROM `boards` ORDER BY `dir`') + boards = FetchAll('SELECT `name`, `dir` FROM `boards` ORDER BY `dir`') if imageonly: message = 'Archivo de post /%s/%s eliminado.' % ( @@ -1189,9 +1193,7 @@ def manage(self, path_split): if board_dir != '': action_taken = True - board_exists = FetchOne( - "SELECT * FROM `boards` WHERE `dir` = %s LIMIT 1", - (board_dir,)) + board_exists = FetchOne("SELECT * FROM `boards` WHERE `dir` = %s LIMIT 1", (board_dir,)) if not board_exists: os.mkdir(Settings.ROOT_DIR + board_dir) os.mkdir(Settings.ROOT_DIR + board_dir + '/res') @@ -2173,8 +2175,7 @@ def verifyPasswd(username, passwd): import argon2 ph = argon2.PasswordHasher() - staff_account = FetchOne( - "SELECT * FROM staff WHERE username = %s", (username,)) + staff_account = FetchOne("SELECT * FROM staff WHERE username = %s", (username,)) if not staff_account: return None diff --git a/cgi/template.py b/cgi/template.py index 62f62a9..ca47db8 100644 --- a/cgi/template.py +++ b/cgi/template.py @@ -46,7 +46,7 @@ def renderTemplate(template, template_values={}, mobile=False, noindex=False): # if board: if template in ["board.html", "threadlist.html", "catalog.html", "kako.html", "paint.html"] or template[0:3] == "txt": # TODO HACK - if board['dir'] == 'world' and not mobile and (template == 'txt_board.html'): + if board['dir'] == 'world' and not mobile and template == 'txt_board.html': template = template[:-4] + 'en.html' elif board['dir'] == '2d' and template == 'board.html' and not mobile: template = template[:-4] + 'jp.html' diff --git a/cgi/templates/base_top.html b/cgi/templates/base_top.html index d6a30e8..2dc079e 100644 --- a/cgi/templates/base_top.html +++ b/cgi/templates/base_top.html @@ -44,4 +44,4 @@ -
\ No newline at end of file +
diff --git a/cgi/templates/manage/delete.html b/cgi/templates/manage/delete.html index 78c1c5e..6c26e3e 100644 --- a/cgi/templates/manage/delete.html +++ b/cgi/templates/manage/delete.html @@ -1,20 +1,42 @@
-
Eliminar Post
-
+
Eliminando post
+

- Post #${postid} de /${curboard}/
-
-
+ Estás a punto de eliminar el siguiente post de ${curboard['name']} (${curboard['dir']}): +
+ + + + + + + + + + + + +
Nombre${post['name']} ${post['tripcode']}
Archivo + + + + Sin archivo + +
Mensaje#{post['message']}
+
+
+ +
+
+

+ * Evitar eliminar permanentemente un post a menos que sea estrictamente necesario, al hacerlo se pierden todas las posibles referencias hechas hacia el post, sobre todo en el BBS (!). +

- Nota: Por favor evitar eliminar permanentemente el post al menos que sea estrictamente necesario. -
Al eliminar permanentemente un post no queda en papelera y se rompen - las referencias que se pueden haber hecho hacia él, especialmente en los BBS.
-

diff --git a/cgi/templates/manage/recent.html b/cgi/templates/manage/recent.html index 13e5b42..006da56 100644 --- a/cgi/templates/manage/recent.html +++ b/cgi/templates/manage/recent.html @@ -51,4 +51,4 @@

- \ No newline at end of file + diff --git a/static/css/txt/bbs.css b/static/css/txt/bbs.css index e8857d9..55d74d1 100644 --- a/static/css/txt/bbs.css +++ b/static/css/txt/bbs.css @@ -177,9 +177,11 @@ label { .end { margin-top: 0.5em; } -.reply, #rules { +.reply, +#rules { clear: both; line-height: 18px; + overflow: hidden; } .num { color: inherit !important; @@ -213,7 +215,9 @@ a.thumb { margin: 1em 20px; text-decoration: none; } -.hidden .msg, .hidden .thumb, .hidden .quoted { +.hidden .msg, +.hidden .thumb, +.hidden .quoted { display: none; } a.yt { -- cgit v1.2.1-18-gbd029