diff --git a/agenda/conference.py b/agenda/conference.py index 19e77bf..24ed552 100644 --- a/agenda/conference.py +++ b/agenda/conference.py @@ -35,8 +35,6 @@ class Conference: longitude: float | None = None cfp_end: date | None = None cfp_url: str | None = None - free: bool | None = None - hackathon: bool | None = None @property def display_name(self) -> str: diff --git a/agenda/types.py b/agenda/types.py index a96eff3..4bcfa5b 100644 --- a/agenda/types.py +++ b/agenda/types.py @@ -56,14 +56,7 @@ class Trip: travel_end = max(arrive) if arrive else datetime.date.min assert isinstance(travel_end, datetime.date) - accommodation_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) + max_date = max(max_conference_end, travel_end) return max_date if max_date != datetime.date.min else None @property diff --git a/templates/trip_page.html b/templates/trip_page.html index a9bf8a8..a7a6169 100644 --- a/templates/trip_page.html +++ b/templates/trip_page.html @@ -44,7 +44,7 @@ } #map { - height: 90vh; + height: 80vh; } @@ -53,138 +53,75 @@ {% set end = trip.end %} {% block content %} -
-
-

{{ trip.title }}

-

- {% if end %} - {{ display_date_no_year(trip.start) }} to {{ display_date_no_year(end) }} - ({{ (end - trip.start).days }} nights) - {% else %} - {{ display_date_no_year(trip.start) }} (end date missing) - {% endif %} -

- -
-
Countries: {{ trip.countries_str }}
- - {% set delta = human_readable_delta(trip.start) %} - {% if delta %} -
How long until trip: {{ delta }}
- {% endif %} +
+

{{ 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) }} + ({{ (end - trip.start).days }} nights)
+ {% else %} +
Start: {{ display_date_no_year(trip.start) }} (end date missing)
+ {% endif %} - {% for item in trip.conferences %} - {% set country = get_country(item.country) if item.country else None %} -
-
-
- {{ item.name }} - - {{ display_date_no_year(item.start) }} to {{ display_date_no_year(item.end) }} - -
-

- Topic: {{ item.topic }} - | Venue: {{ item.venue }} - | Location: {{ item.location }} - {% if country %} - {{ country.flag }} - {% elif item.online %} - 💻 Online - {% else %} - - country code {{ item.country }} not found - - {% endif %} - {% if item.free %} - | free to attend - {% elif item.price and item.currency %} - | price: {{ item.price }} {{ item.currency }} - {% endif %} -

-
-
- {% endfor %} + {% set delta = human_readable_delta(trip.start) %} + {% if delta %} +
{{ delta }} time
+ {% endif %} - {% for item in trip.accommodation %} - {% set country = get_country(item.country) if item.country else None %} - {% set nights = (item.to.date() - item.from.date()).days %} -
-
-
- {% if item.operator %}{{ item.operator }}: {% endif %} - {{ item.name }} - - {{ display_date_no_year(item.from) }} to {{ display_date_no_year(item.to) }} - ({% if nights == 1 %}1 night{% else %}{{ nights }} nights{% endif %}) - -
-

- Address: {{ item.address }} - | Location: {{ item.location }} - {% if country %} - {{ country.flag }} - {% elif item.online %} - 💻 Online - {% else %} - - country code {{ item.country }} not found - - {% endif %} - {% if item.price and item.currency %} - | price: {{ item.price }} {{ item.currency }} - {% endif %} -

-
-
- {% endfor %} - -
- {% for item in trip.travel %} {{ row[item.type](item) }} {% endfor %} -
- -
-

Holidays

- {% if holidays %} - - - {% for item in holidays %} - {% set country = get_country(item.country) %} - - {% if loop.first or item.date != loop.previtem.date %} - - {% else %} - - {% endif %} - - - - {% endfor %} -
{{ display_date(item.date) }}{{ country.flag }} {{ country.name }}{{ item.display_name }}
- {% else %} -

No public holidays during trip.

- {% endif %} -
- -

- {% 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 %} -

- -
-
-
+
+ {% for conf in trip.conferences %} {{ conference_row(conf, "going") }} {% endfor %}
+ +
+ {% for conf in trip.accommodation %} {{ accommodation_row(conf, "going") }} {% endfor %} +
+ +
+ {% for item in trip.travel %} {{ row[item.type](item) }} {% endfor %} +
+ + {% if holidays %} +
+

Holidays

+ + + {% for item in holidays %} + {% set country = get_country(item.country) %} + + {% if loop.first or item.date != loop.previtem.date %} + + {% else %} + + {% endif %} + + + + {% endfor %} +
{{ display_date(item.date) }}{{ country.flag }} {{ country.name }}{{ item.display_name }}
+
+ {% endif %} + +

+ {% 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 %} +

+ + {% if coordinates %} +
+ {% endif %} +
{% endblock %} {% block scripts %} +{% if coordinates %} @@ -200,4 +137,5 @@ var routes = {{ routes | tojson }}; build_map("map", coordinates, routes); +{% endif %} {% endblock %}