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

{% extends "base_templates/base.html" %}
{% import "parts/gsymlib_symbol.html" as gsymlib_symbol %}

{% block main %}
<div class="row">
    <form action=" {{ request.path }} " method="GET">
        <fieldset>
            <legend> Display Options </legend>
            <div class="row">
            <div class="small-9 medium-3 large-2 columns text-right"> Flatten Folders </div>
            <div class="small-3 medium-1 large-1 columns switch radius end">
                <input id="flattenFolders" name="flattenFolders" type="checkbox" {% if stage.flatten_folders %} checked {% endif %} onchange="this.form.submit()">
                <label for="flattenFolders"></label>
            </div>
            <div class="small-9 medium-3 large-2 columns text-right">Show Symbol Images</div>
            <div class="small-3 medium-1 large-1 columns switch radius">
                <input id="showImages" name="showImages" type="checkbox" {% if stage.show_images %} checked {% endif %} onchange="this.form.submit()">
                <label for="showImages">
                </label>
            </div>
            <div class="small-9 medium-3 large-2 columns text-right"> Resolve Generators </div>
            <div class="small-3 medium-1 large-1 columns switch radius">
                <input id="resolveGenerators" name="resolveGenerators" type="checkbox" {% if stage.resolve_generators %} checked {% endif %} onchange="this.form.submit()">
                <label for="resolveGenerators">
                </label>
            </div>
            <div class="small-9 medium-3 large-2 columns text-right"> Hide Generators </div>
            <div class="small-3 medium-1 large-1 columns switch radius end">
                <input id="hideGenerators" name="hideGenerators" type="checkbox" {% if stage.hide_generators %} checked {% endif %} onchange="this.form.submit()">
                <label for="hideGenerators">
                </label>
            </div>
            </div>
        </fieldset>
    </form>
</div>

{% if stage.subfolders %}
    <h3> Subfolders of {{ stage.path }} </h3>
    <ul class="small-block-grid-2 medium-block-grid-4 large-block-grid-6" data-equalizer="folder">
        {% for folder in stage.subfolders %}
        <li>
            <a href=" /gsymlib/browse/{{folder.path}}?{{ stage.query_string }}" class="button square radius expand bg-t5" data-equalizer-watch="folder">
                {{folder.name}}
            </a>
        </li>
        {% endfor %}
    </ul>
{% endif %}

{% if stage.symbols %}
    <h3> Symbols in {{ stage.path }} </h3>
    <ul class="small-block-grid-1 medium-block-grid-2 large-block-grid-4" data-equalizer="symbol">
        {% for symbol in stage.symbols %}
        <li>
            {{ gsymlib_symbol.render_symbol(symbol, stage.show_images) }}
        </li>
        {% endfor %}
    </ul>

    <!--<ul class="small-block-grid-2 medium-block-grid-4 large-block-grid-6" data-equalizer>
        {% for symbol in stage.symbols %}
        <li>
            <a href=" {{symbol.path}} " class="button square radius expand bg-t2" data-equalizer-watch>
                {{symbol.ident}}

            </a>
        </li>
        {% endfor %}
    </ul>-->
{% endif %}


{% endblock %}
