{% extends "base_list.html" %}

{% block title %}Podcasts{% endblock %}

{% block lists %}
{% if podcasts_this_week or podcasts_this_month %}
<div class="row">
    {% if podcasts_this_week or podcasts_this_month %}
    <div class="col-md">
        <h2>Podcasts Listened</h2>

        {% if podcasts_this_week %}
        <h3>This Week</h3>
        <div class="table-responsive">
            <table class="table table-striped table-sm">
                <tbody>
                    {% for item in podcasts_this_week %}
                    <tr>
                        <td>{{item.podcast}}</td>
                        <td>{{item.count}} episodes</td>
                    </tr>
                    {% empty %}
                    <tr><td>No podcasts listened this week</td></tr>
                    {% endfor %}
                </tbody>
            </table>
        </div>
        {% endif %}

        {% if podcasts_this_month %}
        <h3>This Month</h3>
        <div class="table-responsive">
            <table class="table table-striped table-sm">
                <tbody>
                    {% for item in podcasts_this_month %}
                    <tr>
                        <td>{{item.podcast}}</td>
                        <td>{{item.count}} episodes</td>
                    </tr>
                    {% empty %}
                    <tr><td>No podcasts listened this month</td></tr>
                    {% endfor %}
                </tbody>
            </table>
        </div>
        {% endif %}
    </div>
    {% endif %}
</div>
{% endif %}

<div class="row">
    <div class="col-md">
        <div class="table-responsive">
            {% include "_scrobblable_list.html" %}
        </div>
    </div>
</div>
{% endblock %}
