Compare commits

..

No commits in common. "4c651198f34777f930b9f363998cb31a5717f20a" and "537a84ff67d5203f18ceb4831bca2adc6e0ada9b" have entirely different histories.

8 changed files with 6 additions and 45 deletions

View file

@ -1,4 +1,4 @@
"""Accommodation.""" """Accomodation"""
import yaml import yaml
@ -6,7 +6,7 @@ from .types import Event
def get_events(filepath: str) -> list[Event]: def get_events(filepath: str) -> list[Event]:
"""Get accommodation from YAML.""" """Get accomodation from YAML."""
with open(filepath) as f: with open(filepath) as f:
return [ return [
Event( Event(

View file

@ -1,4 +1,4 @@
"""Calculate the date for carnival.""" """Calcuate the date for carnival."""
from datetime import date, timedelta from datetime import date, timedelta

View file

@ -42,7 +42,7 @@ here = dateutil.tz.tzlocal()
# deadline to file tax return # deadline to file tax return
# credit card expiry dates # credit card expiry dates
# morzine ski lifts # morzine ski lifts
# chalet availability calendar # chalet availablity calendar
# starlink visible # starlink visible

View file

@ -1,4 +1,4 @@
"""Domain renewal dates.""" """Accomodation."""
import csv import csv
import os import os

View file

@ -1,17 +0,0 @@
{% extends "base.html" %}
{% from "macros.html" import display_date %}
{% block title %}Birthdays - Edward Betts{% endblock %}
{% block content %}
<div class="container-fluid mt-2">
<h1>Birthdays</h1>
<table class="w-auto table">
{% for event in items %}
<tr>
<td class="text-end">{{event.as_date.strftime("%a, %d, %b")}}</td>
<td>{{ event.title }}</td>
</tr>
{% endfor %}
</table>
</div>
{% endblock %}

View file

@ -11,9 +11,7 @@
{"endpoint": "weekends", "label": "Weekend" }, {"endpoint": "weekends", "label": "Weekend" },
{"endpoint": "launch_list", "label": "Space launch" }, {"endpoint": "launch_list", "label": "Space launch" },
{"endpoint": "holiday_list", "label": "Holiday" }, {"endpoint": "holiday_list", "label": "Holiday" },
] + ([{"endpoint": "birthday_list", "label": "Birthdays" }] ] %}
if g.user.is_authenticated else [])
%}
<nav class="navbar navbar-expand-md bg-success" data-bs-theme="dark"> <nav class="navbar navbar-expand-md bg-success" data-bs-theme="dark">

View file

@ -124,8 +124,6 @@
&ndash; &ndash;
{{ e.end_loc }} {{ e.end_country.flag }} {{ e.end_loc }} {{ e.end_country.flag }}
{% if e.element_type == "flight" %} {% if e.element_type == "flight" %}
{% set full_flight_number = e.detail.airline + e.detail.flight_number %}
{% set radarbox_url = "https://www.radarbox.com/data/flights/" + full_flight_number %}
<span class="text-nowrap"><strong>airline:</strong> {{ e.detail.airline_name }}</span> <span class="text-nowrap"><strong>airline:</strong> {{ e.detail.airline_name }}</span>
<span class="text-nowrap"><strong>flight number:</strong> {{ e.detail.airline }}{{ e.detail.flight_number }}</span> <span class="text-nowrap"><strong>flight number:</strong> {{ e.detail.airline }}{{ e.detail.flight_number }}</span>
{% if e.detail.duration %} {% if e.detail.duration %}
@ -136,11 +134,6 @@
{% if e.detail.distance %} {% if e.detail.distance %}
<span class="text-nowrap"><strong>distance:</strong> {{ format_distance(e.detail.distance) }}</span> <span class="text-nowrap"><strong>distance:</strong> {{ format_distance(e.detail.distance) }}</span>
{% endif %} {% endif %}
{% if e.element_type == "flight" %}
<a href="https://www.flightradar24.com/data/flights/{{ full_flight_number | lower }}">flightradar24</a>
| <a href="https://uk.flightaware.com/live/flight/{{ full_flight_number | replace("U2", "EZY") }}">FlightAware</a>
| <a href="{{ radarbox_url }}">radarbox</a>
{% endif %}
</div> </div>
{% endif %} {% endif %}
{% endfor %} {% endfor %}

View file

@ -496,19 +496,6 @@ def holiday_list() -> str:
) )
@app.route("/birthdays")
def birthday_list() -> str:
"""List of birthdays."""
today = date.today()
if not flask.g.user.is_authenticated:
flask.abort(401)
data_dir = app.config["PERSONAL_DATA"]
entities_file = os.path.join(data_dir, "entities.yaml")
items = agenda.birthday.get_birthdays(today - timedelta(days=2), entities_file)
items.sort(key=lambda item: item.date)
return flask.render_template("birthday_list.html", items=items, today=today)
@app.route("/callback") @app.route("/callback")
def auth_callback() -> tuple[str, int] | werkzeug.Response: def auth_callback() -> tuple[str, int] | werkzeug.Response:
"""Process the authentication callback.""" """Process the authentication callback."""