diff options
-rw-r--r-- | cgi/manage.py | 7 | ||||
-rw-r--r-- | cgi/post.py | 9 | ||||
-rw-r--r-- | cgi/templates/manage/rebuild.html | 1 |
3 files changed, 17 insertions, 0 deletions
diff --git a/cgi/manage.py b/cgi/manage.py index 03963e7..2fef8ca 100644 --- a/cgi/manage.py +++ b/cgi/manage.py @@ -127,6 +127,13 @@ def manage(self, path_split): 'board': _('news'), 'time': timeTaken(t1, time.time())} logAction(staff_account['username'], _( 'Rebuilt %s') % _('news')) + elif board_dir == '!TRASH': + t1 = time.time() + regenerateTrash() + message = _('Rebuilt %(board)s in %(time)s seconds.') % { + 'board': _('trash'), 'time': timeTaken(t1, time.time())} + logAction(staff_account['username'], _( + 'Rebuilt %s') % _('trash')) elif board_dir == '!KAKO': t1 = time.time() boards = FetchAll( diff --git a/cgi/post.py b/cgi/post.py index 07b05bc..cb531dd 100644 --- a/cgi/post.py +++ b/cgi/post.py @@ -1111,6 +1111,15 @@ def regenerateNews(): finally: f.close() +def regenerateTrash(): + posts = FetchAll("SELECT posts.id AS id, timestamp_formatted, posts.message AS message, boards.name AS board FROM `posts` INNER JOIN `boards` ON boardid = boards.id WHERE IS_DELETED = 2 ORDER BY `timestamp` DESC") + template_values = {'posts': posts} + + page_rendered = renderTemplate('trash.html', template_values) + + with open(Settings.HOME_DIR + "basural.html", "w") as f: + f.write(page_rendered) + def regenerateAccess(): if not Settings.HTACCESS_GEN: return False diff --git a/cgi/templates/manage/rebuild.html b/cgi/templates/manage/rebuild.html index 3afc057..05ce845 100644 --- a/cgi/templates/manage/rebuild.html +++ b/cgi/templates/manage/rebuild.html @@ -6,6 +6,7 @@ <tr><th colspan="2">Sección</th><th colspan="2">Acción</th></tr> <tr><td colspan="2"><b>Home</b></td><td colspan="2" style="text-align:center;">[<a href="#{cgi_url}manage/rebuild/!HOME">Reconstruir</a>]</td></tr> <tr><td colspan="2"><b>Noticias</b></td><td colspan="2" style="text-align:center;">[<a href="#{cgi_url}manage/rebuild/!NEWS">Reconstruir</a>]</td></tr> + <tr><td colspan="2"><b>Basural</b></td><td colspan="2" style="text-align:center;">[<a href="#{cgi_url}manage/rebuild/!TRASH">Reconstruir</a>]</td></tr> <tr><td colspan="2"><b>Índices de archivos</b></td><td colspan="2" style="text-align:center;">[<a href="#{cgi_url}manage/rebuild/!KAKO">Reconstruir</a>]</td></tr> <tr><td colspan="2"><b>.htaccess</b></td><td colspan="2" style="text-align:center;">[<a href="#{cgi_url}manage/rebuild/!HTACCESS">Reconstruir</a>]</td></tr> <?py for board in boards: ?> |