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

{% 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>
  <tr>
    <td>Name</td>
    <td>{{ object.name }}</td>
  </tr>
  {% if object.city is not None %}
  <tr>
    <td>City</td>
    <td>{{ object.city }}</td>
  </tr>
  {% endif %}
  {% if object.country is not None %}
  <tr>
    <td>Country</td>
    <td>{{ object.country.name }} <img src="{{ object.country.flag }}" alt="{{ object.country.code }}" title="{{ object.country.code }}"></td>
  </tr>
  {% endif %}
  {% if object.link is not None %}
  <tr>
    <td>Link</td>
    <td><a href="{{ object.link }}">{{ object.link }}</a></td>
  </tr>
  {% endif %}
  {% if object.founded is not None %}
  <tr>
    <td>Founded</td>
    <td>{{ object.founded }}</td>
  </tr>
  {% endif %}
  {% if object.dissolved is not None %}
  <tr>
    <td>Dissolved</td>
    <td>{{ object.dissolved }}</td>
  </tr>
  {% endif %}
  <tr>
    <th colspan="2" id="meta"><img src="{% static "svg/tag.svg" %}" width="30" height="30" alt="Meta">&nbsp;<a
        href="#meta">Meta</a></th>
  </tr>
  <tr>
    <td>Rating</td>
    <td>{% ratings object %}</td>
  </tr>
  {% if object.tags.all %}
  <tr>
    <td>Tags</td>
    <td>{% for tag in object.tags.all %}
      <a class="btn btn-outline-primary" href="{% url 'schema:tag-detail' tag|lower %}" role="button">{{ tag }}</a>
      {% endfor %}</td>
  </tr>
  {% endif %}
  {% if related %}
  <tr>
    <td>Similar manufacturers</td>
    <td>
      <ul class="list-inline">
        {% for relateditem in related %}
        <li class="list-inline-item">{% include "manufacturer.html" with manufacturer=relateditem %}</a>
        </li>
        {% endfor %}
      </ul>
    </td>
  </tr>
  {% endif %}
  {% if history %}
  <tr>
    <td>Edit history</td>
    <td>{% include "history.html" %}</td>
  </tr>
  {% endif %}
  <tr>
    <td>Sharing</td>
    <td>{% include "sharing.html" %}</td>
  </tr>
</table>
{% endblock %}
