{% extends "schema/detail.html" %}

{% block content %}
<table class="table">
  <tr>
    <th>Film format</th>
    <td>{% if object.format %}<a href="{% url 'format-detail' object.format.id %}">{{ object.format }}</a>{% endif %}
    </td>
  </tr>
  <tr>
    <th>Filmstock</th>
    <td>{% if object.filmstock %}<a
        href="{% url 'filmstock-detail' object.filmstock.id %}">{{ object.filmstock }}</a>{% endif %}</td>
  </tr>
  <tr>
    <th>Purchase date</th>
    <td>{{ object.purchase_date }}</td>
  </tr>
  <tr>
    <th>Cost</th>
    <td>{{ object.cost }}</td>
  </tr>
  <tr>
    <th>Source</th>
    <td>{{ object.source }}</td>
  </tr>
  <tr>
    <th>Batch code</th>
    <td>{{ object.batch }}</td>
  </tr>
  <tr>
    <th>Expiry date</th>
    <td>{{ object.expiry }}</td>
  </tr>
</table>

<a data-toggle="collapse" href="#collapseFilms" role="button" aria-expanded="false" aria-controls="collapseFilms">
  Films cut from this bulk film
</a>
<div class="collapse" id="collapseFilms">
  <table class="table">
    <tr>
      <th>Film ID</th>
      <th>Title</th>
    </tr>
    {% for film in bulkfilm.film_set.all %}
    <tr>
      <td>{{ film.id }}</td>
      <td>{{ film.title }}</td>
    </tr>
    {% endfor %}
  </table>
</div>
{% endblock %}
