Added origin calendar indicator

This commit is contained in:
Edgar P. Burkhart 2022-01-29 09:30:59 +01:00
parent a20e88dbed
commit 3ae02b9d82
Signed by: edpibu
GPG key ID: 9833D3C5A25BD227
11 changed files with 38 additions and 16 deletions

View file

@ -19,7 +19,7 @@ def get_events(davclient):
events = [] events = []
for cal in pri.calendars(): for cal in pri.calendars():
events += [Event(event) events += [Event(event, cal)
for event in cal.date_search(start=date.today())] for event in cal.date_search(start=date.today())]
return sorted(events) return sorted(events)

View file

@ -2,12 +2,16 @@ import re
import datetime import datetime
import html import html
import caldav.elements.ical
class Event: class Event:
def __init__( def __init__(
self, self,
event, event,
calendar,
): ):
self._calendar = calendar
self._v = event.instance.vevent self._v = event.instance.vevent
@property @property
@ -40,6 +44,16 @@ class Event:
return self._v.rrule.value return self._v.rrule.value
return None return None
@property
def calendar(self):
return self._calendar
@property
def color(self):
return self._calendar.get_properties(
[caldav.elements.ical.CalendarColor()]
)['{http://apple.com/ns/ical/}calendar-color']
def fdescription(self): def fdescription(self):
if self.description is None: return None if self.description is None: return None

View file

@ -8,12 +8,12 @@
@font-face { @font-face {
font-family: "remixicon"; font-family: "remixicon";
src: url('remixicon.eot?t=1643377622508'); /* IE9*/ src: url('remixicon.eot?t=1643444096731'); /* IE9*/
src: url('remixicon.eot?t=1643377622508#iefix') format('embedded-opentype'), /* IE6-IE8 */ src: url('remixicon.eot?t=1643444096731#iefix') format('embedded-opentype'), /* IE6-IE8 */
url("remixicon.woff2?t=1643377622508") format("woff2"), url("remixicon.woff2?t=1643444096731") format("woff2"),
url("remixicon.woff?t=1643377622508") format("woff"), url("remixicon.woff?t=1643444096731") format("woff"),
url('remixicon.ttf?t=1643377622508') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+*/ url('remixicon.ttf?t=1643444096731') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+*/
url('remixicon.svg?t=1643377622508#remixicon') format('svg'); /* iOS 4.1- */ url('remixicon.svg?t=1643444096731#remixicon') format('svg'); /* iOS 4.1- */
font-display: swap; font-display: swap;
} }
@ -43,3 +43,4 @@
.ri-map-pin-line:before { content: "\ef14"; } .ri-map-pin-line:before { content: "\ef14"; }
.ri-repeat-line:before { content: "\f074"; } .ri-repeat-line:before { content: "\f074"; }
.ri-calendar-line:before { content: "\eb27"; }

View file

@ -8,12 +8,12 @@
@font-face { @font-face {
font-family: "remixicon"; font-family: "remixicon";
src: url('remixicon.eot?t=1643377622508'); /* IE9*/ src: url('remixicon.eot?t=1643444096731'); /* IE9*/
src: url('remixicon.eot?t=1643377622508#iefix') format('embedded-opentype'), /* IE6-IE8 */ src: url('remixicon.eot?t=1643444096731#iefix') format('embedded-opentype'), /* IE6-IE8 */
url("remixicon.woff2?t=1643377622508") format("woff2"), url("remixicon.woff2?t=1643444096731") format("woff2"),
url("remixicon.woff?t=1643377622508") format("woff"), url("remixicon.woff?t=1643444096731") format("woff"),
url('remixicon.ttf?t=1643377622508') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+*/ url('remixicon.ttf?t=1643444096731') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+*/
url('remixicon.svg?t=1643377622508#remixicon') format('svg'); /* iOS 4.1- */ url('remixicon.svg?t=1643444096731#remixicon') format('svg'); /* iOS 4.1- */
font-display: swap; font-display: swap;
} }
@ -44,4 +44,5 @@
.ri-map-pin-line:before { content: "\ef14"; } .ri-map-pin-line:before { content: "\ef14"; }
.ri-repeat-line:before { content: "\f074"; } .ri-repeat-line:before { content: "\f074"; }
.ri-calendar-line:before { content: "\eb27"; }
} }

View file

