{% extends "base.html" %}

{% import "bootstrap/wtf.html" as wtf %}
{% import "bootstrap/fixes.html" as fixes %}
{% import "bootstrap/utils.html" as util %}

{% block title %}Evidence Catalog{% endblock %}

{% block content %}
    <div class="container">

        <ol class="breadcrumb">
            <li><a href="{{ url_for('ui.home') }}">Catalog</a></li>
            <li class="active">Evidences</li>
        </ol>

        <div class="panel panel-default">
            <div class="panel-heading">
                <h3 class="panel-title">Evidences</h3>
            </div>
            <div class="panel-body">
                <div class="input-group">
                    <input type="text" class="form-control" placeholder="Search evidences...">
                    <span class="input-group-btn">
                    <button class="btn btn-default" type="button">Go!</button>
                </span>
                </div>
            </div>
        </div>

        <div class="panel panel-default">
            <div class="list-group">
                {% for evidence in evidences %}
                    <div class="list-group-item">
                        <h4 class="list-group-item-heading">
                            <a href="{{ url_for('ui.view_evidence', evidence_id=evidence.id) }}">
                                {{ evidence.citation }}
                            </a>

                            <div class="pull-right">
                                <small class="text-muted">
                                    <a href="{{ url_for('dbs.get_evidence_by_id', evidence_id=evidence.id) }}">JSON</a>
                                </small>
                            </div>
                        </h4>
                        <div class="list-group-item-text">
                            {{ evidence.text }}
                        </div>
                    </div>
                {% endfor %}
            </div>
            {% if count %}
                <div class="panel-footer">
                    <p>Showing {{ evidences|length }} of {{ count }} evidences</p>
                </div>
            {% endif %}
        </div>
    </div>

    {% include "footer.html" %}
{% endblock %}
