{% load urlreplace %}
{% load naturalduration %}

<table class="table table-striped table-sm">
    <thead>
        <tr>
            <th scope="col">Latest</th>
            <th scope="col">Title</th>
            <th scope="col">Scrobbles</th>
            <th scope="col">Start</th>
        </tr>
    </thead>
    <tbody>
        {% for obj in object_list %}
        {% if obj.title %}
        <tr>
            <td><a href="{{obj.scrobble_set.last.get_absolute_url}}">{{obj.scrobble_set.last.local_timestamp}}
            <td><a href="{{obj.get_absolute_url}}">{{obj}}</a></td>
            {% if request.user.is_authenticated %}
            <td>{{obj.scrobble_count}}</td>
            <td><a type="button" class="btn btn-sm btn-primary" href="{{obj.start_url}}">Scrobble</a></td>
            {% endif %}
        </tr>
        {% endif %}
        {% endfor %}
    </tbody>
</table>

<p class="pagination">
    <span class="page-links">
        {% if page_obj.has_previous %}
            <a href="?{% urlreplace page=page_obj.previous_page_number %}">prev</a>
        {% endif %}
            <span class="page-current">
                Page {{ page_obj.number }} of {{ page_obj.paginator.num_pages }}
            </span>
        {% if page_obj.has_next %}
            <a href="?{% urlreplace page=page_obj.next_page_number %}">next</a>
        {% endif %}
    </span>
</p>
