agenda/templates/index.html

110 lines
3.2 KiB
HTML

{# vim: set ft=htmljinja
#}
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Agenda</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous">
</head>
{% set event_labels = {
"next_economist": "The Economist",
"mothers_day": "Mothers' day",
"fathers_day": "Fathers' day",
"uk_financial_year_end": "End of financial year",
"bank_holiday": "UK bank holiday",
"us_holiday": "US holiday",
"uk_clock_change": "UK clock change",
"us_clock_change": "US clock change",
"next_us_presidential_election": "US pres. election",
"xmas_last_second": "Christmas last posting 2nd class",
"xmas_last_first": "Christmas last posting 1st class",
"xmas_day": "Christmas day",
"next_up_series": "Next Up documentary",
"waste_schedule": "Waste schedule",
}
%}
{%set class_map = {
"bank_holiday": "bg-success-subtle",
"conference": "bg-primary-subtle",
"us_holiday": "bg-secondary-subtle",
"birthday": "bg-info-subtle",
"waste_schedule": "bg-danger-subtle",
} %}
<body>
<div class="container mt-2">
<p><a href="/tools">&larr; personal tools</a></p>
<h1>Agenda</h1>
<ul>
<li>Today is {{now.strftime("%A, %-d %b %Y")}}</li>
<li>GBPUSD: {{"{:,.3f}".format(gbpusd)}}</li>
</ul>
<table class="table table-hover w-auto">
{% for event in events %}
<tr>
<td class="text-end">
{{event.date.strftime("%a, %d, %b %Y")}}
</td>
<td class="text-start {% if event.name in class_map %} {{ class_map[event.name]}}{% endif %}">
{{ event_labels.get(event.name) or event.name }}
{%- if event.title -%}: {{ event.title }}{% endif %}
</td>
<td class="text-end">
{{ days(event.date) }}
</td>
{% endfor %}
</table>
<h3>Stock markets</h3>
{% for market in stock_markets %}
<p>{{ market }}</p>
{% endfor %}
<h3>Space launches</h3>
{% for launch in rockets %}
<div class="row">
<div class="col-md-1 text-nowrap text-md-end">{{ launch.t0_date }}
{% if launch.t0_time %}<br class="d-none d-md-block"/>{{ launch.t0_time }}{% endif %}</div>
<div class="col-md-1 text-md-nowrap">
<span class="d-md-none">launch status:</span>
<abbr title="{{ launch.status.name }}">{{ launch.status.abbrev }}</abbr>
</div>
<div class="col">{{ launch.rocket }}
&ndash;
<strong>{{launch.mission.name }}</strong>
&ndash;
{% if launch.launch_provider_abbrev %}
<abbr title="{{ launch.launch_provider }}">{{ launch.launch_provider_abbrev }}</abbr>
{% else %}
{{ launch.launch_provider }}
{% endif %}
({{ launch.launch_provider_type }})
&mdash;
{{ launch.orbit.name }} ({{ launch.orbit.abbrev }})
<br/>
<a href="{{ launch.pad_wikipedia_url }}">{{ launch.pad_name }}</a>
&mdash; {{ launch.location }}<br/>
{% for line in launch.mission.description.splitlines() %}
<p>{{ line }}</p>
{% endfor %}
</div>
</div>
{% endfor %}
</div>
</body>
</html>