{% extends "base.html" %}

{% import "bootstrap/wtf.html" as wtf %}

{% block title %}
 {{ super() }} - Catalogo
{% endblock %}

{% block head %}
    {{super()}}
    <link href="{{ url_for('static', filename='styles/annon-tool.css') }}" rel="stylesheet">
{% endblock %}

{% block content_title %}
    <h1 class="page-header">Catalogo</h1>
{% endblock %}
{% block breadcrumb %}
    {% include 'breadcrumb.html' %}
{% endblock %}
{% block content %}

<div class="col-lg-6">
    <div class="panel panel-default">
        <div class="panel-heading">
            <i class="fa fa-users"></i> {{ data.label}}
        </div>
        <!-- /.panel-heading -->
        <div class="panel-body">
            <div class="list-group">
                {# si hay labels es que estamos en la pagina que muestra los dias #}
                {% if data['label-list'] %}
                    {% for row in data.rows %}
                        <div class="list-group-item">
                            <div class="btn-group" role="group" aria-label="...">
                                <a href="{{ data.baseurl }}/{{ row }}" class="btn btn-default" role="button">
                                {{ row }} - Todas
                                </a>
                                {% for label in data['label-list'] %}
                                    <a href="{{ data.baseurl }}/{{ row }}/{{ label.id }}" class="btn btn-default label-{{ label.id }}" role="button">
                                    {{ label.name }}
                                    </a>
                                {% endfor %}
                            </div>
                        </div>
                    {% endfor %}
                {% else %}
                    {% for row in data.rows %}
                    <a href="{{ data.baseurl }}/{{ row }}" class="list-group-item">
                        {{ row }}
                    </a>
                    {% endfor %}
                {% endif %}
            </div>
        </div>
        <!-- /.panel-body -->
    </div>
</div>

{% if data['less-labeled'] %}
<div class="col-lg-6">
    <div class="panel panel-default">
        <div class="panel-heading">
            <i class="fa fa-users"></i> Dias con menos imagenes etiquetadas
        </div>
        <!-- /.panel-heading -->
        <div class="panel-body">
            <div class="list-group">
                {% for row in data['less-labeled'] %}
                <a href="{{ data.baseurl }}/{{ row[1] }}/{{ row[2] }}/{{ row[3] }}/{{ data['base-label'] }}" class="list-group-item">
                    {{ row[0] }}
                    <span class="pull-right text-muted small"><em>{{ row[4] }} imagenes sin etiqueta</em>
                    </span>
                </a>
                {% endfor %}
            </div>
        </div>
        <!-- /.panel-body -->
    </div>
</div>
{% endif %}

{% endblock %}