{% extends "layout/base.html" %}
{% set active_page = "dsreport" %}

{% block title %}Dataset Count Report{% endblock %}

{% block content %}
    <div class="panel highlight">
        <h2 class="followed lonesome">Dataset Count Report</h2>
        <span class="header-follow">
            <a href="{{ url_for('.dsreport_csv') }}" class="badge header-badge">
                csv
                <i class="fa fa-file-excel-o" aria-hidden="true"></i>
            </a>
        </span>
    </div>
    <div class="panel odd">
        <table class="data-table">
                <thead>
                    <tr>
                        <th>Product Name</th>
                        <th>Year</th>
                        <th>Month</th>
                        <th class="numeric">Count</th>
                    </tr>
                </thead>

                <tbody>
                    {% for period, count in products_period_dscount.items() %}
                        <tr>
                            <td>{{ period[0] }}</td>
                            <td>{{ period[1] or '' }}</td>
                            <td>{{ period[2] | month_name if period[2] else '' }}</td>
                            <td class="numeric {% if count == 0 %}muted{% endif %}">
                                <a href="{{ url_for('overview_page',
                                                product_name=period[0],
                                                year=period[1],
                                                month=period[2])
                                    }}">
                                    {{ count }}
                                </a>
                            </td>

                        </tr>
                    {% endfor %}
                </tbody>
        </table>
    </div>

{% endblock %}
