{## # @file status_table_body.html # Copyright (C) 2015 Pressa. All rights reserved. #} {% set ctime = date().timestamp %} {% for status in statusData %} {## Set css clas for datetime #} {% set difDatetime = ctime - status['datetime'] %} {% if difDatetime <= 1800 %} {% set datetimeClass = 'bg-success' %} {% endif %} {% if difDatetime > 1800 and difDatetime <= 5400 %} {% set datetimeClass = 'bg-warning' %} {% endif %} {% if difDatetime > 5400 %} {% set datetimeClass = 'bg-danger' %} {% endif %} {## Set css class for timestamp #} {% set difTimestamp = ctime - status['timestamp'] %} {% if difTimestamp <= 1800 %} {% set timestampClass = 'bg-success' %} {% endif %} {% if difTimestamp > 1800 and difTimestamp <= 5400 %} {% set timestampClass = 'bg-warning' %} {% endif %} {% if difTimestamp > 5400 %} {% set timestampClass = 'bg-danger' %} {% endif %} {{ status['name'] }} {{ status['alias'] }} {{ status['licensePlate'] }} {{ status['companyName'] }} {{ status['datetime'] |date("d/m/Y H:i:s") }} {{ status['timestamp'] |date("d/m/Y H:i:s") }} {{status['age']}} {{ status['gpsId'] }} {% if status['status'] > 0 %} {{ lang['dashboard']['status']['table']['status_types'][status['status']] }} {% else %} {{ lang['dashboard']['status']['table']['status_types'][status['status']] }} {% endif %} {% if status['wait'] > 0 and status['wait'] > ctime %} {{ status['wait']|date("d/m/Y H:i:s") }} {% else %} - {% endif %} {% endfor %}