
{% include "header.html" %}
<h1 class="text-4xl py-2">Books</h1>
{% include "error.j2" %}
{% include "success.j2" %}
<table class="table-auto m-auto w-full">
  <thead>
    <tr class="text-left">
      <th class="p-2 pl-4"> Title </th>
      <th class="p-2 pl-4"> Author </th>
      <th class="p-2 pl-4"> Owner </th>
    </tr>
  </thead>
  <tbody>
    {% for book in books %}
    <tr>
      <td class="border px-4 p-1">
        {% if not book.Audiobook %}
          <a
            href="{{ url_for('downloadBook', userid=book.Owner.UserKey, productid=book.RevisionId) }}"
            class="text-blue-700"
          >
            {{ book.Title }}
          </a>
        {% else %}
          {{ book.Title }} 🎧
        {% endif %}
        {% if book.Archived %}
         🗃️
        {% endif %}
      </td>
      <td class="border px-4 p-1">{{ book.Author }}</td>
      <td class="border px-4 p-1">{{ book.Owner.Email }}</td>
    </tr>
    {% endfor %}
  </tbody>
</table>
{% include "footer.html" %}
