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

{% block title %}Photos{% endblock %}

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

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

{% block admin %}
    <div class="list">
        <h2><a href="/brain/photos/new">New Photos</a></h2>
        <table class="posts">
            <thead>
                <tr>
                    <td>Title</td>
                    <td>Date</td>
                    <td>Category</td>
                    <td>Edit</td>
                    <td>View</td>
                </tr>
            </thead>
            <tbody>
                {% for photo in photos %}
                    <tr>
                        <td>{{photo.title}}</td>
                        <td>{{photo.getDate()|date('m/d/Y')}}</td>
                        <td>{{photo.category.getTitle()}}</td>
                        <td><a href="/brain/photos/edit/{{photo.getId()}}">Edit</a></td>
                        <td><a href="/photos/{{photo.getUrl()}}">View</a><td>
                    </tr>
                {% endfor %}
            </tbody>
        </table>
    </div>
{% endblock %}
