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

{% block title %}{{ session.GetTitle}}{% endblock %}

{% block col-1 %}

<div class="kb-contentbox-head">
   {{ session.GetTitle }}
</div>

<div class="kb-contentbox">
  <table border="0" class="kb-statstable">
    <tr>
      <td align="right"><b>When</b></td>
      <td>
        {{session.starttime}}
      </td>
    </tr>

    {% with session.keg_chunks.all as keg_chunks %}
    <tr>
      <td align="right"><b>Keg{{keg_chunks.count|pluralize}}</b></td>
      <td>
        {% for chunk in keg_chunks %}
          {% if chunk.keg %}
            <a href="{% url keg chunk.keg.seqn %}">{{ chunk.keg }}</a><br>
          {% endif %}
        {% endfor %}
      </td>
    </tr>
    {% endwith %}

    <tr>
      <td align="right"><b>Drink Count</b></td>
      <td>
        {{ session.drinks.valid.count }} pours,
        {{session.Volume.ConvertTo.Pint|floatformat:0}} pints
      </td>
    </tr>

  </table>
  <p/>
    <div>
      {% for chunk in session.UserChunksByVolume %}
        {% if chunk.user %}
        <div class="kb-drink-box-mugshot">
          {% with chunk.user as drinker %}
            {% mugshot_box drinker 96 %}
          {% endwith %}
        </div>
        {% endif %}
      {% endfor %}
    </div>

</div>

{% endblock col-1 %}

{% block col-2 %}
<div class="kb-contentbox-head">
  drinker breakdown
</div>
<div class="kb-contentbox">
  {% chart users_by_volume session 350 250 %}
</div>
{% endblock col-2 %}

{% block extra-content %}
<div class="kb-main-content">
  <div class="kb-contentbox-head">
    drinkers by volume
  </div>
  <div class="kb-contentbox">
    {% for chunk in session.UserChunksByVolume %}
      <table border="0">
      <tr>
      <td align="center" valign="center">
        <div class="kb-drink-box-mugshot">
          {% with chunk.user as drinker %}
            {% mugshot_box drinker 96 %}
          {% endwith %}
          {% if chunk.user %}{{ chunk.user }}{% else %}anonymous{% endif %}
        </div>
      </td>
      <td align="center" valign="center">
        <p>
        {% chart user_session_chunks chunk 400 100 %}
        </p>
      </td>
      </tr>
      </table>
    {% endfor %}
  </div>
  <div class="clear">&nbsp;</div>
</div>
{% endblock extra-content %}
