LSBC/templates/episode/index.html.twig

61 lines
1.6 KiB
Twig

{% extends 'base.html.twig' %}
{% block title %}Episode index{% endblock %}
{% block body %}
<h1>
{% if podcast is defined %}
Episodes for {{ podcast.name }}
{% else %}
All your episodes
{% endif %}
</h1>
<table class="table">
<thead>
<tr>
<th>ID</th>
<th>Title</th>
<th>Publication date</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
{% for episode in episodes %}
<tr>
<td>{{ episode.id }}</td>
<td>{{ episode.title }}</td>
<td>{{ episode.publicationDate ? episode.publicationDate|date('Y-m-d H:i:s') : '' }}</td>
<td>
<a
href="{{ path('app_episode_show', {'id': episode.id}) }}"
class="btn btn-primary"
>Show</a>
<a
href="{{ path('app_episode_edit', {'id': episode.id}) }}"
class="btn btn-primary"
>Edit</a>
</td>
</tr>
{% else %}
<tr>
<td colspan="4">No episodes found.</td>
</tr>
{% endfor %}
</tbody>
</table>
{% if podcast is defined %}
<a href="{{ path('app_episode_new', {'podcast': podcast.id }) }}"
><button class="btn btn-primary">Create new episode of this podcast</button></a>
<a href="{{ path('app_podcast_show', {'id': podcast.id}) }}">Back to podcast</a>
{% else %}
<a href="{{ path('app_episode_new') }}" class="btn btn-primary">Create new episode</a>
<p>
To manage episodes of a specific podcast, open the podcast page and use
the “Manage podcasts” link.
</p>
{% endif %}
{% endblock %}