{%- import "route_symbol.html" as scope -%}
{% call scope::route_symbol(route) %} {% endcall %}

{{ route.name }}

{% for timetable in timetables %}

{{ timetable.direction.direction | capitalize }} to

{{ timetable.direction.direction_destination }}

{% for trip_id in timetable.trip_ids %} {% if let Some(next_id_v) = timetable.next_id %} {% if next_id_v == trip_id %} {% endfor %} {% for row in timetable.rows %} {% if let Some(filter_stop_v) = filter_stops %} {% if !filter_stop_v.contains(&row.stop_id) %} {% continue %} {% endif %} {% endif %} {% for time in row.times %} {% if let Some(t) = time %} {% let live_o = timetable.tracking_data[loop.index0] %} {% if let Tracked(live) = live_o %} {% let time = (t + (live.delay * 60.0) as i64) %} {% elif let TripTracking::Cancelled = live_o %} {% else %} {% endif %} {% else %} {% endif %} {% endfor %} {% endfor %}
Stop {% else %} {% endif %} {% else %} {% endif %} {{ trip_id }}
{{ row.stop_name }} {{ time | format_time }} {{ t | format_time }}{{ t | format_time }}
{% endfor %}