{% extends "admin/base_site.html" %}
{% load i18n admin_urls %}

{% block extrahead %}
  {{ block.super }}
  {{ media }}
{% endblock %}

{% block breadcrumbs %}
  <div class="breadcrumbs">
    <a href="{% url 'admin:index' %}">{% trans 'Home' %}</a> ›
    <a href="{% url 'admin:app_list' app_label=opts.app_label %}">{{ opts.app_config.verbose_name }}</a> ›
    <a href="{% url 'admin:ocpp_cpfirmware_changelist' %}">{{ opts.verbose_name_plural|capfirst }}</a> ›
    {% trans 'Upload EVCS firmware' %}
  </div>
{% endblock %}

{% block content %}
  <form method="post" novalidate>
    {% csrf_token %}
    <input type="hidden" name="action" value="{{ action_name }}">
    {% if select_across == "1" %}
      <input type="hidden" name="select_across" value="{{ select_across }}">
    {% endif %}
    {% for firmware_id in selected_ids %}
      <input type="hidden" name="{{ action_checkbox_name }}" value="{{ firmware_id }}">
    {% endfor %}
    {{ adminform.form.non_field_errors }}
    <div class="module aligned">
      {% for fieldset in adminform %}
        {% include "admin/includes/fieldset.html" with heading_level=2 prefix="fieldset" id_prefix=0 id_suffix=forloop.counter0 %}
      {% endfor %}
    </div>
    <div class="module">
      <h2>
        {% blocktrans count count=firmware_list|length %}
          Selected firmware ({{ count }})
        {% plural %}
          Selected firmware items ({{ count }})
        {% endblocktrans %}
      </h2>
      {% if firmware_list %}
        <ul>
          {% for firmware in firmware_list %}
            <li>{{ firmware }}</li>
          {% endfor %}
        </ul>
      {% else %}
        <p>{% trans "No firmware records selected." %}</p>
      {% endif %}
    </div>
    <div class="submit-row">
      <a href="{% url 'admin:ocpp_cpfirmware_changelist' %}" class="button cancel-link">{% trans 'Cancel' %}</a>
      <button type="submit" name="apply" class="button default">{% trans 'Upload firmware' %}</button>
    </div>
  </form>
{% endblock %}
