{% extends "base.html" %}

{% set active_page = "Database" %}

{% block body %}


<div class="row justify-content-center">

    <div class="col-xl-6 col-lg-8 col-md-10 mt-4">
        <h3 class="mb-3">Search Firmware Database</h3>
        <form class="form-horizontal" action="" method=post enctype=multipart/form-data>

        <div class="form-row">
            <div class="form-group col-md-6">
                <label class="control-label" for="device_class">Device Class:</label>
                <select class="form-control" name='device_class_dropdown' id="device_class">
                    <option value=''></option>
                    {% for class in device_classes | sort %}
                        <option value='{{ class }}'>{{ class }}</option>
                    {% endfor %}
                </select>
            </div>

            <div class="form-group col-md-6">
                <label class="control-label" for="device_class">Vendor:</label>
                <select class="form-control" name='vendor' id="vendor">
                    <option value=''></option>
                    {% for vendor in vendors | sort %}
                        <option value='{{ vendor }}'>{{ vendor }}</option>
                    {% endfor %}
                </select>
            </div>
        </div>

            {% set input_form_text = [
                ("File Name", "file_name"),
                ("Device Name", "device_name"),
                ("Firmware Version", "version"),
                ("Release Date", "release_date"),
                ("Hash", "hash_value")
            ] -%}
            {% for label, id in input_form_text %}
            <div class="form-group">
                <label class="control-label" for="{{ id }}">{{ label }}:</label>
                <input type="text" name="{{ id }}" class="form-control" id="{{ id }}" placeholder="{{ label }}">
            </div>
            {% endfor %}

            <button type="submit" value=submit class="btn btn-primary" id="input_submit" onclick='showImg()'>
                <i class="fas fa-search"></i> Search
            </button>

        </form>
    </div>
</div>

{% endblock %}