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

{% block title %}{{object.title}}{% endblock %}

{% block lists %}
{% if object.description %}
<div class="row webpage">
    <div class="webpage-metadata">
      <p>{{object.description}}</p>
    </div>
</div>
{% endif %}
{% if charts %}
<div class="row">
    <div class="col-md">
        {% include "scrobbles/_chart_links.html" %}
    </div>
</div>
{% endif %}
<div class="row">
    <div class="col-md">
        <h3>Last scrobbles</h3>
        <div class="table-responsive">
            <table class="table table-striped table-sm">
            <thead>
                <tr>
                    <th scope="col">Date</th>
                    <th scope="col">Calories</th>
                    <th scope="col">Notes</th>
                </tr>
            </thead>
            <tbody>
                {% for scrobble in scrobbles.all %}
                <tr>
                        <td><a href={{scrobble.get_absolute_url}}>{{scrobble.local_timestamp}}</a></td>
                        <td>{% if scrobble.logdata.calories %}{{scrobble.logdata.calories}}{% else %}{{scrobble.media_obj.calories}}{% endif %}</td>
                        <td>{{scrobble.logdata.notes_as_str}}</td>
                </tr>
                {% endfor %}
            </tbody>
            </table>
        </div>
    </div>
</div>
{% endblock %}
