{% load i18n %}
{% load lfs_tags %}

<form action="{% url lfs_set_order_filter %}"
      method="post">

    <input type="hidden" name="came-from" value="order" />
    <input type="hidden" name="order-id" value="{{ current_order.id }}" />

    <table class="filters">
        <tr>
            <td></td>
            <td class="discreet">{% trans "Start" %}</td>
            <td class="discreet">{% trans "End" %}</td>
            <td class="discreet">{% trans "Name" %}</td>
            <td class="discreet">{% trans "State" %}</td>
        </tr>
        <tr>
            <td>
                <a href="{% url lfs_set_order_filters_date %}?came-from=order&amp;order-id={{ current_order.id }}&amp;start=0&amp;end=0"
                   class="ajax-link" title="{% trans "Today" %}">T</a>
                <a href="{% url lfs_set_order_filters_date %}?came-from=order&amp;order-id={{ current_order.id }}&amp;start=1&amp;end=1"
                   class="ajax-link" title="{% trans "Yesterday" %}">Y</a>
                <a href="{% url lfs_set_order_filters_date %}?came-from=order&amp;order-id={{ current_order.id }}&amp;start=7&amp;end=0"
                   class="ajax-link" title="{% trans "Week" %}">W</a>
            </td>
            <td>

                <input class="date-picker"
                       type="text"
                       name="start"
                       value="{{ start }}">
            </td>
            <td>

                <input class="date-picker"
                       type="text"
                       name="end"
                       value="{{ end }}">
            </td>
            <td>
                <input type="text"
                       name="name"
                       value="{{ name }}">
            </td>
            <td>
                <select id="states-filter"
                        class="ajax-change"
                        name="state">
                    <option value="">{% trans "All" %}</option>
                    {% for state in states %}
                        <option value="{{ state.id }}"
                                {% if state.selected_filter %}selected="selected"{% endif %}>
                            {{ state.name }}
                        </option>
                    {% endfor %}
                </select>

                <input type="submit"
                       class="ajax-save-button" />

                <a href="{% url lfs_reset_order_filters %}?came-from=order;order-id={{ current_order.id }}"
                   class="ajax-link reset">&nbsp;</a>
            </td>
        </tr>
    </table>
</form>

