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

{% block content %}
<table class="table table-hover">
  <tr>
    <th colspan="2" id="summary"><img src="{% static "svg/summary.svg" %}" width="30" height="30" alt="Summary">&nbsp;<a
        href="#">Summary</a></th>
  </tr>
  {% if object.manufacturer is not None %}
  <tr>
    <td>Manufacturer</td>
    <td>{% include "manufacturer.html" with manufacturer=object.manufacturer %}</td>
    {% endif %}
  </tr>
  <tr>
    <td>Model</td>
    <td>{{ object.model }}</td>
  </tr>
  <tr>
    <td>Accessory type</td>
    <td>{{ object.type }}</td>
  </tr>
  <tr>
    <th colspan="2" id="compatibility"><img src="{% static "svg/compatibility.svg" %}" width="30" height="30"
        alt="Ownership">&nbsp;<a href="#compatibility">Compatibility</a></th>
  </tr>
  {% if object.camera_model_compatibility.all %}
  <tr>
    <td>Camera model compatibility</td>
    <td>
      <ul class="list-inline">{% for camera in object.camera_model_compatibility.all %}
        <li class="list-inline-item"><a href="{% url 'schema:cameramodel-detail' camera.slug %}">{{ camera }}</a></li>
        {% endfor %}</ul>
    </td>
  </tr>
  {% endif %}
  {% if object.lens_model_compatibility.all %}
  <tr>
    <td>Lens model compatibility</td>
    <td>
      <ul class="list-inline">
        {% for lens in object.lens_model_compatibility.all %}
        <li class="list-inline-item"><a href="{% url 'schema:lensmodel-detail' lens.slug %}">{{ lens }}</a></li>
        {% endfor %}</ul>
    </td>
  </tr>
  {% endif %}
  <tr>
    <th colspan="2" id="ownership"><img src="{% static "svg/ownership.svg" %}" width="30" height="30"
        alt="Ownership">&nbsp;<a href="#ownership">Ownership</a></th>
  </tr>
  {% if object.acquired is not None %}
  <tr>
    <td>Acquired</td>
    <td>{{ object.acquired }} <small class="text-muted">{{ object.acquired|timesince }} ago</small></td>
  </tr>
  {% endif %}
  {% if object.cost is not None %}
  <tr>
    <td>Cost</td>
    <td>{{ object.cost }}</td>
  </tr>
  {% endif %}
  {% if object.lost is not None %}
  <tr>
    <td>Lost</td>
    <td>{{ object.lost }} <small class="text-muted">{{ object.lost|timesince }} ago</small></td>
  </tr>
  {% endif %}
  {% if object.lost_price is not None %}
  <tr>
    <td>Lost price</td>
    <td>{{ object.lost_price }}</td>
  </tr>
  {% endif %}
</table>
{% endblock %}
