leilukin-tumbleblog/admin/pages/manage_pages.twig

91 lines
2.9 KiB
Twig

{% extends "layouts" ~ DIR ~ "default.twig" %}
{% block title %}{{ "Manage Pages" | translate }}{% endblock %}
{% block content %}
<form class="filters" action="{{ url('manage_pages') }}" 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>
{% if visitor.group.can("add_page") %}
<a href="{{ url('write_page') }}" class="button yay">
{{ icon_img("add.svg") }}{{ "New Page" | translate }}
</a>
{% endif %}
</fieldset>
</form>
<h2>{{ GET.query is not empty ? "Search Results" | translate : "Pages" | translate }}</h2>
<table>
<thead>
<tr class="head">
<th class="page_title title main">{{ "Title" | translate }}</th>
<th class="page_created date">{{ "Created" | translate }}</th>
<th class="page_updated date">{{ "Last Updated" | translate }}</th>
<th class="page_public emblem">{{ "Public?" | translate }}</th>
<th class="page_show emblem">{{ "Listed?" | translate }}</th>
<th class="page_author value">{{ "Author" | translate }}</th>
{{ trigger.call("manage_pages_column_header") }}
<th class="controls" colspan="2">{{ "Controls" | translate }}</th>
</tr>
</thead>
<tbody>
{% for page in pages.paginated %}
<tr id="page_{{ page.id }}" class="page">
<td class="page_title title main">
<a href="{{ page.url() }}">{{ page.title | striptags | oneof("[Untitled]" | translate) | truncate(40) }}</a>
</td>
<td class="page_created date">
{{ page.created_at | time }}
</td>
<td class="page_updated date">
{% if page.updated %}
{{ page.updated_at | time }}
{% else %}
<span class="sub">{{ "never" | translate }}</span>
{% endif %}
</td>
<td class="page_public emblem">
{% if page.public %}
{{ icon_img("success.svg", "yes" | translate, "emblem") }}
{% endif %}
</td>
<td class="page_show emblem">
{% if page.show_in_list %}
{{ icon_img("success.svg", "yes" | translate, "emblem") }}
{% endif %}
</td>
<td class="page_author value">
{{ page.author.name }}
</td>
{{ trigger.call("manage_pages_column", page) }}
<td class="controls">
{{ page.edit_link(icon_img("edit.svg", "edit" | translate), null, null, "emblem") }}
</td>
<td class="controls">
{{ page.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 pages.paginated is not empty and pages.pages > 1 %}
<div class="pagination">
<span class="pages">{{ "Page %d of %s" | translate | format(pages.page, pages.final_link(pages.pages)) }}</span>
{{ pages.prev_link }}
{{ pages.next_link }}
</div>
{% endif %}
{% endblock %}