brittany-ferries/templates/individual_route.html
2023-09-11 07:00:20 +01:00

78 lines
2.3 KiB
HTML

{% macro headings() %}
<tr>
<th>ID</th>
<th>day</th>
<th>depart</th>
<th>arrive</th>
<th>duration</th>
<th>ship</th>
<th>type</th>
<th>economy</th>
<th>standard</th>
<th>flexi</th>
<th></th>
</tr>
{% endmacro %}
{% macro route_table(dep, arr, days) %}
<table class="table w-auto">
{{ headings() }}
{% for day in days %}
{% set date = parse_date(day.date) %}
{% for i in day.prices if i.crossingPrices.sailingId not in ("385413", "384486", "386181", "386191", "388752", "385445", "384550") %}
{% set crossing = i.crossingPrices %}
{# <tr><td colspan="7">{{ crossing }}</td></tr> #}
<tr>
<td class="text-nowrap">{{ crossing.sailingId }}</td>
<td class="text-nowrap text-end">{{ date.strftime("%a, %d %b") }}</td>
<td class="text-nowrap">
{{ crossing.departureDateTime.time }}
</td>
<td class="text-nowrap">
{{ crossing.arrivalDateTime.time }}
</td>
<td class="text-nowrap">
{{ get_duration(crossing.departureDateTime.time, crossing.arrivalDateTime.time, time_delta) }}
</td>
<td class="text-nowrap">
{{ crossing.shipName }}
</td>
<td class="text-nowrap">
{{ crossing.shipType }}
</td>
<td class="text-nowrap">
{% if crossing.economyPrice %}
<a href="{{ cabins_url(dep, arr, crossing, "ECONOMY", rear_mounted_bike_carrier) }}">
£{{ crossing.economyPrice.amount }}
</a>
{% else %}
n/a
{% endif %}
</td>
<td class="text-nowrap">
<a href="{{ cabins_url(dep, arr, crossing, "STANDARD", rear_mounted_bike_carrier) }}">
£{{ crossing.standardPrice.amount }}
</a>
</td>
<td class="text-nowrap">
<a href="{{ cabins_url(dep, arr, crossing, "FLEXI", rear_mounted_bike_carrier) }}">
£{{ crossing.flexiPrice.amount }}
</a>
</td>
{% if crossing.petAvailabilities %}
<td>
{{ format_pet_options(crossing.petAvailabilities) | join(", ") }}
</td>
{% endif %}
<td class="text-nowrap">
{% if crossing.full %}full |{% endif %}
{% if crossing.isCabinSpaceFull %}no cabin space |{% endif %}
</td>
</tr>
{% endfor %}
{% endfor %}
</table>
{% endmacro %}