{% extends 'silk/base/root_base.html' %}
{% load inclusion %}

{% block menu %}
    {% if silk_request %}
        {% request_menu request silk_request %}
    {% else %}
        {% root_menu request %}
    {% endif %}
{% endblock %}

{% block style %}
    {{ block.super }}
    <style>
        .name-div {
            font-weight: bold;
        }
    </style>

{% endblock %}

{% block filter %}
    <form id="filter-form" action="." method="get"></form>
    <div class="menu-item ">
        <div class="menu-item-outer">
            <div class="menu-item-inner">
                <label>Name:
                    <select name="name" form="filter-form" onchange="this.form.submit();">
                        {% for option in options_names %}
                            <option value="{{ option }}"
                                    {% if option == name %}selected{% endif %}>{{ option }}</option>
                        {% endfor %}
                    </select>
                </label>
            </div>
        </div>
    </div>
    <div class="menu-item ">

        <div class="menu-item-outer">
            <div class="menu-item-inner">
                <label>Function Name:
                    <select name="func_name" form="filter-form" onchange="this.form.submit();">
                        {% for option in options_func_names %}
                            <option value="{{ option }}"
                                    {% if option == func_name %}selected{% endif %}>{{ option }}</option>
                        {% endfor %}
                    </select>
                </label>
            </div>
        </div>
    </div>
    <div class="menu-item">
        <div class="menu-item-outer">
            <div class="menu-item-inner">
                <label>Show:
                    <select name="show" form="filter-form" onchange="this.form.submit();">
                        {% for option in options_show %}
                            <option value="{{ option }}"
                                    {% if option == show %}selected{% endif %}>{{ option }}</option>
                        {% endfor %}
                    </select>
                </label>
            </div>
        </div>
    </div>
    <div class="menu-item">
        <div class="menu-item-outer">
            <div class="menu-item-inner">
                <label>Order:
                    <select name="order_by" form="filter-form" onchange="this.form.submit();">
                        {% for option in options_order_by %}
                            <option value="{{ option }}"
                                    {% if option == order_by %}selected{% endif %}>{{ option }}</option>
                        {% endfor %}
                    </select>
                </label>
            </div>
        </div>
    </div>
{% endblock %}

{% block data %}
    {% if results %}
        {% for profile in results %}
            <a href="
            {% if silk_request %}
                {% url "silk:request_profile_detail" request_id=silk_request.pk profile_id=profile.pk %}
            {% else %}
                {% url "silk:profile_detail" profile_id=profile.pk %}
            {% endif %}
            ">
                {% profile_summary profile %}
            </a>
        {% endfor %}
    {% endif %}
{% endblock %}
