brittany-ferries/templates/individual_route.html

74 lines
2.1 KiB
HTML
Raw Normal View History

2022-09-03 21:38:46 +01:00
{% macro headings() %}
<tr>
2023-01-08 11:49:57 +00:00
<th>ID</th>
2022-09-03 21:38:46 +01:00
<th>day</th>
<th>depart</th>
<th>arrive</th>
2023-01-08 11:49:57 +00:00
<th>duration</th>
2022-09-03 21:38:46 +01:00
<th>ship</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) %}
2023-01-08 11:49:57 +00:00
{% for i in day.prices if i.crossingPrices.sailingId not in ("385413", "384486", "386181", "386191", "388752", "385445", "384550") %}
{% set crossing = i.crossingPrices %}
2022-09-03 21:38:46 +01:00
{# <tr><td colspan="7">{{ crossing }}</td></tr> #}
<tr>
2023-01-08 11:49:57 +00:00
<td class="text-nowrap">{{ crossing.sailingId }}</td>
2022-09-03 21:38:46 +01:00
<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>
2023-01-08 11:49:57 +00:00
<td class="text-nowrap">
{{ get_duration(crossing.departureDateTime.time, crossing.arrivalDateTime.time, time_delta) }}
</td>
2022-09-03 21:38:46 +01:00
<td class="text-nowrap">
{{ crossing.shipName }}
</td>
<td class="text-nowrap">
2023-04-16 19:56:26 +01:00
{% if crossing.economyPrice %}
2022-09-03 21:38:46 +01:00
<a href="{{ cabins_url(dep, arr, crossing, "ECONOMY") }}">
£{{ crossing.economyPrice.amount }}
</a>
2023-04-16 19:56:26 +01:00
{% else %}
n/a
{% endif %}
2022-09-03 21:38:46 +01:00
</td>
<td class="text-nowrap">
<a href="{{ cabins_url(dep, arr, crossing, "STANDARD") }}">
£{{ crossing.standardPrice.amount }}
</a>
</td>
<td class="text-nowrap">
<a href="{{ cabins_url(dep, arr, crossing, "FLEXI") }}">
£{{ crossing.flexiPrice.amount }}
</a>
</td>
2023-04-16 19:56:26 +01:00
{% if crossing.petAvailabilities %}
2023-01-08 11:49:57 +00:00
<td>
{{ format_pet_options(crossing.petAvailabilities) | join(", ") }}
</td>
2023-04-16 19:56:26 +01:00
{% endif %}
2022-09-03 21:38:46 +01:00
<td class="text-nowrap">
{% if crossing.full %}full |{% endif %}
{% if crossing.isCabinSpaceFull %}no cabin space |{% endif %}
</td>
</tr>
{% endfor %}
{% endfor %}
</table>
{% endmacro %}