{% extends "base_list.html" %}
{% load static %}

{% block title %}Exercises{% endblock %}

{% block lists %}
<div class="row">
    <div class="col-md">
        <div class="table-responsive">
            <table class="table table-striped table-sm">
                <thead>
                    <tr>
                        <th scope="col">Exercise</th>
                        <th scope="col">Level</th>
                        <th scope="col">Equipment</th>
                        <th scope="col">Category</th>
                    </tr>
                </thead>
                <tbody>
                    {% for exercise in object_list %}
                    <tr>
                        <td><a href="{{exercise.get_absolute_url}}">{{exercise.name}}</a></td>
                        <td>{{exercise.level|default:""}}</td>
                        <td>{{exercise.equipment|default:""}}</td>
                        <td>{{exercise.category|default:""}}</td>
                    </tr>
                    {% endfor %}
                </tbody>
            </table>
        </div>
    </div>
</div>
{% if is_paginated %}
<div class="row">
    <div class="col-md">
        <nav aria-label="Page navigation">
            <ul class="pagination">
                {% if page_obj.has_previous %}
                <li class="page-item"><a class="page-link" href="?page={{page_obj.previous_page_number}}">Previous</a></li>
                {% endif %}
                <li class="page-item disabled"><a class="page-link" href="#">{{page_obj.number}} / {{page_obj.paginator.num_pages}}</a></li>
                {% if page_obj.has_next %}
                <li class="page-item"><a class="page-link" href="?page={{page_obj.next_page_number}}">Next</a></li>
                {% endif %}
            </ul>
        </nav>
    </div>
</div>
{% endif %}
{% endblock %}
