{% extends 'brain/base.html.twig' %}

{% block title %}Pages{% endblock %}

{% block page_title %}<h1>All pages</h1>{% endblock %}

{# {% block actions%}Actions here{% endblock %} #}

{% block admin %}
    <div class="list">
        <h2><a href="/brain/page/new">New Page</a></h2>
        <table class="pages">
            <thead>
                <tr>
                    <td>Title</td>
                    <td>Edit</td>
                    <td>View</td>
                    <td>Published</td>
                </tr>
            </thead>
            <tbody>
                {% for page in pages %}
                    <tr>
                        <td>{{page.title}}</td>
                        <td><a href="/brain/page/edit/{{page.getId()}}">Edit</a></td>
                        <td><a href="/{{page.getUrl()}}">View</a><td>
                        <td>{{page.published == 1 ? 'Yes' : 'No'}}</td>
                    </tr>
                {% endfor %}
            </tbody>
        </table>
    </div>
{% endblock %}
