leilukin-tumbleblog/modules/pingable/admin/pages/manage_pingbacks.twig

70 lines
2.5 KiB
Twig
Raw Normal View History

2024-06-20 14:10:42 +00:00
{% extends "layouts" ~ DIR ~ "default.twig" %}
{% block title %}{{ "Manage Webmentions" | translate("pingable") }}{% endblock %}
{% block content %}
<form class="filters" action="{{ url('manage_pingbacks') }}" method="post" accept-charset="UTF-8" role="search">
<fieldset role="presentation">
<label for="query">
{{ "Search&hellip;" | 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">{{ "Search" | translate }}</button>
</fieldset>
</form>
<h2>{{ GET.query is not empty ? "Search Results" | translate : "Webmentions" | translate("pingable") }}</h2>
<table class="interactive">
<thead>
<tr class="head">
<th class="pingback_title title main">{{ "Title" | translate("pingable") }}</th>
<th class="pingback_post title">{{ "Post" | translate("pingable") }}</th>
<th class="pingback_date date">{{ "Added" | translate("pingable") }}</th>
{{ trigger.call("manage_pingbacks_column_header") }}
<th class="controls" colspan="2">{{ "Controls" | translate }}</th>
</tr>
</thead>
<tbody>
{% for pingback in pingbacks.paginated %}
<tr id="pingback_{{ pingback.id }}" class="pingback">
<td class="pingback_title title main">
<a href="{{ pingback.source | fix(true) }}">
{{ pingback.title | oneof("[Untitled]" | translate) | truncate(40) }}</a>
</td>
<td class="pingback_post title">
{% if not pingback.post.no_results %}
<a href="{{ pingback.post.url() }}#pingback_{{ pingback.id }}">
{{ pingback.post.title() | striptags | oneof("[Untitled]" | translate) | truncate(40) }}</a>
{% endif %}
</td>
<td class="pingback_date date">
{{ pingback.created_at | time }}
</td>
{{ trigger.call("manage_pingbacks_column", pingback) }}
<td class="controls">
{{ pingback.edit_link(icon_img("edit.svg", "edit" | translate), null, null, "emblem") }}
</td>
<td class="controls">
{{ pingback.delete_link(icon_img("delete.svg", "delete" | translate), null, null, "emblem") }}
</td>
</tr>
{% else %}
<tr>
<td class="placeholder">
{{ icon_img("failure.svg", "", "emblem") }} {{ "No results" | translate }}
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% if pingbacks.paginated is not empty and pingbacks.pages > 1 %}
<div class="pagination">
<span class="pages">{{ "Page %d of %s" | translate | format(pingbacks.page, pingbacks.final_link(pingbacks.pages)) }}</span>
{{ pingbacks.prev_link }}
{{ pingbacks.next_link }}
</div>
{% endif %}
{% endblock %}