summaryrefslogtreecommitdiffstats
path: root/web/template/pkg_comments.php
diff options
context:
space:
mode:
authorMarcel Korpel <marcel.korpel@gmail.com>2016-01-19 14:49:50 +0100
committerLukas Fleischer <lfleischer@archlinux.org>2016-01-23 11:50:03 +0100
commitbd85441cf66b39d887f01654913da58ef313d14c (patch)
tree54de0489a7031b061ce4e70bb9b0f25575caf4ec /web/template/pkg_comments.php
parente9fe1a9eb100b11fda80f05b5b3239ee97e3a905 (diff)
downloadaurweb-bd85441cf66b39d887f01654913da58ef313d14c.tar.xz
Add comment undeletion functionality
Only Developers and Trusted Users can undelete comments. Signed-off-by: Marcel Korpel <marcel.korpel@gmail.com> Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
Diffstat (limited to 'web/template/pkg_comments.php')
-rw-r--r--web/template/pkg_comments.php11
1 files changed, 11 insertions, 0 deletions
diff --git a/web/template/pkg_comments.php b/web/template/pkg_comments.php
index d05c512..c45e45b 100644
--- a/web/template/pkg_comments.php
+++ b/web/template/pkg_comments.php
@@ -53,6 +53,17 @@ if (!isset($count)) {
?>
<h4 id="comment-<?= $row['ID'] ?>"<?php if ($is_deleted): ?> class="comment-deleted"<?php endif; ?>>
<?= $heading ?>
+ <?php if ($is_deleted && has_credential(CRED_COMMENT_UNDELETE)): ?>
+ <form class="undelete-comment-form" method="post" action="<?= htmlspecialchars(get_pkgbase_uri($pkgbase_name), ENT_QUOTES); ?>">
+ <fieldset style="display:inline;">
+ <input type="hidden" name="action" value="do_UndeleteComment" />
+ <input type="hidden" name="comment_id" value="<?= $row['ID'] ?>" />
+ <input type="hidden" name="token" value="<?= htmlspecialchars($_COOKIE['AURSID']) ?>" />
+ <input type="image" class="undelete-comment" src="/images/action-undo.min.svg" width="11" height="11" alt="<?= __('Undelete comment') ?>" title="<?= __('Undelete comment') ?>" name="submit" value="1" />
+ </fieldset>
+ </form>
+ <?php endif;?>
+
<?php if (!$is_deleted && can_delete_comment_array($row)): ?>
<form class="delete-comment-form" method="post" action="<?= htmlspecialchars(get_pkgbase_uri($pkgbase_name), ENT_QUOTES); ?>">
<fieldset style="display:inline;">