{% extends "detail.html" %}
{% load boolicontag %}

{% block content %}
<table class="table table-hover">
  <tr>
    <td>Mount</td>
    <td>{{ object.mount }}</td>
  </tr>
  {% if object.shutter_in_lens is not None %}
  <tr>
    <td>Shutter in lens</td>
    <td>{{ object.shutter_in_lens|boolicontag }}</td>
  </tr>
  {% endif %}
  {% if object.type is not None %}
  <tr>
    <td>Type</td>
    <td>{{ object.type }}</td>
  </tr>
  {% endif %}
  {% if object.purpose is not None %}
  <tr>
    <td>Purpose</td>
    <td>{{ object.purpose }}</td>
  </tr>
  {% endif %}
  {% if object.notes is not None %}
  <tr>
    <td>Notes</td>
    <td>{{ object.notes }}</td>
  </tr>
  {% endif %}
  {% if object.manufacturer is not None %}
  <tr>
    <td>Manufacturer</td>
    <td><a href="{% url 'manufacturer-detail' object.manufacturer.slug %}">{{ object.manufacturer }}</a></td>
  </tr>
  {% endif %}
  <tr>
    <th colspan="2">Misc</th>
  </tr>
  {% if object.tags is not None %}
  <tr>
    <td>Tags</td>
    <td>{% for tag in object.tags.all %}
      <a class="btn btn-outline-primary" href="{% url 'tag-detail' tag|lower %}" role="button">{{ tag }}</a>
      {% endfor %}</td>
  </tr>
  {% endif %}
  {% if object.created_at is not None %}
  <tr>
    <td>Created</td>
    <td>{{ object.created_at }}{% if object.created_by is not None %} by {{ object.created_by }}{% endif %}</td>
  </tr>
  {% endif %}
  {% if object.updated_at is not None %}
  <tr>
    <td>Last updated</td>
    <td>{{ object.updated_at }}{% if object.updated_by is not None %} by {{ object.updated_by }}{% endif %}</td>
  </tr>
  {% endif %}
</table>

{% if related %}
<h4>Similar mounts</h4>
<ul>
  {% for relateditem in related %}
  <li><a href="{% url 'mount-detail' relateditem.slug %}">{{ relateditem }}</a></li>
  {% endfor %}
</ul>
{% endif %}

<h5><a data-toggle="collapse" href="#collapseCameras" role="button" aria-expanded="false"
    aria-controls="collapseCameras">
    Camera models</a></h5>
<div class="collapse" id="collapseCameras">
  <ul>
    {% for cameramodel in mount.cameramodel_set.all %}
    <li><a href="{% url 'cameramodel-detail' cameramodel.slug %}">{{ cameramodel }}</a></li>
    {% endfor %}
  </ul>
</div>

<h5><a data-toggle="collapse" href="#collapseLenses" role="button" aria-expanded="false" aria-controls="collapseLenses">
    Lens models</a></h5>
<div class="collapse" id="collapseLenses">
  <ul>
    {% for lensmodel in mount.lensmodel_set.all %}
    <li><a href="{% url 'lensmodel-detail' lensmodel.slug %}">{{ lensmodel }}</a></li>
    {% endfor %}
  </ul>
</div>
{% endblock %}
