102 lines
3.7 KiB
Twig
102 lines
3.7 KiB
Twig
|
{% extends "layouts" ~ DIR ~ "default.twig" %}
|
||
|
|
||
|
{% block title %}{{ "Manage Comments" | translate("comments") }}{% endblock %}
|
||
|
|
||
|
{% block content %}
|
||
|
<form class="filters" action="{{ url('manage_comments') }}" method="post" accept-charset="UTF-8" role="search">
|
||
|
<fieldset role="presentation">
|
||
|
<label for="query">
|
||
|
{{ "Search…" | translate }}
|
||
|
<a href="{{ url('help/id/filtering_results') }}" rel="help" target="_blank" class="help emblem">
|
||
|
{{- icon_img("help.svg", "help" | translate) -}}
|
||
|
</a>
|
||
|
</label>
|
||
|
<input class="text filter_text" type="text" name="query" value="{{ GET.query | fix(true, true) }}" id="query">
|
||
|
<button type="submit" class="inline">{{ "Search" | translate }}</button>
|
||
|
</fieldset>
|
||
|
</form>
|
||
|
<h2>{{ GET.query is not empty ? "Search Results" | translate : "Comments" | translate("comments") }}</h2>
|
||
|
<form action="{{ url('bulk_comments') }}" method="post" accept-charset="UTF-8" data-toggler="comment_toggler">
|
||
|
<table class="interactive{{ comments.paginated is empty ? ' empty' : '' }}">
|
||
|
<thead>
|
||
|
<tr class="head">
|
||
|
<th class="toggler" id="comment_toggler"></th>
|
||
|
<th class="comment_post title main">{{ "Post" | translate("comments") }}</th>
|
||
|
<th class="comment_date date">{{ "Added" | translate("comments") }}</th>
|
||
|
<th class="comment_status status">{{ "Status" | translate("comments") }}</th>
|
||
|
{{ trigger.call("manage_comments_column_header") }}
|
||
|
<th class="controls" colspan="2">{{ "Controls" | translate }}</th>
|
||
|
</tr>
|
||
|
</thead>
|
||
|
<tbody>
|
||
|
{% for comment in comments.paginated %}
|
||
|
<tr id="comment_{{ comment.id }}" class="comment {{ comment.status }}">
|
||
|
<td rowspan="2" class="checkbox">
|
||
|
<input type="checkbox" name="comment[{{ comment.id }}]" value="" id="comment_checkbox_{{ comment.id }}" aria-label="{{ 'Select' | translate | fix(true) }}">
|
||
|
</td>
|
||
|
<td class="comment_post title main">
|
||
|
{% if not comment.post.no_results %}
|
||
|
<a href="{{ comment.post.url() }}#comment_{{ comment.id }}">
|
||
|
{{ comment.post.title() | striptags | oneof("[Untitled]" | translate) | truncate(40) }}</a>
|
||
|
{% endif %}
|
||
|
<td class="comment_date date">
|
||
|
{{ comment.created_at | time }}
|
||
|
</td>
|
||
|
<td class="comment_status status">
|
||
|
{% if comment.status == "pingback" %}
|
||
|
{{ "Webmention" | translate("comments") }}
|
||
|
{% else %}
|
||
|
{{ comment.status | capitalize | translate("comments") }}
|
||
|
{% endif %}
|
||
|
</td>
|
||
|
{{ trigger.call("manage_comments_column", comment) }}
|
||
|
<td class="controls">
|
||
|
{{ comment.edit_link(icon_img("edit.svg", "edit" | translate), null, null, "emblem") }}
|
||
|
</td>
|
||
|
<td class="controls">
|
||
|
{{ comment.delete_link(icon_img("delete.svg", "delete" | translate), null, null, "emblem") }}
|
||
|
</td>
|
||
|
</tr>
|
||
|
<tr class="comment_excerpt">
|
||
|
<td class="main" colspan="5">{{ comment.body | striptags | truncate(100) }}</td>
|
||
|
</tr>
|
||
|
{% else %}
|
||
|
<tr>
|
||
|
<td class="placeholder">
|
||
|
{{ icon_img("failure.svg", "", "emblem") }} {{ "No results" | translate }}
|
||
|
</td>
|
||
|
</tr>
|
||
|
{% endfor %}
|
||
|
</tbody>
|
||
|
</table>
|
||
|
{% if visitor.group.can("edit_comment", "delete_comment") %}
|
||
|
<div class="controls">
|
||
|
<label for="bulk_task">{{ "With selected:" | translate("comments") }}</label>
|
||
|
<select name="task" id="bulk_task">
|
||
|
<option value="deny" selected>
|
||
|
{{ "Deny" | translate("comments") }}
|
||
|
</option>
|
||
|
<option value="approve">
|
||
|
{{ "Approve" | translate("comments") }}
|
||
|
</option>
|
||
|
<option value="spam">
|
||
|
{{ "Mark as Spam" | translate("comments") }}
|
||
|
</option>
|
||
|
<option value="delete">
|
||
|
{{ "Delete" | translate("comments") }}
|
||
|
</option>
|
||
|
</select>
|
||
|
<button type="submit">{{ "Execute" | translate("comments") }}</button>
|
||
|
<input type="hidden" name="hash" value="{{ authenticate() }}" id="hash">
|
||
|
</div>
|
||
|
{% endif %}
|
||
|
</form>
|
||
|
{% if comments.paginated is not empty and comments.pages > 1 %}
|
||
|
<div class="pagination">
|
||
|
<span class="pages">{{ "Page %d of %s" | translate | format(comments.page, comments.final_link(comments.pages)) }}</span>
|
||
|
{{ comments.prev_link }}
|
||
|
{{ comments.next_link }}
|
||
|
</div>
|
||
|
{% endif %}
|
||
|
{% endblock %}
|