@ -9,4 +9,6 @@
unicode="" unicode=""
horiz-adv-x="1200" d="M600 155L847.5 402.5A350 350 0 1 1 352.5 402.5L600 155zM600 13.6000000000001L281.8 331.8000000000002A450 450 0 1 0 918.2 331.8000000000002L600 13.5999999999999zM600 550A100 100 0 1 1 600 750A100 100 0 0 1 600 550zM600 450A200 200 0 1 0 600 850A200 200 0 0 0 600 450z" /><glyph glyph-name="repeat-line" horiz-adv-x="1200" d="M600 155L847.5 402.5A350 350 0 1 1 352.5 402.5L600 155zM600 13.6000000000001L281.8 331.8000000000002A450 450 0 1 0 918.2 331.8000000000002L600 13.5999999999999zM600 550A100 100 0 1 1 600 750A100 100 0 0 1 600 550zM600 450A200 200 0 1 0 600 850A200 200 0 0 0 600 450z" /><glyph glyph-name="repeat-line"
unicode="&#xF074;" unicode="&#xF074;"
horiz-adv-x="1200" d="M300 1000H1050A50 50 0 0 0 1100 950V600H1000V900H300V750L50 950L300 1150V1000zM900 200H150A50 50 0 0 0 100 250V600H200V300H900V450L1150 250L900 50V200z" /></font></defs></svg> horiz-adv-x="1200" d="M300 1000H1050A50 50 0 0 0 1100 950V600H1000V900H300V750L50 950L300 1150V1000zM900 200H150A50 50 0 0 0 100 250V600H200V300H900V450L1150 250L900 50V200z" /><glyph glyph-name="calendar-line"
unicode="&#xEB27;"
horiz-adv-x="1200" d="M850 1050H1050A50 50 0 0 0 1100 1000V200A50 50 0 0 0 1050 150H150A50 50 0 0 0 100 200V1000A50 50 0 0 0 150 1050H350V1150H450V1050H750V1150H850V1050zM750 950H450V850H350V950H200V750H1000V950H850V850H750V950zM1000 650H200V250H1000V650z" /></font></defs></svg>

Before

Width:  |  Height:  |  Size: 1,011 B

After

Width:  |  Height:  |  Size: 1.3 KiB

View file

@ -1 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xlink="http://www.w3.org/1999/xlink" width="0" height="0" style="display:none;"><symbol viewBox="0 0 24 24" id="map-pin-line"><path fill="none" d="M0 0h24v24H0z"/><path d="M12 20.9l4.95-4.95a7 7 0 1 0-9.9 0L12 20.9zm0 2.828l-6.364-6.364a9 9 0 1 1 12.728 0L12 23.728zM12 13a2 2 0 1 0 0-4 2 2 0 0 0 0 4zm0 2a4 4 0 1 1 0-8 4 4 0 0 1 0 8z"/></symbol><symbol viewBox="0 0 24 24" id="repeat-line"><path fill="none" d="M0 0h24v24H0z"/><path d="M6 4h15a1 1 0 0 1 1 1v7h-2V6H6v3L1 5l5-4v3zm12 16H3a1 1 0 0 1-1-1v-7h2v6h14v-3l5 4-5 4v-3z"/></symbol></svg> <svg xmlns="http://www.w3.org/2000/svg" xlink="http://www.w3.org/1999/xlink" width="0" height="0" style="display:none;"><symbol viewBox="0 0 24 24" id="map-pin-line"><path fill="none" d="M0 0h24v24H0z"/><path d="M12 20.9l4.95-4.95a7 7 0 1 0-9.9 0L12 20.9zm0 2.828l-6.364-6.364a9 9 0 1 1 12.728 0L12 23.728zM12 13a2 2 0 1 0 0-4 2 2 0 0 0 0 4zm0 2a4 4 0 1 1 0-8 4 4 0 0 1 0 8z"/></symbol><symbol viewBox="0 0 24 24" id="repeat-line"><path fill="none" d="M0 0h24v24H0z"/><path d="M6 4h15a1 1 0 0 1 1 1v7h-2V6H6v3L1 5l5-4v3zm12 16H3a1 1 0 0 1-1-1v-7h2v6h14v-3l5 4-5 4v-3z"/></symbol><symbol viewBox="0 0 24 24" id="calendar-line"><path fill="none" d="M0 0h24v24H0z"/><path d="M17 3h4a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h4V1h2v2h6V1h2v2zm-2 2H9v2H7V5H4v4h16V5h-3v2h-2V5zm5 6H4v8h16v-8z"/></symbol></svg>

Before

Width:  |  Height:  |  Size: 585 B

After

Width:  |  Height:  |  Size: 825 B

View file

@ -12,7 +12,7 @@
<div id="events"> <div id="events">
{% for event in events %} {% for event in events %}
<div class="event"> <div class="event" style="border-left: 5px solid {{event.color}}">
<div class="summary">{{ event.summary }}</div> <div class="summary">{{ event.summary }}</div>
{% if event.is_one_day() and event.is_full_day() %} {% if event.is_one_day() and event.is_full_day() %}
<div class="date only-one"> <div class="date only-one">
@ -77,6 +77,10 @@
{{ event.freq() }} {{ event.freq() }}
</div> </div>
{% endif %} {% endif %}
<div>
<i class="ri-calendar-line ri-fw ri-sm"></i>
{{ event.calendar.name }}
</div>
</div> </div>
</div> </div>
</div> </div>