{% extends "kegadmin/base.html" %}
{% load kegweblib %}
{% load crispy_forms_tags %}
{% load bootstrap_pagination %}

{% block title %}Kegbot Admin: Kegs | {{ block.super }}{% endblock %}
{% block pagetitle %}Kegbot Admin: Kegs{% endblock %}

{% block kegadmin-main %}

{% include 'kegadmin/includes/keg_nav.html' %}

{% for keg in kegs %}

    {% if forloop.counter0|divisibleby:6 %}
    <div class="row-fluid">
    {% endif %}

        <div class="span2 clickable" data-href="{% url 'kegadmin-edit-keg' keg.id %}"
                style="padding:8px;">
          <img src="{{ keg.get_illustration_thumb }}" alt="" class="keg-popover"
                data-title="<b>Keg {{keg.id}}</b> <span class='badge'>{{ keg.percent_full|floatformat:0 }}%</span>" data-trigger="hover" data-placement="bottom"
                data-html="true"
                data-content="
                    {{ keg.type.name }}<br/>
                    <span class='muted'>{{ keg.type.producer.name }}</span><br/>
                    <b>{% if keg.current_tap %}Online, {{ keg.current_tap.name }}{% else %}Offline{% endif %}</b>">
          <center>
              <h5>{{ keg.type.name }}</h5>
          </center>
        </div>
    
    {% if forloop.counter|divisibleby:6 or forloop.last %}
    </div> <!-- /row-fluid -->
    {% endif %}

{% endfor %}

{% bootstrap_paginate kegs %}

{% endblock %}
