{% load i18n %}


<form action="{% url 'core:timer-add-quick' %}" role="form" method="post" class="mr-2">
    {% csrf_token %}
    {% if children.count > 1 %}
        <div class="dropdown show">
            <a class="m-0 p-0 text-success"
               title="{% trans "Quick Start Timer" %}"
               href="#"
               role="button"
               id="quick-timer-menu-toggle"
               data-bs-toggle="dropdown"
               aria-haspopup="true"
               aria-expanded="false"><i class="icon-2x icon-timer" aria-hidden="true"></i>
            </a>

            <div class="dropdown-menu dropdown-menu-end" aria-labelledby="quick-timer-menu-toggle">
                <h6 class="dropdown-header">{% trans "Quick Start Timer For…" %}</h6>
                {% for child in children %}
                    <button class="dropdown-item d-flex align-items-center" type="submit" name="child" value="{{ child.pk }}">
                        {% include "core/child_thumbnail.html" %}
                        <span class="text-wrap ms-2">{{ child }}</span>
                    </button>
                {% endfor %}
            </div>
        </div>
    {% else %}
        <label class="visually-hidden">{% trans "Quick Start Timer" %}</label>
        <button class="btn m-0 p-0 text-success">
            <i class="icon-2x icon-timer" aria-hidden="true"></i>
        </button>
    {% endif %}
</form>
