diff --git a/templates/macros.html b/templates/macros.html index 96651a9..a9d7364 100644 --- a/templates/macros.html +++ b/templates/macros.html @@ -1,7 +1,7 @@ {% macro display_datetime(dt) %}{{ dt.strftime("%a, %d, %b %Y %H:%M %z") }}{% endmacro %} {% macro display_time(dt) %}{{ dt.strftime("%H:%M %z") }}{% endmacro %} -{% macro display_date(dt) %}{{ dt.strftime("%a, %d, %b %Y") }}{% endmacro %} -{% macro display_date_no_year(dt) %}{{ dt.strftime("%a, %d, %b") }}{% endmacro %} +{% macro display_date(dt) %}{{ dt.strftime("%a %-d %b %Y") }}{% endmacro %} +{% macro display_date_no_year(dt) %}{{ dt.strftime("%a %-d %b") }}{% endmacro %} {% macro conference_row(item, badge) %} {% set country = get_country(item.country) if item.country else None %} diff --git a/templates/trips.html b/templates/trips.html index 664c49e..e2c45bd 100644 --- a/templates/trips.html +++ b/templates/trips.html @@ -1,6 +1,6 @@ {% extends "base.html" %} -{% from "macros.html" import display_date_no_year, conference_row, accommodation_row, flight_row, train_row with context %} +{% from "macros.html" import display_date_no_year, display_date, conference_row, accommodation_row, flight_row, train_row with context %} {% set row = { "flight": flight_row, "train": train_row } %} @@ -38,11 +38,13 @@ {% macro section(heading, item_list, badge) %} {% if item_list %} + {% set items = item_list | list %}

{{ heading }}

- {% for trip in item_list %} +

{{ items | count }} trips

+ {% for trip in items %} {% set end = trip.end %}
-

{{ trip.title }} ({{ trip.start.strftime("%b %Y") }})

+

{{ trip.title }} ({{ display_date(trip.start) }})

Countries: {{ trip.countries_str }}
{% if end %}
Dates: {{ display_date_no_year(trip.start) }} to {{ display_date_no_year(end) }}