{% extends "podcast_analyzer/app_base.html" %}
{% load i18n %}
{% block extratitle %}{% translate "Edit" %} {{ episode.title }} - {{ podcast.title }}{% endblock %}

{% block breadcrumbs %}

  <li><a href="{% url 'podcast_analyzer:podcast-list' %}">{% translate "Podcasts" %}</a></li>
  <li><a href="{{ podcast.get_absolute_url }}">{{ podcast.title }}</a> </li>
  <li><a href="{% url 'podcast_analyzer:episode-list' podcast_id=podcast.id %}">{% translate "Episodes" %}</a></li>
  <li><a href="{{ episode.get_absolute_url }}">{{ episode.title }}</a></li>
  <li class='is-active'><a href="#" aria-current="page">{% translate "Edit" %}</a> </li>

{% endblock breadcrumbs %}

{% block content %}
  <h1>{% blocktranslate with title=episode.title %}Edit {{ title }}{% endblocktranslate %}</h1>
  <form method="post">
    {% csrf_token %}
    {% for field in form %}
      <div class="field">
        {{ field.errors }}
        {{ field.label_tag }}
        <div>{{ field }}</div>
        {% if field.help_text %}
          <p id="{{ field.auto_id }}_helptext">{{ field.help_text|safe }}</p>
        {% endif %}
      </div>
    {% endfor %}
    <a href="{{ episode.get_absolute_url }}">{% translate "Return to episode detail and discard changes" %}</a>
    <button type="submit">{% translate "Save changes" %}</button>
  </form>
{% endblock content %}
