{% extends "ui/report_base.html" %}
{% load url from future %}
{% load icons %}
{% load formats %}
{% load bob %}

{% block contentarea %}
    <div class="row-fluid">
        <div class="span12 form-actions">
            <div class="span6 reports-form-right-line">
                <h4>Cross filtering</h4>
                <p>Use this report when you want to filter devices list by some parameters.</p>
                <form class="form" method="get">
                    {% for f in form_choice %}
                        <div class="control-group">
                            {{ f }} {{ f.label }}
                        </div>
                    {% endfor %}
                    <button class="btn pull-right"><i class="fugue-icon fugue-calculator"></i>&nbsp;Show</button>
                </form>
            </div>
            <div class="span6">
                <h4>Filtering by the expiration date</h4>
                <p>Use this report when you want to filter devices list by date range of Support, Warranty or Deprecation.</p>
                <h5>Support</h5>
                <form class="form-inline" method="get">
                    <div class="span12">
                        {% for f in form_support_range %}
                            <div class="span4 control-group {% if f.errors %}error{% endif %}">
                                <label class="control-label">{{ f.label }}</label>
                                {{ f }}
                                {% for e in f.errors %}
                                    <div class="help-block">{{ e }}</div>
                                {% endfor %}
                            </div>
                        {% endfor %}
                        <div class="span4">
                            <button class="btn pull-right"><i class="fugue-icon fugue-calculator"></i>&nbsp;Show</button>
                        </div>
                    </div>
                </form>
                <h5>Warranty</h5>
                <form class="form-inline" method="get">
                    <div class="span12">
                        {% for f in form_warranty_range %}
                            <div class="span4 control-group {% if f.errors %}error{% endif %}">
                                <label class="control-label">{{ f.label }}</label>
                                {{ f }}
                                {% for e in f.errors %}
                                    <div class="help-block">{{ e }}</div>
                                {% endfor %}
                            </div>
                        {% endfor %}
                        <div class="span4">
                            <button class="btn pull-right"><i class="fugue-icon fugue-calculator"></i>&nbsp;Show</button>
                        </div>
                    </div>
                </form>
                <h5>Deprecation</h5>
                <form class="form-inline" method="get">
                    <div class="span12">
                        {% for f in form_deprecation_range %}
                            <div class="span4 control-group {% if f.errors %}error{% endif %}">
                                <label class="control-label">{{ f.label }}</label>
                                {{ f }}
                                {% for e in f.errors %}
                                    <div class="help-block">{{ e }}</div>
                                {% endfor %}
                            </div>
                        {% endfor %}
                        <div class="span4">
                            <button class="btn pull-right"><i class="fugue-icon fugue-calculator"></i>&nbsp;Show</button>
                        </div>
                    </div>
                </form>
            </div>
            <div class="span6">
                <h4>Show all devices</h4>
                <p>Use this report when you want see all active or deleted devices.</p>
                <form class="form" method="get">
                    {% for f in form_device_list %}
                        <div class="control-group">
                            {{ f }} {{ f.label }}
                        </div>
                    {% endfor %}
                    <button class="btn pull-right"><i class="fugue-icon fugue-calculator"></i>&nbsp;Show</button>
                </form>
            </div>
        </div>
    </div>
    <div class="row-fluid">
        <div class="span12">
            {% if rows %}
                {% include 'ui/report_devices_table.html' with title=title header=tabele_header rows=rows csv_url=csv_url %}
            {% else %}
                No results...
            {% endif %}
        </div>
    </div>
{% endblock %}