{% extends "base.html" %} {% load i18n %} {% load static %} {% load rules %} {% block title %}{% trans 'Routes Information' %} {% endblock %} {% block extrahead %} {% load leaflet_tags %} {% leaflet_css %} {% endblock %} {% block content %} {% has_perm 'sous_chef.edit' request.user as can_edit_data %} {% include 'kitchen_count_steps.html' with step='routes' %}
{% trans 'Route Sheets' %}
{% for route, order_count, has_organised, delivery_history in route_details %}
{% if order_count == 0 %} {# This route has no orders. No need to display useless buttons. #} {% elif has_organised == 'no' %} {# The delivery history instance doesn't exist yet. #}
{% csrf_token %} {% trans 'Route sheet' %}
{% elif has_organised == 'invalid' %} {# The client sequence of the delivery history doesn't match the orders. #} {% trans 'Modified' %} {% trans 'Route sheet' %} {% else %} {# Configured. #} {% trans 'Organised' %} {% trans 'Route sheet' %} {% endif %}
{{ route.name }}
{% if delivery_history.vehicle == 'cycling' or route.vehicle == 'cycling' %} {% elif delivery_history.vehicle == 'driving' or route.vehicle == 'driving' %} {% elif delivery_history.vehicle == 'walking' or route.vehicle == 'walking' %} {% endif %}
{{ order_count }}
{% endfor %}
{% if can_edit_data %} {% trans "Back" %} {% endif %} {% endblock %} {% block extrajs %} {% leaflet_js %} {% if debug %} {% else %} {% endif %} {% endblock %}