aboutsummaryrefslogtreecommitdiff
path: root/cgi
diff options
context:
space:
mode:
Diffstat (limited to 'cgi')
-rw-r--r--cgi/manage.py19
-rw-r--r--cgi/templates/board.0.html10
-rw-r--r--cgi/templates/board.html16
-rw-r--r--cgi/templates/board.jp.html12
4 files changed, 22 insertions, 35 deletions
diff --git a/cgi/manage.py b/cgi/manage.py
index b98ae06..ca1ace6 100644
--- a/cgi/manage.py
+++ b/cgi/manage.py
@@ -995,32 +995,29 @@ def manage(self, path_split):
if path_split[4] == 'restore':
board = setBoard(path_split[5])
- post = FetchOne('SELECT `parentid` FROM `posts` WHERE `boardid` = %s AND `id` = %s LIMIT 1',
- (board['id'], path_split[6]))
+ post = FetchOne('SELECT `parentid`, `IS_DELETED` FROM `posts` WHERE `boardid` = %s AND `id` = %s LIMIT 1', (board['id'], path_split[6]))
if not post:
- message = _(
- 'Unable to locate a post with that ID.') + '<br />'
+ message = _('Unable to locate a post with that ID.') + '<br />'
template_filename = "message.html"
else:
- UpdateDb('UPDATE `posts` SET `IS_DELETED` = 0 WHERE `boardid` = %s AND `id` = %s LIMIT 1',
- (board['id'], path_split[6]))
+ UpdateDb('UPDATE `posts` SET `IS_DELETED` = 0 WHERE `boardid` = %s AND `id` = %s LIMIT 1', (board['id'], path_split[6]))
if post['parentid'] != 0:
threadUpdated(post['parentid'])
else:
regenerateFrontPages()
- regenerateTrash()
+ if post['IS_DELETED'] == 2:
+ regenerateTrash()
+
message = _('Post successfully restored.')
- logAction(staff_account['username'], _('Restored post %s') % (
- '/' + path_split[5] + '/' + path_split[6]))
+ logAction(staff_account['username'], _('Restored post %s') % ('/' + path_split[5] + '/' + path_split[6]) )
if path_split[4] == 'delete':
board = setBoard(path_split[5])
post = FetchOne('SELECT id, parentid, message, INET6_NTOA(ip) AS ip FROM `posts` WHERE `boardid` = %s AND `id` = %s LIMIT 1',
(board['id'], path_split[6]))
if not post:
- message = _(
- 'Unable to locate a post with that ID.')
+ message = _('Unable to locate a post with that ID.')
else:
deletePost(post['id'], None)
diff --git a/cgi/templates/board.0.html b/cgi/templates/board.0.html
index 525a041..7097f2a 100644
--- a/cgi/templates/board.0.html
+++ b/cgi/templates/board.0.html
@@ -120,7 +120,7 @@
<?py #endif ?>
<div id="thread#{thread['id']}#{board}" class="thread" data-length="#{thread['length']}">
<?py for post in thread['posts']: ?>
- <?py if int(post['parentid']) != 0: ?>
+ <?py if int(post['parentid']) != 0 and not post['IS_DELETED']: ?>
<table><tr><td class="ell">…</td>
<td class="reply" id="reply#{post['id']}">
<?py elif post['file']: ?>
@@ -143,12 +143,8 @@
<?py #endif ?>
</a>
<?py #endif ?>
- <a name="#{post['id']}"></a>
- <?py if post['IS_DELETED'] == '1': ?>
- <span class="deleted">No.#{post['id']} eliminado por usuario.</span>
- <?py elif post['IS_DELETED'] == '2': ?>
- <span class="deleted">No.#{post['id']} eliminado por miembro del staff.</span>
- <?py else: ?>
+ <?py if not post['IS_DELETED']: ?>
+ <a name="#{post['id']}"></a>
<div class="info"><label><input type="checkbox" name="delete" value="#{post['id']}" />
<?py if post['subject'] : ?>
<span class="subj">#{post['subject']}</span>
diff --git a/cgi/templates/board.html b/cgi/templates/board.html
index 74ed3ee..ab867d4 100644
--- a/cgi/templates/board.html
+++ b/cgi/templates/board.html
@@ -139,9 +139,11 @@
<span class="unhide" style="display:none;">Hilo <a href="#{boards_url}#{board}/res/#{thread['id']}.html">#{thread['id']}</a> oculto. <a class="tt" href="#">Ver hilo</a></span>
<?py #endif ?>
<?py for post in thread['posts']: ?>
- <?py if int(post['parentid']) != 0: ?>
- <table><tr><td class="ell">…</td>
- <td class="reply#{' deleted' if post['IS_DELETED'] > 0 else ''}" id="p#{post['id']}">
+ <?py if int(post['parentid']) != 0 and not post['IS_DELETED']: ?>
+ <table>
+ <tr>
+ <td class="ell">…</td>
+ <td class="reply" id="p#{post['id']}">
<?py elif post['file']: ?>
<?py if post['image_width'] != '0': ?>
<div class="fs"><span>Nombre de archivo:</span><a href="#{images_url}#{board}/src/#{post['file']}" class="expimg" target="_blank" data-id="#{post['id']}" data-thumb="#{images_url}#{board}/thumb/#{post['thumb']}" data-w="#{post['image_width']}" data-h="#{post['image_height']}" data-tw="#{post['thumb_width']}" data-th="#{post['thumb_height']}">#{post['file']}</a>-(#{post['file_size']} B, #{post['image_width']}x#{post['image_height']})
@@ -167,12 +169,8 @@
<?py #endif ?>
</a>
<?py #endif ?>
- <a name="#{post['id']}"></a>
- <?py if post['IS_DELETED'] == 1: ?>
- <span>No.#{post['id']} eliminado por usuario.</span>
- <?py elif post['IS_DELETED'] == 2: ?>
- <span>No.#{post['id']} eliminado por staff.</span>
- <?py else: ?>
+ <?py if not post['IS_DELETED']: ?>
+ <a name="#{post['id']}"></a>
<div class="info"><label><input type="checkbox" name="delete" value="#{post['id']}" />
<?py if post['subject'] : ?>
<span class="subj">#{post['subject']}</span>
diff --git a/cgi/templates/board.jp.html b/cgi/templates/board.jp.html
index 044d9f6..0e223c9 100644
--- a/cgi/templates/board.jp.html
+++ b/cgi/templates/board.jp.html
@@ -139,9 +139,9 @@
<span class="unhide" style="display:none;">スレ<a href="#{boards_url}#{board}/res/#{thread['id']}.html">#{thread['id']}</a>は隠しました. <a class="tt" href="#">スレを表示</a></span>
<?py #endif ?>
<?py for post in thread['posts']: ?>
- <?py if int(post['parentid']) != 0: ?>
+ <?py if int(post['parentid']) != 0 and not post['IS_DELETED']: ?>
<table><tr><td class="ell">…</td>
- <td class="reply#{' deleted' if post['IS_DELETED'] > 0 else ''}" id="p#{post['id']}">
+ <td class="reply" id="p#{post['id']}">
<?py elif post['file']: ?>
<?py if post['image_width'] != '0': ?>
<div class="fs"><span>画像ファイル名:</span><a href="#{images_url}#{board}/src/#{post['file']}" class="expimg" target="_blank" data-id="#{post['id']}" data-thumb="#{images_url}#{board}/thumb/#{post['thumb']}" data-w="#{post['image_width']}" data-h="#{post['image_height']}" data-tw="#{post['thumb_width']}" data-th="#{post['thumb_height']}">#{post['file']}</a>-(#{post['file_size']} B, #{post['image_width']}x#{post['image_height']})
@@ -167,12 +167,8 @@
<?py #endif ?>
</a>
<?py #endif ?>
- <a name="#{post['id']}"></a>
- <?py if post['IS_DELETED'] == '1': ?>
- <span>No.#{post['id']}はユーザーに削除されました.</span>
- <?py elif post['IS_DELETED'] == '2': ?>
- <span>No.#{post['id']}は管理人に削除されました.</span>
- <?py else: ?>
+ <?py if not post['IS_DELETED']: ?>
+ <a name="#{post['id']}"></a>
<div class="info"><label><input type="checkbox" name="delete" value="#{post['id']}" /><span class="subj">#{post['subject'] if post['subject'] else default_subject}</span></label>
<?py if post['email']: ?>
<?py if post['tripcode']: ?>