Use SVG image for comment deletion icon
[aur.git] / web / template / pkg_comments.php
blob03a65817acc2252fbd662b735ecd25c648b17b9a
1 <?php
2 if (isset($row['BaseID'])) {
3 /* On a package details page. */
4 $base_id = $row['BaseID'];
5 } else {
6 /* On a package base details page. */
7 $base_id = $row['ID'];
9 $include_deleted = has_credential(CRED_COMMENT_VIEW_DELETED);
10 $count = pkgbase_comments_count($base_id, $include_deleted);
12 <div id="news">
13 <h3>
14 <a href="<?= htmlentities(get_pkgbase_uri($pkgbase_name), ENT_QUOTES) . '?' . mkurl('comments=all') ?>" title="<?= __('View all comments' , $count) ?> (<?= $count ?>)"><?= __('Latest Comments') ?></a>
15 <span class="arrow"></span>
16 </h3>
18 <?php while (list($indx, $row) = each($comments)): ?>
19 <?php if ($row['UserName'] && $SID):
20 $row['UserName'] = "<a href=\"" . get_user_uri($row['UserName']) . "\">{$row['UserName']}</a>";
21 endif; ?>
22 <h4<?php if ($row['DelUsersID']): ?> class="comment-deleted"<?php endif; ?>>
23 <?php if ($row['UserName']): ?>
24 <?= __('%s commented', $row['UserName']) ?>
25 <?php else: ?>
26 <?= __('Anonymous comment') ?>
27 <?php endif; ?>
28 <?= __('on %s', gmdate('Y-m-d H:i', $row['CommentTS'])) ?>
29 <?php if ($row['DelUsersID']): ?>
30 (<?= __('deleted') ?>)
31 <?php endif; ?>
32 <?php if (!$row['DelUsersID'] && can_delete_comment_array($row)): ?>
33 <form class="delete-comment-form" method="post" action="<?= htmlspecialchars(get_pkgbase_uri($pkgbase_name), ENT_QUOTES); ?>">
34 <fieldset style="display:inline;">
35 <input type="hidden" name="action" value="do_DeleteComment" />
36 <input type="hidden" name="comment_id" value="<?= $row['ID'] ?>" />
37 <input type="hidden" name="token" value="<?= htmlspecialchars($_COOKIE['AURSID']) ?>" />
38 <input type="image" class="delete-comment" src="/images/x.min.svg" width="11" height="11" alt="<?= __('Delete comment') ?>" title="<?= __('Delete comment') ?>" name="submit" value="1" />
39 </fieldset>
40 </form>
41 <?php endif; ?>
42 </h4>
43 <div class="article-content<?php if ($row['DelUsersID']): ?> comment-deleted<?php endif; ?>">
44 <p>
45 <?= parse_comment($row['Comments']) ?>
46 </p>
47 </div>
48 <?php endwhile; ?>
49 </div>
51 <?php if ($count > 10 && !isset($_GET['comments'])): ?>
52 <div id="news">
53 <h3>
54 <a href="<?= htmlentities(get_pkgbase_uri($pkgbase_name), ENT_QUOTES) . '?' . mkurl('comments=all') ?>" title="<?= __('View all comments') ?> (<?= $count ?>)"><?= __('All comments', $count) ?></a>
55 </h3>
56 </div>
57 <?php endif; ?>