{% extends 'layouts/admin.twig' %}

{% block content %}

    <ul class="breadcrumbs el">
        <li><a href="/admin/">Admin</a> /</li>
        <li class="end">{{ title }}</li>
    </ul>

    <h1>{{ title }}</h1>

    {% include 'admin/reviewTypes/tabnav.twig' %}

    {% if reviewTypes.count() > 0 %}
        <table class="manage-items">
            <tr>
                <th>ID</th>
                <th>Name</th>
                <th>Medium</th>
                <th>Type</th>
                <th>Assessment Form</th>
                <th>Category</th>
                <th class="center">Edit</th>
            </tr>
            <tbody class="tabular">
            {% for reviewType in reviewTypes %}
                <tr>
                    <td>
                        <a href="{{ route('admin-review-types-edit', {
                            'id': reviewType.id
                        }) }}">
                            {{ reviewType.id }}
                        </a>
                    </td>
                    <td>
                        {{ reviewType.name }}
                    </td>
                    <td>
                        {{ reviewType.medium ? mediums[reviewType.medium] : '-' }}
                    </td>
                    <td>
                        {{ reviewType.type ? types[reviewType.type] : '-' }}
                    </td>
                    <td>
                        {{ reviewType.form_id ? reviewType.form.name : '-' }}
                    </td>
                    <td>
                        {{ reviewType.category_id ? reviewType.category.name : '-' }}
                    </td>

                    <td class="center">
                        <a href="{{ route('admin-review-types-edit', {
                            'id': reviewType.id
                        }) }}" class="edit">
                            <i class="fa fa-pencil"></i>
                        </a>
                    </td>
                </tr>
            {% endfor %}
            </tbody>
        </table>

    {% else %}
        <p>There are currently no review types</p>
    {% endif %}

{% endblock %}