Compare commits

..

No commits in common. "6475692db156740d4a68de9f26b0f982bcc88f5d" and "fc36647d4950084d2307c1d9547db5f65a102a63" have entirely different histories.

3 changed files with 63 additions and 134 deletions

View file

@ -35,8 +35,6 @@ class Conference:
longitude: float | None = None longitude: float | None = None
cfp_end: date | None = None cfp_end: date | None = None
cfp_url: str | None = None cfp_url: str | None = None
free: bool | None = None
hackathon: bool | None = None
@property @property
def display_name(self) -> str: def display_name(self) -> str:

View file

@ -56,14 +56,7 @@ class Trip:
travel_end = max(arrive) if arrive else datetime.date.min travel_end = max(arrive) if arrive else datetime.date.min
assert isinstance(travel_end, datetime.date) assert isinstance(travel_end, datetime.date)
accommodation_end = ( max_date = max(max_conference_end, travel_end)
max(as_date(item["to"]) for item in self.accommodation)
if self.accommodation
else datetime.date.min
)
assert isinstance(accommodation_end, datetime.date)
max_date = max(max_conference_end, travel_end, accommodation_end)
return max_date if max_date != datetime.date.min else None return max_date if max_date != datetime.date.min else None
@property @property

View file

@ -44,7 +44,7 @@
} }
#map { #map {
height: 90vh; height: 80vh;
} }
</style> </style>
@ -53,138 +53,75 @@
{% set end = trip.end %} {% set end = trip.end %}
{% block content %} {% block content %}
<div class="row"> <div class="p-2">
<div class="col m-3"> <h1>{{ trip.title }}<small class="text-muted">({{ display_date(trip.start) }})</small></h1>
<h1>{{ trip.title }}</h1> <div>Countries: {{ trip.countries_str }}</div>
<p class="lead"> {% if end %}
{% if end %} <div>
{{ display_date_no_year(trip.start) }} to {{ display_date_no_year(end) }} Dates: {{ display_date_no_year(trip.start) }} to {{ display_date_no_year(end) }}
({{ (end - trip.start).days }} nights) ({{ (end - trip.start).days }} nights)
{% else %}
{{ display_date_no_year(trip.start) }} (end date missing)
{% endif %}
</p>
<div class="mb-3">
<div>Countries: {{ trip.countries_str }}</div>
{% set delta = human_readable_delta(trip.start) %}
{% if delta %}
<div>How long until trip: {{ delta }}</div>
{% endif %}
</div> </div>
{% else %}
<div>Start: {{ display_date_no_year(trip.start) }} (end date missing)</div>
{% endif %}
{% for item in trip.conferences %} {% set delta = human_readable_delta(trip.start) %}
{% set country = get_country(item.country) if item.country else None %} {% if delta %}
<div class="card my-1"> <div>{{ delta }} time</div>
<div class="card-body"> {% endif %}
<h5 class="card-title">
<a href="{{ item.url }}">{{ item.name }}</a>
<small class="text-muted">
{{ display_date_no_year(item.start) }} to {{ display_date_no_year(item.end) }}
</small>
</h5>
<p class="card-text">
Topic: {{ item.topic }}
| Venue: {{ item.venue }}
| Location: {{ item.location }}
{% if country %}
{{ country.flag }}
{% elif item.online %}
💻 Online
{% else %}
<span class="text-bg-danger p-2">
country code <strong>{{ item.country }}</strong> not found
</span>
{% endif %}
{% if item.free %}
| <span class="badge bg-success text-nowrap">free to attend</span>
{% elif item.price and item.currency %}
| <span class="badge bg-info text-nowrap">price: {{ item.price }} {{ item.currency }}</span>
{% endif %}
</p>
</div>
</div>
{% endfor %}
{% for item in trip.accommodation %} <div class="conferences">
{% set country = get_country(item.country) if item.country else None %} {% for conf in trip.conferences %} {{ conference_row(conf, "going") }} {% endfor %}
{% set nights = (item.to.date() - item.from.date()).days %}
<div class="card my-1">
<div class="card-body">
<h5 class="card-title">
{% if item.operator %}{{ item.operator }}: {% endif %}
<a href="{{ item.url }}">{{ item.name }}</a>
<small class="text-muted">
{{ display_date_no_year(item.from) }} to {{ display_date_no_year(item.to) }}
({% if nights == 1 %}1 night{% else %}{{ nights }} nights{% endif %})
</small>
</h5>
<p class="card-text">
Address: {{ item.address }}
| Location: {{ item.location }}
{% if country %}
{{ country.flag }}
{% elif item.online %}
💻 Online
{% else %}
<span class="text-bg-danger p-2">
country code <strong>{{ item.country }}</strong> not found
</span>
{% endif %}
{% if item.price and item.currency %}
| <span class="badge bg-info text-nowrap">price: {{ item.price }} {{ item.currency }}</span>
{% endif %}
</p>
</div>
</div>
{% endfor %}
<div class="travel">
{% for item in trip.travel %} {{ row[item.type](item) }} {% endfor %}
</div>
<div class="mt-3">
<h4>Holidays</h4>
{% if holidays %}
<table class="table table-hover w-auto">
{% for item in holidays %}
{% set country = get_country(item.country) %}
<tr>
{% if loop.first or item.date != loop.previtem.date %}
<td class="text-end">{{ display_date(item.date) }}</td>
{% else %}
<td></td>
{% endif %}
<td>{{ country.flag }} {{ country.name }}</td>
<td>{{ item.display_name }}</td>
</tr>
{% endfor %}
</table>
{% else %}
<p>No public holidays during trip.</p>
{% endif %}
</div>
<p>
{% if prev_trip %}
previous: {{ trip_link(prev_trip) }} ({{ (trip.start - prev_trip.end).days }} days)
{% endif %}
{% if next_trip %}
next: {{ trip_link(next_trip) }} ({{ (next_trip.start - trip.end).days }} days)
{% endif %}
</p>
</div>
<div class="col">
<div id="map"></div>
</div> </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>
{% if holidays %}
<div class="mt-3">
<h4>Holidays</h4>
<table class="table table-hover w-auto">
{% for item in holidays %}
{% set country = get_country(item.country) %}
<tr>
{% if loop.first or item.date != loop.previtem.date %}
<td class="text-end">{{ display_date(item.date) }}</td>
{% else %}
<td></td>
{% endif %}
<td>{{ country.flag }} {{ country.name }}</td>
<td>{{ item.display_name }}</td>
</tr>
{% endfor %}
</table>
</div>
{% endif %}
<p>
{% if prev_trip %}
previous: {{ trip_link(prev_trip) }} ({{ (trip.start - prev_trip.end).days }} days)
{% endif %}
{% if next_trip %}
next: {{ trip_link(next_trip) }} ({{ (next_trip.start - trip.end).days }} days)
{% endif %}
</p>
{% if coordinates %}
<div id="map"></div>
{% endif %}
</div> </div>
{% endblock %} {% endblock %}
{% block scripts %} {% block scripts %}
{% if coordinates %}
<script src="https://unpkg.com/leaflet@1.9.4/dist/leaflet.js" <script src="https://unpkg.com/leaflet@1.9.4/dist/leaflet.js"
integrity="sha256-20nQCchB9co0qIjJZRGuk2/Z9VM+kNiyxNV1lvTlZBo=" integrity="sha256-20nQCchB9co0qIjJZRGuk2/Z9VM+kNiyxNV1lvTlZBo="
crossorigin=""></script> crossorigin=""></script>
@ -200,4 +137,5 @@ var routes = {{ routes | tojson }};
build_map("map", coordinates, routes); build_map("map", coordinates, routes);
</script> </script>
{% endif %}
{% endblock %} {% endblock %}