KXStudio Website https://kx.studio/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

97 lines
5.9KB

  1. {% extends "layout.twig" %}
  2. {% block title %}${ "Manage Comments" | translate("comments") }{% endblock %}
  3. {% block content %}
  4. <h2>${ "Need more detail?" | translate }</h2>
  5. <form class="detail" action="index.php" method="get" accept-charset="utf-8">
  6. <fieldset>
  7. <input type="hidden" name="action" value="manage_comments" />
  8. <div class="left pad">
  9. <h3>
  10. ${ "Search&hellip;" | translate }
  11. <a href="{% admin "help&id=filtering_results" %}" class="help emblem"><img src="$theme_url/images/icons/help.png" alt="help" /></a>
  12. </h3>
  13. <input class="text" type="text" name="query" value="${ GET.query | escape }" id="query" />
  14. <button type="submit" class="inline">${ "Search &rarr;" | translate }</button>
  15. </div>
  16. <div class="clear"></div>
  17. </fieldset>
  18. </form>
  19. <br />
  20. <form action="{% admin "bulk_comments" %}" method="post">
  21. <h2>{% if GET.query %}${ "Search Results" | translate }{% else %}${ "Last 25 Comments" | translate("comments") }{% endif %}</h2>
  22. <table border="0" cellspacing="0" cellpadding="0" class="wide">
  23. <thead>
  24. <tr class="head">
  25. <th class="toggler center"></th>
  26. <th>${ "Post" | translate("comments") }</th>
  27. <th>${ "Author" | translate("comments") }</th>
  28. <th>${ "Added" | translate("comments") }</th>
  29. <th>${ "Status" | translate("comments") }</th>
  30. ${ trigger.call("manage_comments_column_header") }
  31. <th colspan="2">${ "Controls" | translate }</th>
  32. </tr>
  33. </thead>
  34. <tbody>
  35. {% for comment in comments.paginated %}
  36. <tr id="comment_$comment.id" class="comment $comment.status{% if loop.last %} last{% endif %}">
  37. <td rowspan="2" class="checkbox center">
  38. <input type="checkbox" name="comment[$comment.id]" value="" id="comment_checkbox_$comment.id" />
  39. </td>
  40. <td class="main">
  41. {% if not comment.post.no_results %}
  42. <a href="$comment.post.url#comment_$comment.id">${ comment.post.title | truncate }</a>
  43. {% endif %}
  44. </td>
  45. <td>${ comment.user.full_name | fallback(comment.user.login) | fallback(comment.author) }</td>
  46. <td>${ comment.created_at | strftime }</td>
  47. <td>${ comment.status | capitalize | translate("comments") }</td>
  48. ${ trigger.call("manage_comments_column", comment) }
  49. {% if comment.editable and comment.deletable %}
  50. <td class="controls">${ comment.edit_link('<img src="'~ theme_url ~'/images/icons/edit.png" alt="edit" /> '~("edit" | translate)) }</td>
  51. <td class="controls">${ comment.delete_link('<img src="'~ theme_url ~'/images/icons/delete.png" alt="delete" /> '~("delete" | translate)) }</td>
  52. {% elseif comment.editable or comment.deletable %}
  53. ${ comment.edit_link('<img src="'~ theme_url ~'/images/icons/edit.png" alt="edit" /> '~("edit" | translate), '<td class="controls" colspan="2">', '</td>') }
  54. ${ comment.delete_link('<img src="'~ theme_url ~'/images/icons/delete.png" alt="delete" /> '~("delete" | translate), '<td class="controls" colspan="2">', '</td>') }
  55. {% endif %}
  56. </tr>
  57. <tr class="excerpt">
  58. <td colspan="6">${ comment.body | truncate(100) }</td>
  59. </tr>
  60. {% else %}
  61. <tr class="last">
  62. <td colspan="6" class="center"><span class="sub">${ "(none)" | translate }</span></td>
  63. </tr>
  64. {% endfor %}
  65. </tbody>
  66. </table>
  67. {% if visitor.group.can("edit_comment", "delete_comment") %}
  68. <br />
  69. <div class="controls">
  70. <h4>${ "With selected:" | translate("comments") }</h4>
  71. <button class="lite" name="deny">
  72. <img src="$theme_url/images/icons/deny.png" alt="deny" /> ${ "deny" | translate("comments") }
  73. </button>
  74. <button class="lite yay" name="approve">
  75. <img src="$theme_url/images/icons/success.png" alt="approve" /> ${ "approve" | translate("comments") }
  76. </button>
  77. <button class="lite boo" name="spam">
  78. <img src="../modules/comments/spam.png" alt="spam" /> ${ "mark as spam" | translate("comments") }
  79. </button>
  80. <button class="lite boo" name="delete">
  81. <img src="$theme_url/images/icons/delete.png" alt="delete" /> ${ "delete" | translate("comments") }
  82. </button>
  83. </div>
  84. {% endif %}
  85. </form>
  86. {% if comments.paginated and comments.pages > 1 %}
  87. <br />
  88. <div class="pagination">
  89. $comments.next_link
  90. $comments.prev_link
  91. <span class="pages">${ "Page %d of %d" | translate | format(comments.page, comments.pages) }</span>
  92. </div>
  93. {% endif %}
  94. {% endblock %}