{% load kegweblib %}
{% with keg.current_tap as tap %}
<div class="kb-tapbox clickable" id="keg-snapshot-{{keg.seqn}}"
    data-href="{% url kb-keg kbsite.url keg.seqn %}">
  <div class="row-fluid">
    <div class="span3">
      {% if keg.type.GetImage %}
        <img class="tap-snapshot-image" src="{{ keg.type.GetImage.resized.url }}">
      {% else %}
        <img class="tap-snapshot-image" src="{{ STATIC_URL }}images/kegbot-unknown-square.png">
      {% endif %}
    </div>

    <div class="span9">
      <h2>{{ keg.type.name }} {% if tap %}<small>{{ tap.name }}</small>{% endif %}</h2>

      <ul class="badge-list">
        <li>
          <h2>{% volume keg.served_volume %}</h2>
          <small>Poured</small>
        </li>
        <li>
          {% if keg.remaining_volume > 0 %}
          <h2>{% volume keg.remaining_volume %}</h2>
          {% else %}
          <h2>{% volume 0 %}</h2>
          {% endif %}
          <small>Remaining</small>
        </li>

      {% if tap %}
      {% if tap.temperature_sensor %}
        <li>
          <h2>{{ tap.Temperature.TempC|floatformat:1}} &deg;C</h2>
          <small>Temperature</small>
        </li>
      {% endif %}
      {% endif %}
      </ul>

    </div>
  </div> <!-- /row-fluid -->

</div>

{% endwith %}
