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

{% block content %}
<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>

<div style="margin-left:20px;margin-top:20px">
  <h4>Films cut from this bulk film</h4>
  <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 %}