{% extends 'mesh/base.html' %}
{% load i18n mesh_node %}

{% block heading %}{% trans 'Mesh' %}{% endblock %}

{% block subcontent %}
    <h4>{% trans 'Firmware Build' %}</h4>

    <div class="columns">
        <div>

            <p>
                <strong>Project name:</strong> {{ build.version.project_name }}<br>
                <strong>Version:</strong> <a href="{% url 'mesh.firmwares.detail' pk=build.version.pk %}">{{ build.version.version }}</a><br>
                <strong>IDF Version:</strong> {{ build.version.idf_version }}<br>
                <strong>Uploader:</strong> {{ build.version.uploader }}<br>
                <strong>Created:</strong> {{ build.version.created }}<br>
            </p>
            <p>
                <strong>Variant:</strong> {{ build.variant }}<br>
                <strong>Chip:</strong> {{ build.get_chip_display }}
                <small>
                    >=rev{{ build.firmware_image.ext_header.min_chip_rev.0 }}.{{ build.firmware_image.ext_header.min_chip_rev.1 }}
                    <=rev{{ build.firmware_image.ext_header.max_chip_rev.0 }}.{{ build.firmware_image.ext_header.max_chip_rev.1 }}
                </small>
                <br>
                <strong>Flash:</strong> {{ build.firmware_image.header.flash_stuff.display }}<br>
                <strong>SPI Flash Mode:</strong> {{ build.firmware_image.header.spi_flash_mode.name }}<br>
                <strong>App ELF SHA256:</strong> <small>{{ build.sha256_hash }}</small><br>
            </p>
            <p>
                <strong>Binary Size:</strong> {{ build.binary.size|filesizeformat }} ({{ build.binary.size }} bytes)<br>
                <strong>Download:</strong> <a href="{{ build.binary.url }}">Click HERE for free download</a>
            </p>
            <h4>Compatible boards:</h4>
            <ul>
                {% for board in build.boards %}
                    <li>{{ board.pretty_name }}</li>
                {% endfor %}
            </ul>
        </div>
        <div>
            {% include "mesh/fragment_ota_form.html" %}
        </div>
    </div>
{% endblock %}
