{#
    Copyright (c) 2015 Chintalagiri Shashank
    Released under the MIT license
#}

{% macro render_text_filter(title, fieldcode) -%}
    <div class="large-6 small-12 columns">
        <div class="row collapse">
            <div class="large-4 small-12 columns filter-block">
                <div class="sort-group">
                    <ul class="sort-group button-group">
                        <li>
                            <a class="sort button tiny" data-sort="{{ fieldcode }}:asc">
                                <i class="fi-arrow-up"></i>
                            </a>
                        </li>
                        <li>
                            <a class="sort button tiny" data-sort="{{ fieldcode }}:desc">
                                <i class="fi-arrow-down"></i>
                            </a>
                        </li>
                    </ul>
                </div>
                <div class="filterhead">
                    {{ title }}
                </div>
            </div>
            <div class="filter-group search large-8 columns">
                <input type="text" placeholder="Search ..."/>
            </div>
        </div>
    </div>
{% endmacro %}
{% macro render_dimension(title, fieldcode, elems, all_len) -%}
    <div class="row collapse">
        <div class="large-2 small-12 columns filter-block">
            <div class="sort-group">
                <ul class="sort-group button-group">
                    <li>
                        <a class="sort button tiny" data-sort="{{ fieldcode }}:asc">
                            <i class="fi-arrow-up"></i>
                        </a>
                    </li>
                    <li>
                        <a class="sort button tiny" data-sort="{{ fieldcode }}:desc">
                            <i class="fi-arrow-down"></i>
                        </a>
                    </li>
                </ul>
            </div>
            <div class="filterhead">
                {{ title }}
            </div>
        </div>
        <div class="large-10 small-12 columns">
            <ul class="filter-group button-group">
            <li>
                <a class="filter button tiny active" data-filter="all">All ({{ all_len }})</a>
            </li>
            {% for st in elems %}
            <li><a class="filter button tiny" data-filter="[data-{{ fieldcode }}={{ st.0 }}]">
                {{ st.0 }} ({{ st.1 }})
            </a></li>
            {% endfor %}
            </ul>
        </div>
    </div>
{% endmacro %}
