diff options
author | Choom | 2022-12-14 18:05:09 -0300 |
---|---|---|
committer | Choom | 2022-12-14 20:08:22 -0300 |
commit | dcd6e1d63a46ff957ce6eb519915b4a9e8fe625b (patch) | |
tree | e47028d518c6885641a828c2f2a6d463d0505728 /cgi | |
parent | 5ef5827e02f20fb59e92ac8e88fba85103442b1f (diff) | |
download | weabot-dcd6e1d63a46ff957ce6eb519915b4a9e8fe625b.tar.gz weabot-dcd6e1d63a46ff957ce6eb519915b4a9e8fe625b.tar.xz weabot-dcd6e1d63a46ff957ce6eb519915b4a9e8fe625b.zip |
Mejor pantalla de borrado
Fix imágenes en BBS
Diffstat (limited to 'cgi')
-rw-r--r-- | cgi/manage.py | 21 | ||||
-rw-r--r-- | cgi/template.py | 2 | ||||
-rw-r--r-- | cgi/templates/base_top.html | 2 | ||||
-rw-r--r-- | cgi/templates/manage/delete.html | 40 | ||||
-rw-r--r-- | cgi/templates/manage/recent.html | 2 |
5 files changed, 45 insertions, 22 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 @@ <img src="/static/img/default.png" width="500" height="81" /> <?py #endif ?> </div> - <hr width="90%" size="1" />
\ No newline at end of file + <hr width="90%" size="1" /> 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 @@ <?py include('templates/base_top.html') ?> <?py include('templates/manage/menu.html') ?> <center> -<div class="replymode">Eliminar Post</div> -<form action="#{cgi_url}manage/delete_confirmed/#{curboard}/#{postid}" method="get"> +<div class="replymode">Eliminando post</div> +<form action="#{cgi_url}manage/delete_confirmed/#{curboard['dir']}/#{post['id']}" method="get"> <?py if do_ban: ?> <input type="hidden" name="ban" value="true" /> <?py #endif ?> <p> - <b>Post #${postid} de /${curboard}/</b><br /> - <input id="a" type="checkbox" name="imageonly" value="true" /><label for="a">Eliminar sólo archivo</label><br /> - <input id="b" type="checkbox" name="perma" value="true" /><label for="b" style="font-weight:bold">Eliminar permanentemente</label><br /> + <b>Estás a punto de eliminar el siguiente post de <u>${curboard['name']}</u> (${curboard['dir']}):</b> + <br /> + <table class="managertable" style="max-width: 800px;"> + <tr> + <th>Nombre</th> + <td>${post['name']} ${post['tripcode']}</td> + <tr> + <th>Archivo</th> + <td> + <?py if post['thumb']: ?> + <img src="/${curboard['dir']}/mobile/${post['thumb']}" /> + <?py else: ?> + Sin archivo + <?py #endif ?> + </td> + </tr> + <tr> + <th>Mensaje</th> + <td>#{post['message']}</td> + </tr> + </table> + <br /> + <input id="a" type="checkbox" name="imageonly" value="true"#{'' if post['thumb'] else ' disabled'} /><label for="a">Eliminar sólo archivo</label><br /> + <input id="b" type="checkbox" name="perma" value="true" /><label for="b" style="font-weight:bold;">Eliminar permanentemente*</label> + <br /> + <br /> + <div style="max-width: 600px;"> + <b>*</b> Evitar eliminar <b>permanentemente</b> 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 (!). + </div> <br /> - <i>Nota: Por favor evitar eliminar <b>permanentemente</b> el post al menos que sea estrictamente necesario. - <br />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.</i> - <br /><br /> <input type="submit" value="Eliminar" /> </p> </form> 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 @@ </table> </center> <hr /> -<?py include('templates/base_bottom.html') ?>
\ No newline at end of file +<?py include('templates/base_bottom.html') ?> |