Source

dvd-collection / collection / templates / collection / movie_form.html

Full commit
{% extends "base.html" %}

{% block title %}{% if movie %}Update {{movie.title}}{% else %}Add Movie{% endif %}{% endblock %}

{% block base_content %}
          {% if movie %}
          <form action="{% url 'movie_edit' movie.slug %}" method="post">{% csrf_token %}
          {% else %}
          <form action="{% url 'movie_add' %}" method="post">{% csrf_token %}
          {% endif %}
            <fieldset>
              <legend>{% if movie %}Update Movie Details for {{movie.title}}{% else %}Add Movie to collection{% endif %}</legend>
              {% if movie %}
              <a class="btn btn-danger" href="{% url 'movie_detail' movie.slug %}">Cancel</a>
              {% endif %}
              {% include "bootstrap_form.html" %}
              <button type="submit" class="btn btn-primary">{% if movie %}Save Movie{% else %}Add Movie{% endif %}</button>
            </fieldset>
          </form>
{% endblock %}