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

{% block heading %}{% trans 'Available firmwares' %}{% endblock %}

{% block subcontent %}
    <a class="button" href="{% url "mesh.firmwares.current" %}">
        {% trans 'View current firmwares' %}
    </a>

    {% include 'control/fragment_pagination.html' %}

    <table>
        <tr>
            <th>{% trans 'Created' %}</th>
            <th>{% trans 'Uploader' %}</th>
            <th>{% trans 'Firmware' %}</th>
            <th>{% trans 'IDF version' %}</th>
            <th>{% trans 'Builds' %}</th>
        </tr>
        {% for firmware in firmwares %}
            <tr>
                <td>{{ firmware.created }}</td>
                <td>{{ firmware.uploader }}</td>
                <td>
                    <a href="{% url "mesh.firmwares.detail" pk=firmware.pk %}">
                        {{ firmware.project_name }} {{ firmware.version }}
                    </a>
                </td>
                <td>{{ firmware.idf_version }}</td>
                <td>
                    {% for build in firmware.builds.all %}
                        <a href="{% url "mesh.firmwares.build.detail" pk=build.pk %}">
                            {{ build.variant }} ({{ build.get_chip_display }})
                        </a><br>
                    {% endfor %}
                </td>
            </tr>
        {% endfor %}

    </table>

    {% include 'control/fragment_pagination.html' %}
{% endblock %}
