parent
e1540d9bfe
commit
c94e98acb1
|
@ -30,6 +30,8 @@ def build_events(events: list[Event]) -> list[dict[str, typing.Any]]:
|
||||||
one_day = timedelta(days=1)
|
one_day = timedelta(days=1)
|
||||||
|
|
||||||
for e in events:
|
for e in events:
|
||||||
|
if e.name == "today":
|
||||||
|
continue
|
||||||
if e.name == "accommodation":
|
if e.name == "accommodation":
|
||||||
assert e.title and e.end_date
|
assert e.title and e.end_date
|
||||||
item = {
|
item = {
|
||||||
|
|
|
@ -10,7 +10,7 @@ from datetime import date, datetime, timedelta
|
||||||
import dateutil.rrule
|
import dateutil.rrule
|
||||||
import dateutil.tz
|
import dateutil.tz
|
||||||
import holidays # type: ignore
|
import holidays # type: ignore
|
||||||
import isodate
|
import isodate # type: ignore
|
||||||
import lxml
|
import lxml
|
||||||
import pytz
|
import pytz
|
||||||
import yaml
|
import yaml
|
||||||
|
@ -265,6 +265,7 @@ async def get_data(now: datetime) -> typing.Mapping[str, str | object]:
|
||||||
events += hn.whoishiring(last_year, next_year)
|
events += hn.whoishiring(last_year, next_year)
|
||||||
|
|
||||||
events += domains.renewal_dates(my_data)
|
events += domains.renewal_dates(my_data)
|
||||||
|
events += [Event(name="today", date=today)]
|
||||||
|
|
||||||
for launch in rockets:
|
for launch in rockets:
|
||||||
dt = None
|
dt = None
|
||||||
|
|
|
@ -148,27 +148,37 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<div class="row border border-1 {% if event.name in class_map %} {{ class_map[event.name]}}{% endif %}">
|
{% set delta = event.delta_days(today) %}
|
||||||
<div class="col-md-3">
|
{% if event.name == "today" %}
|
||||||
{{event.as_date.strftime("%a, %d, %b")}}
|
<div class="row">
|
||||||
|
<div class="col bg-warning-subtle">
|
||||||
|
<h3>today</h3>
|
||||||
{{event.display_time or ""}}
|
</div>
|
||||||
|
|
||||||
|
|
||||||
{{event.display_timezone or ""}}
|
|
||||||
</div>
|
</div>
|
||||||
|
{% else %}
|
||||||
|
{% set cell_bg = " bg-warning-subtle" if delta == "today" else "" %}
|
||||||
|
<div class="row border border-1 {% if event.name in class_map %} {{ class_map[event.name]}}{% else %}{{ cell_bg }}{% endif %}">
|
||||||
|
<div class="col-md-3{{ cell_bg }}">
|
||||||
|
{{event.as_date.strftime("%a, %d, %b")}}
|
||||||
|
|
||||||
|
|
||||||
|
{{event.display_time or ""}}
|
||||||
|
|
||||||
|
|
||||||
|
{{event.display_timezone or ""}}
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="col-md-8 text-start">
|
<div class="col-md-8 text-start">
|
||||||
{% if event.url %}<a href="{{ event.url }}">{% endif %}
|
{% if event.url %}<a href="{{ event.url }}">{% endif %}
|
||||||
{{ event_labels.get(event.name) or event.name }}
|
{{ event_labels.get(event.name) or event.name }}
|
||||||
{%- if event.title -%}: {{ event.title }}{% endif %}
|
{%- if event.title -%}: {{ event.title }}{% endif %}
|
||||||
{% if event.url %}</a>{% endif %}
|
{% if event.url %}</a>{% endif %}
|
||||||
|
</div>
|
||||||
|
<div class="col-md-1{{ cell_bg }}">
|
||||||
|
{{ delta }}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-1">
|
{% endif %}
|
||||||
{{ event.delta_days(today) }}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
<h3>Space launches</h3>
|
<h3>Space launches</h3>
|
||||||
|
|
Loading…
Reference in a new issue