<div class="row">
  <div class="col-12">
    {% if data.days %}
    <div class="table-responsive">
      <table class="table table-striped table-sm">
        <thead>
          <tr>
            <th>Day</th>
            <th class="text-end">Scrobbles</th>
            <th>Distribution</th>
          </tr>
        </thead>
        <tbody>
          {% with total=data.days|dictsortreversed:"count"|first %}
          {% with max_count=total.count %}
          {% for entry in data.days %}
          <tr>
            <td>{{ entry.day_name }}</td>
            <td class="text-end">{{ entry.count }}</td>
            <td style="width: 40%;">
              {% if max_count > 0 %}
              <div class="progress" style="height: 12px;">
                <div class="progress-bar" role="progressbar"
                     style="width: {{ entry.count|floatformat:0 }}%;"
                     aria-valuenow="{{ entry.count }}"
                     aria-valuemin="0" aria-valuemax="{{ max_count }}">
                </div>
              </div>
              {% endif %}
            </td>
          </tr>
          {% endfor %}
          {% endwith %}
          {% endwith %}
        </tbody>
      </table>
    </div>
    {% else %}
    <p class="text-muted">No weekly data found.</p>
    {% endif %}
  </div>
</div>
