{% extends "layouts" ~ DIR ~ "default.twig" %} {% block title %}{{ "Manage Posts" | translate }}{% endblock %} {% block content %} <form class="filters" action="{{ url('manage_posts') }}" 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_svg("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_post", "add_draft") %} <a href="{{ url('write_post') }}" class="button yay"> {{ icon_svg("add.svg") }}{{ "New Post" | translate }} </a> {% endif %} </fieldset> </form> <h2>{{ GET.query is not empty ? "Search Results" | translate : "Posts" | translate }}</h2> <table> <thead> <tr class="head"> <th class="post_title title main">{{ "Title" | translate }}</th> <th class="post_date date">{{ "Posted" | translate }}</th> <th class="post_status status">{{ "Status" | translate }}</th> <th class="post_author value">{{ "Author" | translate }}</th> {{ trigger.call("manage_posts_column_header") }} <th class="controls" colspan="2">{{ "Controls" | translate }}</th> </tr> </thead> <tbody> {% for post in posts.paginated %} <tr id="post_{{ post.id }}" class="post {{ post_statuses.(post.id).classes | join(' ') }}"> <td class="post_title title main"> <a href="{{ post.url() }}">{{ post.title() | striptags | oneof("[Untitled]" | translate) | truncate(40) }}</a> </td> <td class="post_date date"> {{ post.created_at | time }} </td> <td class="post_status status"> {% for group in post_statuses.(post.id).groups %} <a href="{{ url('manage_users/query/' ~ (('group:' ~ group.name) | url_encode)) }}">{{ group.name }}</a> {% else %} {{ post_statuses.(post.id).name | oneof("[None]" | translate) }} {% endfor %} </td> <td class="post_author value"> {{ post.author.name }} </td> {{ trigger.call("manage_posts_column", post) }} <td class="controls"> {{ post.edit_link(icon_svg("edit.svg", "Edit" | translate), null, null, "emblem") }} </td> <td class="controls"> {{ post.delete_link(icon_svg("delete.svg", "Delete" | translate), null, null, "emblem") }} </td> </tr> {% else %} <tr> <td class="placeholder"> {{ icon_svg("failure.svg", false, "emblem") }} {{ "No results" | translate }} </td> </tr> {% endfor %} </tbody> </table> {% if posts.paginated is defined and posts.pages > 1 %} <div class="pagination"> <span class="pages">{{ "Page %d of %s" | translate | format(posts.page, posts.final_link(posts.pages)) }}</span> {{ posts.prev_link }} {{ posts.next_link }} </div> {% endif %} {% endblock %}