{% extends 'base.html.twig' %} {% import 'components/json_display.html.twig' as jsonDisplay %} {% import 'components/datalogger_tabs.html.twig' as tabs %} {% block title %}Trip Details - {{ tripId }}{% endblock %} {% block stylesheets %} {{ parent() }} {% endblock %} {% block content %} {% set tdRaw = tripDetails ?? {} %} {% set td = tdRaw.trip ?? tdRaw.data ?? tdRaw %} {% set routePoints = td.route is defined and td.route is iterable ? td.route : [] %} {% set startLat = td.start_lat ?? null %} {% set startLon = td.start_lon ?? null %} {% set endLat = td.end_lat ?? null %} {% set endLon = td.end_lon ?? null %} {% set startTime = td.start_datetime ?? td.start_time ?? null %} {% set endTime = td.end_datetime ?? td.end_time ?? null %} {% set durationMin = td.duration_minutes ?? td.duration ?? null %} {% set distanceKm = td.total_distance_km ?? td.distance ?? null %} {% set avgSpeed = td.avg_speed_kmh ?? null %} {% set maxSpeed = td.max_speed_kmh ?? null %} {% set pointCount = td.point_count ?? null %} {% set stopCount = td.stop_count ?? null %} {% if datalogger is defined %} {{ tabs.renderTabs(datalogger, 'app_trips') }} {% endif %}
{% if td.error is defined %}
Fehler: {{ td.error }}
{% else %}

Trip-Übersicht

{% if distanceKm is not null %}
{{ distanceKm|number_format(2) }} km Distanz
{% endif %} {% if durationMin is not null %}
{{ durationMin|number_format(1) }} min Dauer
{% endif %} {% if avgSpeed is not null %}
{{ avgSpeed|number_format(1) }} km/h Ø Geschwindigkeit
{% endif %} {% if maxSpeed is not null %}
{{ maxSpeed|number_format(1) }} km/h Max. Geschwindigkeit
{% endif %} {% if pointCount is not null %}
{{ pointCount }} Route-Punkte
{% endif %} {% if stopCount is not null %}
{{ stopCount }} Stops
{% endif %}

Start & Ziel

Start {% if startTime %} {% if startTime matches('/^-?[0-9]+(?:\\.[0-9]+)?$/') %} {{ startTime|round|date('d.m.Y H:i:s') }} {% else %} {{ startTime }} {% endif %} {% else %} - {% endif %} {% if startLat is not null and startLon is not null %} {{ startLat|number_format(6) }}, {{ startLon|number_format(6) }} {% else %} Keine Koordinaten {% endif %}
Ziel {% if endTime %} {% if endTime matches('/^-?[0-9]+(?:\\.[0-9]+)?$/') %} {{ endTime|round|date('d.m.Y H:i:s') }} {% else %} {{ endTime }} {% endif %} {% else %} - {% endif %} {% if endLat is not null and endLon is not null %} {{ endLat|number_format(6) }}, {{ endLon|number_format(6) }} {% else %} Keine Koordinaten {% endif %}
{% if startLat is not null and startLon is not null %} Start auf Karte {% endif %} {% if endLat is not null and endLon is not null %} Ziel auf Karte {% endif %}
{% if routePoints|length > 1 %}

Route

{% endif %}

Rohdaten (Debug)

JSON anzeigen
{{ jsonDisplay.displayJson(tdRaw, null) }}
{% endif %}
{% endblock %} {% block javascripts %} {{ parent() }} {% set tdRawJs = tripDetails ?? {} %} {% set tdJs = tdRawJs.trip ?? tdRawJs.data ?? tdRawJs %} {% set routePointsJs = tdJs.route is defined and tdJs.route is iterable ? tdJs.route : [] %} {% if routePointsJs|length > 1 %} {% endif %} {% endblock %}