summaryrefslogtreecommitdiffstats
path: root/web/template
diff options
context:
space:
mode:
authorLukas Fleischer <archlinux@cryptocrack.de>2014-07-25 10:12:31 +0200
committerLukas Fleischer <archlinux@cryptocrack.de>2014-07-25 11:30:32 +0200
commitdaceef50ebb33a477795a0d790f17fc8770dc45d (patch)
treef3fc88d45881d8553db7d10594eae286c9a8ff7b /web/template
parent16e4708f1e85ee657a3de3e8ad9831e714344004 (diff)
downloadaur-daceef50ebb33a477795a0d790f17fc8770dc45d.tar.gz
aur-daceef50ebb33a477795a0d790f17fc8770dc45d.tar.xz
Make deleted comments visible to Trusted Users
This allows Trusted Users to check whether a user posted a politically incorrect comment, even if he already deleted it. Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Diffstat (limited to 'web/template')
-rw-r--r--web/template/pkg_comments.php12
1 files changed, 8 insertions, 4 deletions
diff --git a/web/template/pkg_comments.php b/web/template/pkg_comments.php
index 9961554e..3e99d9b3 100644
--- a/web/template/pkg_comments.php
+++ b/web/template/pkg_comments.php
@@ -6,7 +6,8 @@ if (isset($row['BaseID'])) {
/* On a package base details page. */
$base_id = $row['ID'];
}
-$count = pkgbase_comments_count($base_id);
+$include_deleted = has_credential(CRED_COMMENT_VIEW_DELETED);
+$count = pkgbase_comments_count($base_id, $include_deleted);
?>
<div id="news">
<h3>
@@ -18,8 +19,8 @@ $count = pkgbase_comments_count($base_id);
<?php if ($row['UserName'] && $SID):
$row['UserName'] = "<a href=\"" . get_user_uri($row['UserName']) . "\">{$row['UserName']}</a>";
endif; ?>
- <h4>
- <?php if (can_delete_comment_array($row)): ?>
+ <h4<?php if ($row['DelUsersID']): ?> class="comment-deleted"<?php endif; ?>>
+ <?php if (!$row['DelUsersID'] && can_delete_comment_array($row)): ?>
<form method="post" action="<?= htmlspecialchars(get_pkgbase_uri($pkgbase_name), ENT_QUOTES); ?>">
<fieldset style="display:inline;">
<input type="hidden" name="action" value="do_DeleteComment" />
@@ -39,10 +40,13 @@ $count = pkgbase_comments_count($base_id);
<?php else: ?>
<?= __('Anonymous comment') ?>
<?php endif; ?>
+ <?php if ($row['DelUsersID']): ?>
+ (<?= __('deleted') ?>)
+ <?php endif; ?>
<?php endif; ?>
</h4>
<p class="timestamp"><?= gmdate('Y-m-d H:i', $row['CommentTS']) ?></p>
- <div class="article-content">
+ <div class="article-content<?php if ($row['DelUsersID']): ?> comment-deleted<?php endif; ?>">
<p>
<?= parse_comment($row['Comments']) ?>
</p>