From 9f1f64708fb1db910a7b2ca4097fbaf534bfc358 Mon Sep 17 00:00:00 2001 From: Edward Betts Date: Thu, 31 Oct 2024 08:27:40 +0000 Subject: [PATCH] Remove old unused code. --- templates/trip_list.html | 138 --------------------------------------- web_view.py | 35 ---------- 2 files changed, 173 deletions(-) delete mode 100644 templates/trip_list.html diff --git a/templates/trip_list.html b/templates/trip_list.html deleted file mode 100644 index 8a497f9..0000000 --- a/templates/trip_list.html +++ /dev/null @@ -1,138 +0,0 @@ -{% extends "base.html" %} - -{% from "macros.html" import trip_link, display_date_no_year, display_date, conference_row, accommodation_row, flight_row, train_row, ferry_row with context %} - -{% set row = { "flight": flight_row, "train": train_row, "ferry": ferry_row } %} - -{% block title %}Trips - Edward Betts{% endblock %} - -{% block style %} - - - -{% set conference_column_count = 8 %} -{% set accommodation_column_count = 8 %} -{% set travel_column_count = 10 %} - -{% endblock %} - -{% macro section(heading, item_list, badge) %} - {% if item_list %} - {% set items = item_list | list %} -

{{ heading }}

-

{{ items | count }} trips

- {% for trip in items %} - {% set total_distance = trip.total_distance() %} - {% set end = trip.end %} -
-

- {{ trip_link(trip) }} - ({{ display_date(trip.start) }})

-
Countries: {{ trip.countries_str }}
- {% if end %} -
Dates: {{ display_date_no_year(trip.start) }} to {{ display_date_no_year(end) }}
- {% else %} -
Start: {{ display_date_no_year(trip.start) }} (end date missing)
- {% endif %} - {% if total_distance %} -
Total distance: - {{ "{:,.0f} km / {:,.0f} miles".format(total_distance, total_distance / 1.60934) }} -
- {% 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 %} -
-
- {% endfor %} - {% endif %} -{% endmacro %} - - -{% block content %} -
- - -

Trips

-
-
-
-
-
-
- {{ section("Current", current, "attending") }} - {{ section("Future", future, "going") }} -
-
-
-
-
- {{ section("Past", past|reverse, "went") }} -
-{% endblock %} - -{% block scripts %} - - - - - - - -{% endblock %} diff --git a/web_view.py b/web_view.py index b5270f9..a73a1b1 100755 --- a/web_view.py +++ b/web_view.py @@ -379,41 +379,6 @@ def get_trip_list( ] -@app.route("/trip/old") -def trip_old_list() -> str: - """Page showing a list of trips.""" - route_distances = agenda.travel.load_route_distances(app.config["DATA_DIR"]) - trip_list = get_trip_list(route_distances) - today = date.today() - - current = [ - item - for item in trip_list - if item.start <= today and (item.end or item.start) >= today - ] - - past = [item for item in trip_list if (item.end or item.start) < today] - future = [item for item in trip_list if item.start > today] - - future_coordinates, future_routes = agenda.trip.get_coordinates_and_routes(future) - past_coordinates, past_routes = agenda.trip.get_coordinates_and_routes(past) - - return flask.render_template( - "trip_list.html", - current=current, - past=past, - future=future, - future_coordinates=future_coordinates, - future_routes=future_routes, - past_coordinates=past_coordinates, - past_routes=past_routes, - today=today, - get_country=agenda.get_country, - format_list_with_ampersand=format_list_with_ampersand, - fx_rate=agenda.fx.get_rates(app.config), - ) - - @app.route("/trip") def trip_list() -> werkzeug.Response: """Trip list to redirect to future trip list."""