diff --git a/saturn/calendar/event.py b/saturn/calendar/event.py index 59df18a..f5230d6 100644 --- a/saturn/calendar/event.py +++ b/saturn/calendar/event.py @@ -13,6 +13,7 @@ class Event: ): self._calendar = calendar self._v = event.instance.vevent + print(type(self.valarm_trigger)) @property def dtstart(self): @@ -53,9 +54,20 @@ class Event: return self._calendar.get_properties( [caldav.elements.ical.CalendarColor()] )['{http://apple.com/ns/ical/}calendar-color'] + + @property + def valarm(self): + if hasattr(self._v, 'valarm'): + return self._v.valarm + return None + + @property + def valarm_trigger(self): + if self.valarm is None: return None + return self.valarm.trigger.value - def fdescription(self): + def get_fdescription(self): if self.description is None: return None return re.sub( r'(https?://\S+)', @@ -63,13 +75,16 @@ class Event: html.escape(self.description), ) - def freq(self): + def get_freq(self): if self.rrule is None: return None return re.search( r'FREQ=([A-Z]+?);', self.rrule, ).group(1) + def get_valarm_date(self): + return self.dtstart + self.valarm_trigger + def is_full_day(self): return type(self.dtstart) is datetime.date diff --git a/saturn/server/static/icons/remixicon.css b/saturn/server/static/icons/remixicon.css index 26921d0..dd8a6e5 100644 --- a/saturn/server/static/icons/remixicon.css +++ b/saturn/server/static/icons/remixicon.css @@ -8,12 +8,12 @@ @font-face { font-family: "remixicon"; - src: url('remixicon.eot?t=1643444096731'); /* IE9*/ - src: url('remixicon.eot?t=1643444096731#iefix') format('embedded-opentype'), /* IE6-IE8 */ - url("remixicon.woff2?t=1643444096731") format("woff2"), - url("remixicon.woff?t=1643444096731") format("woff"), - url('remixicon.ttf?t=1643444096731') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+*/ - url('remixicon.svg?t=1643444096731#remixicon') format('svg'); /* iOS 4.1- */ + src: url('remixicon.eot?t=1643448644501'); /* IE9*/ + src: url('remixicon.eot?t=1643448644501#iefix') format('embedded-opentype'), /* IE6-IE8 */ + url("remixicon.woff2?t=1643448644501") format("woff2"), + url("remixicon.woff?t=1643448644501") format("woff"), + url('remixicon.ttf?t=1643448644501') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+*/ + url('remixicon.svg?t=1643448644501#remixicon') format('svg'); /* iOS 4.1- */ font-display: swap; } @@ -44,3 +44,4 @@ .ri-map-pin-line:before { content: "\ef14"; } .ri-repeat-line:before { content: "\f074"; } .ri-calendar-line:before { content: "\eb27"; } +.ri-alarm-line:before { content: "\ea1b"; } diff --git a/saturn/server/static/icons/remixicon.eot b/saturn/server/static/icons/remixicon.eot index 909c339..c640688 100644 Binary files a/saturn/server/static/icons/remixicon.eot and b/saturn/server/static/icons/remixicon.eot differ diff --git a/saturn/server/static/icons/remixicon.less b/saturn/server/static/icons/remixicon.less index f7753bf..ddf576b 100644 --- a/saturn/server/static/icons/remixicon.less +++ b/saturn/server/static/icons/remixicon.less @@ -8,12 +8,12 @@ @font-face { font-family: "remixicon"; - src: url('remixicon.eot?t=1643444096731'); /* IE9*/ - src: url('remixicon.eot?t=1643444096731#iefix') format('embedded-opentype'), /* IE6-IE8 */ - url("remixicon.woff2?t=1643444096731") format("woff2"), - url("remixicon.woff?t=1643444096731") format("woff"), - url('remixicon.ttf?t=1643444096731') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+*/ - url('remixicon.svg?t=1643444096731#remixicon') format('svg'); /* iOS 4.1- */ + src: url('remixicon.eot?t=1643448644501'); /* IE9*/ + src: url('remixicon.eot?t=1643448644501#iefix') format('embedded-opentype'), /* IE6-IE8 */ + url("remixicon.woff2?t=1643448644501") format("woff2"), + url("remixicon.woff?t=1643448644501") format("woff"), + url('remixicon.ttf?t=1643448644501') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+*/ + url('remixicon.svg?t=1643448644501#remixicon') format('svg'); /* iOS 4.1- */ font-display: swap; } @@ -45,4 +45,5 @@ .ri-map-pin-line:before { content: "\ef14"; } .ri-repeat-line:before { content: "\f074"; } .ri-calendar-line:before { content: "\eb27"; } +.ri-alarm-line:before { content: "\ea1b"; } } \ No newline at end of file diff --git a/saturn/server/static/icons/remixicon.svg b/saturn/server/static/icons/remixicon.svg index 47fdd7c..4cfcc4f 100644 --- a/saturn/server/static/icons/remixicon.svg +++ b/saturn/server/static/icons/remixicon.svg @@ -11,4 +11,6 @@ unicode="" horiz-adv-x="1200" d="M300 1000H1050A50 50 0 0 0 1100 950V600H1000V900H300V750L50 950L300 1150V1000zM900 200H150A50 50 0 0 0 100 250V600H200V300H900V450L1150 250L900 50V200z" /> \ No newline at end of file + 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" /> \ No newline at end of file diff --git a/saturn/server/static/icons/remixicon.symbol.svg b/saturn/server/static/icons/remixicon.symbol.svg index e0008c9..908c4de 100644 --- a/saturn/server/static/icons/remixicon.symbol.svg +++ b/saturn/server/static/icons/remixicon.symbol.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/saturn/server/static/icons/remixicon.ttf b/saturn/server/static/icons/remixicon.ttf index 43af91b..df53c9e 100644 Binary files a/saturn/server/static/icons/remixicon.ttf and b/saturn/server/static/icons/remixicon.ttf differ diff --git a/saturn/server/static/icons/remixicon.woff b/saturn/server/static/icons/remixicon.woff index e431a29..b161b68 100644 Binary files a/saturn/server/static/icons/remixicon.woff and b/saturn/server/static/icons/remixicon.woff differ diff --git a/saturn/server/static/icons/remixicon.woff2 b/saturn/server/static/icons/remixicon.woff2 index fc1b74c..4ac38dd 100644 Binary files a/saturn/server/static/icons/remixicon.woff2 and b/saturn/server/static/icons/remixicon.woff2 differ diff --git a/saturn/server/templates/index.html b/saturn/server/templates/index.html index 35a0ab9..b146628 100644 --- a/saturn/server/templates/index.html +++ b/saturn/server/templates/index.html @@ -61,7 +61,7 @@
{% if event.description %} - {{ event.fdescription() | safe }} + {{ event.get_fdescription() | safe }} {% endif %}
@@ -74,7 +74,13 @@ {% if event.rrule %}
- {{ event.freq() }} + {{ event.get_freq() }} +
+ {% endif %} + {% if event.valarm %} +
+ + {{ event.get_valarm_date() }}
{% endif %}