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

{% 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.lensmodel is not None %}
  <tr>
    <td>Lens model</td>
    <td><a href="{% url 'schema:lensmodel-detail' object.lensmodel.slug %}">{{ object.lensmodel }}</a></td>
  </tr>
  {% endif %}
  {% if object.serial is not None %}
  <tr>
    <td>Serial number</td>
    <td><code>{{ object.serial }}</code></td>
  </tr>
  {% endif %}
  {% if object.date_code is not None %}
  <tr>
    <td>Date code</td>
    <td><code>{{ object.date_code }}</code></td>
  </tr>
  {% endif %}
  {% if object.manufactured is not None %}
  <tr>
    <td>Date manufactured</td>
    <td>{{ object.manufactured }} <small class="text-muted">{{ object.introduced|yearssince }}</small></td>
  </tr>
  {% endif %}
  {% if object.notes is not None %}
  <tr>
    <td>Notes</td>
    <td>{{ object.notes|linebreaks }}</td>
  </tr>
  {% endif %}
  {% if object.condition is not None %}
  <tr>
    <td>Condition</td>
    <td>{{ object.condition }}</td>
  </tr>
  {% endif %}
  {% if object.condition_notes is not None %}
  <tr>
    <td>Condition notes</td>
    <td>{{ object.condition_notes|linebreaks }}</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.own is not None %}
  <tr>
    <td>Own</td>
    <td>{{ object.own|boolicontag }}</td>
  </tr>
  {% endif %}
  {% 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.source is not None %}
  <tr>
    <td>Source</td>
    <td>{{ object.source }}</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 %}

{% block moreactions %}
{% if object.own is not False %}<li><a class="btn btn-primary" href="{% url 'schema:lens-sell' object.id_owner %}"
    role="button">Sell this lens</a></li>{% endif %}
{%endblock%}
