{% load get_attribute %}
<div class="container">
{% if data.error %}
    <div class="alert alert-danger"><i class="fa fa-times-circle"></i>
        {{ data.error }}
    </div>
{% else %}
    {% if data.warning %}
        <div class="alert alert-warning"><i class="fa fa-times-circle"></i>
            {{ data.warning }}
        </div>
    {% endif %}
    <form id="form_search" action="{% url 'core_explore_keyword_app_search' %}" method="POST">
        {% csrf_token %}
        <div class="col-sm-12">
            <div class="col-sm-12">
                {% include 'core_explore_keyword_app/user/search_bar.html' %}
            </div>
            <div class="col-sm-10">
                <div class="dropdown float-right">
                    <button class="btn btn-link dropdown-toggle" type="button"
                            id="dropdownMenu"  data-toggle="dropdown" aria-haspopup="true"
                            aria-expanded="false">
                        Tools
                        <span class="caret"></span>
                    </button>
                    <ul class="dropdown-menu tools-menu float-right" aria-labelledby="dropdownMenu">
                        {% if data.display_persistent_query_button %}
                            <li>
                                {% include "core_explore_common_app/user/persistent_query/button_persistent_query.html" with url=data.get_shareable_link_url %}
                            </li>
                        {% endif %}
                        {% if data|get_attribute:'exporter_app' %}
                            <li>
                                {% include "core_exporters_app/user/exporters/list/link_exporters_selector.html" %}
                            </li>
                        {% endif %}
                    </ul>
                </div>
            </div>
        </div>
        <div class="col-sm-12">
            <div class="col-sm-3">
                {% include data.data_sources_selector_template %}
                {% include 'core_explore_keyword_app/user/template_filter.html' %}
            </div>
            <div class="col-sm-9">
                {% include "core_explore_common_app/user/results/results.html" %}
            </div>
        </div>
    </form>
{% endif %}
</div>
