{% comment %}
Render a navigation menu for dates

Context:
- url_name: url name
- date: current date
- input_type: date input type
- dates: dates to display as a list of `(date|None, title|None)`.

An empty date results to a title or a separator
{% endcomment %}
{% load i18n %}

<div class="navbar-menu" role="menu"
        aria-label="{% trans "pick a date" %}">
    <div class="navbar-start">
        {% for day in dates %}
        <a href="{% url url_name date=day %}" class="navbar-item {% if day == date %}is-active{% endif %}">
            {{ day|date:"D. d" }}
            </a>
        {% endfor %}
    </div>

    <div class="navbar-end">
        <div class="navbar-item">
            <form action="{% url url_name %}" method="GET" class="navbar-body"
                    aria-label="{% trans "Jump to date" %}">
                <div class="field has-addons">
                    <div class="control has-icons-left">
                        <span class="icon is-small is-left"><span class="far fa-calendar"></span></span>
                        <input type="{{ date_input|default:"date" }}" class="input date"
                               name="date" value="{{ date|date:"Y-m-d" }}">
                    </div>
                    <div class="control">
                        <button class="button is-primary">{% trans "Go" %}</button>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>


