Added logo, reduced event width, moved month detection to backend

This commit is contained in:
Edgar P. Burkhart 2022-01-28 10:15:25 +01:00
parent 3cf532072d
commit d94d060ca4
Signed by: edpibu
GPG Key ID: 9833D3C5A25BD227
4 changed files with 10 additions and 2 deletions

View File

@ -60,3 +60,6 @@ class Event:
return (self._dtend.time() == datetime.time.min \ return (self._dtend.time() == datetime.time.min \
and self._dtend - self._dtstart <= datetime.timedelta(days=1)) \ and self._dtend - self._dtstart <= datetime.timedelta(days=1)) \
or self._dtend.date() == self._dtstart.date() or self._dtend.date() == self._dtstart.date()
def is_one_month(self):
return self._dtend.month == self._dtstart.month

View File

@ -15,6 +15,7 @@ body > h1 {
body > #events { body > #events {
margin: 2rem; margin: 2rem;
max-width: 30rem;
} }
@media (max-width: 672px) { @media (max-width: 672px) {

View File

@ -36,6 +36,10 @@ h1 {
line-height: 4rem; line-height: 4rem;
font-feature-settings: 'ss01', 'ss02', 'ss03', 'cv11'; font-feature-settings: 'ss01', 'ss02', 'ss03', 'cv11';
} }
h1 > img {
height: 4rem;
vertical-align: bottom;
}
a { a {
color: var(--link-01); color: var(--link-01);

View File

@ -7,7 +7,7 @@
{% endblock %} {% endblock %}
{% block body %} {% block body %}
<h1>Saturn</h1> <h1><img src="/static/svg/logo.svg" /> Saturn</h1>
<div id="events"> <div id="events">
{% for event in events %} {% for event in events %}
@ -38,7 +38,7 @@
<span class="day"> <span class="day">
{{ event.dtend.strftime('%d') }} {{ event.dtend.strftime('%d') }}
</span> </span>
{% if event.dtend.month != event.dtstart.month %} {% if event.is_one_month() %}
<span class="month"> <span class="month">
{{ event.dtend.strftime('%B').capitalize() }} {{ event.dtend.strftime('%B').capitalize() }}
</span> </span>