{% extends "base.html" %}
{% load custom_tags_and_filters %}
{% block title %}{{ title }}{% endblock %}
{% block content %}
    <div class="row">
        <div class="col-xs-9">
            <h1 style="margin-top: 0; margin-bottom: 25px">{{ title }}</h1>
        </div>
    </div>
    <ul class="nav nav-tabs">
        {% for quote_configuration in quote_configurations %}
            {% url "quotes" quote_configuration.id as quote_configuration_url %}
            <li class="nav-item{% if quote_configuration_url in request.path %} active{% endif %}">
                <a class="nav-link" href="{{ quote_configuration_url }}">{{ quote_configuration.name }}</a>
                {% if quote_configuration.notification_count %}
                    <span class="badge badge-tab-top{% if quote_configuration_url in request.path %} active{% endif %}">{{ quote_configuration.notification_count }}</span>
                {% endif %}
            </li>
        {% endfor %}
    </ul>
    <div id="quotes-panel-content"
         class="tab-content panel panel-default panel-tab-content info-tooltip-container">
        <div class="panel-body">
            {% block tab_content %}
                {% block before_pagination %}
                    {% if configurations_exist %}
                        <div class="row" style="margin-top: 15px;">
                            <div class="col-md-9 col-xs-8" style="margin-bottom: {% if page %}-15px{% else %}0px{% endif %}">
                                <form class="form-horizontal" method="get">
                                    <div class="form-group">
                                        <label class="col-xs-5 col-sm-4 col-md-3 col-lg-2 control-label" for="status">Status</label>
                                        <div class="col-xs-7 col-md-6">
                                            <select id="status" name="status" class="form-control">
                                                <option value="" selected>All</option>
                                                {% for status in quote_statuses %}
                                                    <option value="{{ status.0 }}" {% if status.0 == selected_status|to_int %}selected{% endif %}>{{ status.1 }}</option>
                                                {% endfor %}
                                            </select>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <div class="col-xs-offset-2 col-xs-10">{% button type="save" value="Update" %}</div>
                                    </div>
                                </form>
                            </div>
                            <div class="col-sm-4 col-md-3 text-right">
                                {% block add_button %}{% endblock %}
                            </div>
                        </div>
                    {% endif %}
                {% endblock %}
                {% if page %}
                    {% with paginator=page.paginator %}
                        {% block pagination_header %}
                            <div class="pagination pull-right" style="clear: both">{% include "pagination/pagination_selector.html" %}</div>
                        {% endblock %}
                        <div class="table-responsive" style="width: 100%">
                            {% block pagination_content %}{% endblock %}
                        </div>
                        {% block pagination_footer %}
                            <div class="pagination pull-right" style="margin-bottom: 0">{% include "pagination/pagination_pages.html" %}</div>
                        {% endblock %}
                    {% endwith %}
                {% else %}
                    <div class="pull-left form-control-static">
                        <i>
                            {% block table_empty_content %}{% endblock %}
                        </i>
                    </div>
                {% endif %}
                {% block after_pagination %}{% endblock %}
            {% endblock %}
        </div>
    </div>
{% endblock %}
