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

{# Suppress page title on homepage. #}
{% block header-margin %}{% endblock %}

{% block col-1 %}

{% if DEMO_MODE %}
{% include 'contrib/demomode/demo_notice.html' %}
{% endif %}

{% block messages %}
{% for message in messages %}
  <div class="alert {% for tag in message.tags.split %}alert-{{tag}} {% endfor %}">
    <a class="close" data-dismiss="alert" href="#">×</a>
    <p>
      {{message}}
    </p>
  </div>
{% endfor %}
{% endblock messages %}

{% if not current_session and not most_recent_session %}
<h3 class="muted">Fresh Kegbot</h3>
<p>This will be more interesting once some activity is recorded.</p>

{% else %}

{% if current_session %}
  <h3 class="muted">
    Now Drinking
    <small>(<a href="{{ current_session.get_absolute_url}}">details</a>)</small>
  </h3>
{% else %}
  <h3 class="muted">
    Recent Activity
    <small>(last session ended <a href="{{ most_recent_session.get_absolute_url}}">
      {% timeago most_recent_session.end_time %}</a>)</small>
  </h3>
{% endif %}

{% include 'kegweb/includes/timeline.html' %}

<div class="well">
  See <a href="{% url "kb-sessions" %}">all sessions</a>.
</div>

{% endif %}

{% endblock col-1 %}


{% block col-2 %}

<h3 class="muted">Currently On Tap</h3>

{% if taps %}

{% for tap in taps %}
{% include 'kegweb/includes/tap_snapshot.html' %}
{% endfor %}

<p class="muted">
  See all taps in <a href="{% url 'kb-fullscreen' %}">fullscreen mode</a>.
</p>

{% else %}
<p class="muted">
  No taps are configured.
  {% if user.is_staff %}
  (Want to <a href="{% url "kegadmin-taps" %}">manage taps</a>?)
  {% endif %}
</p>

{% endif %}

{% endblock col-2 %}
