{% extends "detail.html" %}

{% block content %}
<table class="table table-hover">
  <tr>
    <td>Name</td>
    <td>{{ object.name }}</td>
  </tr>
  {% 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 %}
  {% if object.formulation is not None %}
  <tr>
    <td>Formulation</td>
    <td>{{ object.formulation }}</td>
  </tr>
  {% endif %}
  {% if object.stock_dilution is not None %}
  <tr>
    <td>Stock dilution</td>
    <td>{{ object.stock_dilution }}</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 toners</h4>
<ul>
  {% for relateditem in related %}
  <li><a href="{% url 'toner-detail' relateditem.slug %}">{{ relateditem }}</a></li>
  {% endfor %}
</ul>
{% endif %}
{% endblock %}
