{% load i18n %}

{% if not self.as_pdf %}
<h2><i class="fa fa-file-text-o"></i> {{ self.title }}</h2>

{{ self.form }}

<div class="seperator"></div>

{% if self.components %}
    <ul class="nav nav-tabs">
        <li class="active"
            onclick="$('.tab-statistics, .tab-data').toggle(); $('.nav-tabs > li').toggleClass('active')"><a href="javascript:">Estatística</a></li>
        <li onclick="$('.tab-statistics, .tab-data').toggle(); $('.nav-tabs > li').toggleClass('active')"><a href="javascript:">Dados</a></li>
    </ul>
{% endif %}

</br>

{% endif %}

<div class="tab-data" style="{% if self.components %}display: none{% endif %}">
    {% if not self.as_pdf %}
    <div align="right">
        <a href="{{ self.request.get_full_path }}{% if self.request.META.QUERY_STRING %}&{% else %}?{% endif %}pdf=1">
            <i class="fa fa-file"></i> <span>Exportar PDF</span>
        </a>
    </div>
    {% endif %}
    {{ self.table }}
</div>

<div class="tab-statistics" style="display: block">
    {% for component in self.components %}
        {{ component }}
        <div class="seperator"></div>
    {% endfor %}
</div>