The accommodation page has been updated to provide a more comprehensive and dynamic view of travel statistics.
Previously, the page only displayed hard-coded statistics for total nights away and abroad for the year 2024. This required manual updates each year and didn't provide historical context.
This commit introduces the following changes:
* **Dynamically Calculate Yearly Stats:** The `accommodation_list` view in `web_view.py` now calculates statistics for every year found in the accommodation data. It correctly handles stays that span across multiple years.
* **Display All Years:** The `accommodation.html` template now iterates through a list of all calculated yearly stats, displaying a summary for each year automatically.
* **Add Percentage of Year:** The template also calculates and displays what percentage of the year the "total nights" and "nights abroad" represent. This includes logic to correctly account for leap years (366 days) for an accurate calculation.
These changes make the statistics more informative and ensure the page remains relevant over time without needing further manual code adjustments.
Trip prices are visible on trip list, accommodation list,
conference list and travel list.
Prices are hidden if not logged in, except conference prices.
Still need to show prices on individual trip page.
Creating a new entity called a trip. This will group together any travel
accommodation and conferences that happen together on one trip.
A trip is assumed to start when leaving home and finish when returning
home.
The start date of a trip in is the trip ID. The date is written in ISO
format.
This assumes there cannot be multiple trips one one day. This assumption
might be wrong, for example a morning day trip by rail, then another
trip starts in the afternoon. I can change my choice of using dates as
trip IDs if that happens.
Sometimes during the planning of a trip the start date is unknown. For
now we make up a start date, we can always change it later. If we use
the start date in URLs then the URLs will change. Might need to keep a
file of redirects, or could think of a different style of identifier.
Trip ID have been added to accommodation, conferences, trains and
flights.
Later there will be a trips.yaml with notes about each trip.