{% extends "page-twocol.html" %}
{% load kegweblib %}

{% block title %}drinker details for {{ drinker.username }}{% endblock %}

{% block pagetitle %}
  drinker overview: {{ drinker.username }}
{% endblock %}

{% block col-1 %}
<div class="kb-contentbox">
  <div style="float:left;">
    {% mugshot_box kbsite.url drinker 128 %}
  </div>
  <table border="0" class="kb-statstable">
     <tr>
       <td valign="top" align="right">
         <b>Total Sessions</b>
       </td>
       <td>
         {{ sessions.count }}
       </td>
     </tr>

     <tr>
        <td align="right" valign="top"><b>Total Drinks</b></td>
        <td align="left">{{ drinks.valid.count }}</td>
     </tr>

     {% if drinks.valid.count %}
     <tr>
        <td align="right" valign="top"><b>Last Drink</b></td>
        <td align="left">
          {{ drinks.valid.0.starttime|date:"l, F j, Y" }}<br>
          <i>({% timeago drinks.valid.0.starttime%})</i>
        </td>
     </tr>
     {% endif %}

     <tr>
        <td align="right" valign="top"><b>Total Volume</b></td>
        <td align="left">
          {% volume stats.total_volume_ml %}
        </td>
     </tr>
  </table>
</div>

{% endblock %}

{% block col-2 %}
<div class="kb-contentbox-head">
  stats
</div>
<div class="kb-contentbox">
  <p>
    <b>total pints, by day of week</b><br>
    {% chart sessions_weekday drinker 350 100 %}
  </p>

  <p>
    <b>all sessions, by pints per session</b><br>
    {% chart sessions_volume sessions 350 100 %}
  </p>
</div>
{% endblock %}

{% block extra-content %}
<div class="kb-main-content">
  <div class="kb-contentbox-head">
     all sessions
  </div>
  <div class="kb-contentbox">
    {% comment %} TODO(mikey): Pagniate sessions. {% endcomment %}
    {% for chunk in sessions %}
      {% with chunk.session as session %}
        {% include "kegweb/keg-session.html" %}
      {% endwith %}
    {% endfor %}
  </div>
</div>
{% endblock %}
