Show end date for trips

This commit is contained in:
Edward Betts 2024-01-05 09:35:56 +00:00
parent ea33722f69
commit 21b67bdc64
4 changed files with 67 additions and 45 deletions

View file

@ -1,5 +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 conference_row(item, badge) %}
{% set country = get_country(item.country) if item.country else None %}

View file

@ -1,6 +1,6 @@
{% extends "base.html" %}
{% from "macros.html" import conference_row, accommodation_row, flight_row, train_row with context %}
{% from "macros.html" import display_date_no_year, conference_row, accommodation_row, flight_row, train_row with context %}
{% block style %}
{% set conference_column_count = 6 %}
@ -41,9 +41,15 @@
<h1>Trips</h1>
{% for trip in trips %}
{% set end = trip.end %}
<div class="border border-2 rounded mb-2 p-2">
<h4>{{ trip.title }}</h4>
<p>Countries: {{ trip.countries_str }}</p>
<h3>{{ trip.title }} <small class="text-muted">({{ trip.start.strftime("%b %Y") }})</small></h3>
<div>Countries: {{ trip.countries_str }}</div>
{% if end %}
<div>Dates: {{ display_date_no_year(trip.start) }} to {{ display_date_no_year(end) }}</div>
{% else %}
<div>Start: {{ display_date_no_year(trip.start) }} (end date missing)</div>
{% endif %}
<div class="conferences">
{% for conf in trip.conferences %}
{{ conference_row(conf, "going") }}