{% extends "podcast/base.html" %}
{% load i18n %}

{% block allcontent %}

<div id="return-wrap">
<div id="return">
<p>{% trans "A list of episodes of one show" %}</p>
</div>
</div>

<div id="content-wrap">
<div id="content">

{% block content %}

<p class="back"><a href="{% url "podcast_shows" %}">{% trans "Return to shows" %}</a></p>

{% regroup object_list by show as show_list %}

{% for show in show_list %}
<h2>{{ show.grouper.title }}</h2>
<h3>{{ show.grouper.subtitle }}</h3>

{% if show.grouper.explicity %}<p>{% trans "Explicit" %}</p>{% endif %}

<dl>
  {% if show.grouper.category.all %}<dt>{% trans "Category" %}</dt>

    <dd>{% for category in show.grouper.category.all|slice:":1" %}{{ category.name }}{% endfor %}</dd>{% endif %}
  <dt>{% trans "Author" %}</dt>
 {% for author in show.grouper.author.all %}
    <dd>{% if author.email %}<a href="mailto:{{ author.email }}">{% endif %}{% if author.first_name or author.last_name %}{% if author.first_name and author.last_name %}{{ author.first_name }} {{ author.last_name }}{% endif %}{% if author.first_name and not author.last_name %}{{ author.first_name }}{% endif %}{% if author.last_name and not author.first_name %}{{ author.last_name }}{% endif %}{% else %}{{ author.username }}{% endif %}{% if author.email %}</a>{% endif %}</dd>{% endfor %}

  <dt>{% trans "fedd web/RSS" %}</dt>
    <dd><a href="{% url "podcast_feed" show.grouper.slug %}">{% trans "Subscribe Feed RSS 2.0 and iTunes" %}</a></dd>
    <dd><a href="{% url "podcast_atom" show.grouper.slug %}">{% trans "Subscribe Atom" %}</a></dd>
    <dd><a href="{% url "podcast_media" show.grouper.slug %}">{% trans "Subscribe Media RSS" %}</a></dd>
  {% if show.grouper.feedburner %}<dt>{% trans "FeedBurner" %}</dt>
    <dd><a href="{{ show.grouper.feedburner }}">{% trans "Subscribe" %}</a></dd>{% endif %}
  {% if show.grouper.itunes %}<dt>iTunes</dt>
    <dd><a href="{{ show.grouper.itunes }}">{% trans "Subscribe" %}</a></dd>{% endif %}
</dl>

{% if show.grouper.image %}<div class="image"><img src="{{ show.grouper.image.url }}" width="{{ show.grouper.image.width }}" height="{{ show.grouper.image.height }}" alt="{{ show.grouper.organization }} show logo" /></div>{% endif %}

<p>{% if show.grouper.summary %}{{ show.grouper.summary }}{% else %}{{ show.grouper.description|striptags }}{% endif %}</p>

{% for episode in show.list %}

<h4><a href="{{ episode.get_absolute_url }}">{{ episode.title }}</a></h4>
<h5>{{ episode.subtitle }}</h5>

{% if episode.image %}<div class="image"><a href="{{ episode.get_absolute_url }}"><img src="{{ episode.image.url }}" width="{{ episode.image.width }}" height="{{ episode.image.height }}" alt="{{ episode.title }} {% trans "episode screenshot" %}" /></a></div>{% endif %}

<p>{% if episode.summary %}{{ episode.summary }}{% else %}{{ episode.description|striptags }}{% endif %}</p>
{% endfor %}

{% endfor %}

{% endblock %}
</div>
</div>

{% endblock %}
