agenda/templates/trips.html

76 lines
1.9 KiB
HTML
Raw Normal View History

2024-01-04 22:57:05 +00:00
{% extends "base.html" %}
2024-01-05 09:35:56 +00:00
{% from "macros.html" import display_date_no_year, conference_row, accommodation_row, flight_row, train_row with context %}
2024-01-04 22:57:05 +00:00
{% block style %}
{% set conference_column_count = 6 %}
{% set accommodation_column_count = 7 %}
{% set travel_column_count = 7 %}
<style>
.conferences {
display: grid;
grid-template-columns: repeat({{ conference_column_count }}, auto); /* 7 columns for each piece of information */
gap: 10px;
justify-content: start;
}
.accommodation {
display: grid;
grid-template-columns: repeat({{ accommodation_column_count }}, auto);
gap: 10px;
justify-content: start;
}
.travel {
display: grid;
grid-template-columns: repeat({{ travel_column_count }}, auto);
gap: 10px;
justify-content: start;
}
.grid-item {
/* Additional styling for grid items can go here */
}
</style>
{% endblock %}
{% block content %}
<div class="p-2">
{% set row = { "flight": flight_row, "train": train_row } %}
<h1>Trips</h1>
{% for trip in trips %}
2024-01-05 09:35:56 +00:00
{% set end = trip.end %}
2024-01-04 22:57:05 +00:00
<div class="border border-2 rounded mb-2 p-2">
2024-01-05 09:35:56 +00:00
<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 %}
2024-01-04 22:57:05 +00:00
<div class="conferences">
{% for conf in trip.conferences %}
{{ conference_row(conf, "going") }}
{% endfor %}
</div>
<div class="accommodation">
{% for conf in trip.accommodation %}
{{ accommodation_row(conf, "going") }}
{% endfor %}
</div>
<div class="travel">
{% for item in trip.travel %}
{{ row[item.type](item) }}
{% endfor %}
</div>
</div>
{% endfor %}
</div>
{% endblock %}