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

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

{% block kegadmin-main %}
{% if logs %}
<p class="lead">
  {{ logs|length }} log{{ logs|length|pluralize }} recorded.
</p>

{% for log in logs %}
  {% ifchanged %}
    <hr/>
    <!-- {{ log.request_info|escape }} -->
    <span class="label">{{ log.level.upper.0 }}</span>
    {% if log.request_info %}
    <span class="muted">{{ log.request_info.method }} {{ log.request_info.request_path }}</span><br/>
    {% endif %}
  {% endifchanged %}
  <code>{{ log.time }} ({{ log.name }}) {{ log.msg }}</code> 

  {% if log.traceback %}
  <pre>{{ log.traceback }}</pre>
  {% endif %}
{% endfor %}

{% else %}
<p>
  No logs are available.
</p>
{% endif %}

{% endblock %}
