brittany-ferries/templates/individual_route.html
2023-08-10 14:05:07 +01:00

78 lines
2.2 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") }}">
£{{ crossing.economyPrice.amount }}
</a>
{% else %}
n/a
{% endif %}
</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>
{% 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 %}