{% extends "granadilla/base.html" %}
{% load granadilla_tags %}
{% load i18n %}

{% block subtitle %}{% trans "Devices" %}{% endblock %}

{% block breadcrumbs %}
<a href="{% url "granadilla:index" %}">{% granadilla_title %}</a> &rsaquo; {% trans "Devices" %}
{% endblock %}

{% block content %}
<h2>{% trans "Devices" %}</h2>

<a href="{% url "granadilla:device_create" %}">{% trans "Add a device" %}</a>

{% if object_list %}

<table class="phonebook">
  <thead>
    <tr>
      <th>{% trans "Owner" %}</th>
      <th>{% trans "Device login" %}</th>
    </tr>
  </thead>
  <tbody>
    {% for device in devices %}
    <tr>
      <td>{{ device.owner_username }}</td>
      <td><a href="{% url "granadilla:device_details" device.login %}">{{ device.login }}</a></td>
    </tr>
    {% endfor %}
  </tbody>
</table>

{% else %}
<p>{% trans "You do not have any devices yet." %}</p>
{% endif %}

{% endblock %}
