Compare commits

..

2 commits

Author SHA1 Message Date
Edward Betts 8181dfbe3b Remove unused code from trip list HTML 2024-05-20 18:33:53 +02:00
Edward Betts a96aefe22b Improve trip list template 2024-05-20 18:32:49 +02:00

View file

@ -8,35 +8,7 @@
<link rel="stylesheet" href="{{ url_for("static", filename="leaflet/leaflet.css") }}"> <link rel="stylesheet" href="{{ url_for("static", filename="leaflet/leaflet.css") }}">
{% set conference_column_count = 8 %}
{% set accommodation_column_count = 8 %}
{% set travel_column_count = 10 %}
<style> <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 */
}
body, html { body, html {
height: 100%; height: 100%;
margin: 0; margin: 0;
@ -72,7 +44,6 @@
overflow-y: auto; overflow-y: auto;
} }
} }
</style> </style>
{% endblock %} {% endblock %}
@ -116,6 +87,35 @@
{% endfor %} {% endfor %}
{% endif %} {% endif %}
{{ conference_list(trip) }}
{% for day, elements in trip.elements_grouped_by_day() %}
<h4>{{ display_date_no_year(day) }}</h4>
{% set accommodation_label = {"check-in": "check-in from", "check-out": "check-out by"} %}
{% for e in elements %}
{% if e.element_type in accommodation_label %}
{% set c = get_country(e.detail.country) %}
<div>
{{ e.get_emoji() }} {{ e.title }} {{ c.flag }}
({{ accommodation_label[e.element_type] }} {{ display_time(e.when) }})
</div>
{% else %}
<div>
{{ e.get_emoji() }}
{{ display_time(e.when) }}
&ndash;
{{ e.title }}
</div>
{% endif %}
{% endfor %}
{% endfor %}
</div>
{% endfor %}
{% endif %}
{% endmacro %}
{% macro conference_list(trip) %}
{% for item in trip.conferences %} {% for item in trip.conferences %}
{% set country = get_country(item.country) if item.country else None %} {% set country = get_country(item.country) if item.country else None %}
<div class="card my-1"> <div class="card my-1">
@ -149,31 +149,7 @@
</div> </div>
{% endfor %} {% endfor %}
{% set date_heading = None %}
{% for day, elements in trip.elements_grouped_by_day() %}
<h4>{{ display_date_no_year(day) }}</h4>
{% set accommodation_label = {"check-in": "check-in from", "check-out": "check-out by"} %}
{% for e in elements %}
{% if e.element_type in accommodation_label %}
{% set c = get_country(e.detail.country) %}
<div>
{{ e.get_emoji() }} {{ e.title }} {{ c.flag }}
({{ accommodation_label[e.element_type] }} {{ display_time(e.when) }})
</div>
{% else %}
<div>
{{ e.get_emoji() }}
{{ display_time(e.when) }}
&ndash;
{{ e.title }}
</div>
{% endif %}
{% endfor %}
{% endfor %}
</div>
{% endfor %}
{% endif %}
{% endmacro %} {% endmacro %}