{% extends 'base.html' %}

{% block content %}
    <div class="container">

        <table class="table">
          <thead>
            <tr>
              <th scope="col">#</th>
              <th scope="col">Name</th>
              <th scope="col">Actions</th>
            </tr>
          </thead>
          <tbody>
            {% for author in authors %}
                <tr>
                  <th scope="row">{{ forloop.counter }}</th>
                  <td>{{ author.name }}</td>
                  <td>
                      <div style="display: flex;">
                          <a class="btn btn-info small" href="{% url 'author_update' author.pk %}">Изменить</a>
                          <a class="btn btn-danger small" href="{% url 'author_delete' author.pk %}">Удалить</a>
                      </div>
                  </td>
                </tr>
            {% endfor %}
          </tbody>
        </table>
        <a href="{% url 'author_create' %}">Создать автора</a>
        {% include 'partial/pagination.html' %}

    </div>
{% endblock %}