From 2dabdf78dab8d88db5a1dde65c417b52c8b6a459 Mon Sep 17 00:00:00 2001 From: "Edgar P. Burkhart" Date: Sat, 29 Jan 2022 10:43:27 +0100 Subject: [PATCH] Added single alarm display --- saturn/calendar/event.py | 19 ++++++++++++++++-- saturn/server/static/icons/remixicon.css | 13 ++++++------ saturn/server/static/icons/remixicon.eot | Bin 2384 -> 2612 bytes saturn/server/static/icons/remixicon.less | 13 ++++++------ saturn/server/static/icons/remixicon.svg | 4 +++- .../server/static/icons/remixicon.symbol.svg | 2 +- saturn/server/static/icons/remixicon.ttf | Bin 2212 -> 2440 bytes saturn/server/static/icons/remixicon.woff | Bin 1436 -> 1576 bytes saturn/server/static/icons/remixicon.woff2 | Bin 1004 -> 1164 bytes saturn/server/templates/index.html | 10 +++++++-- 10 files changed, 43 insertions(+), 18 deletions(-) 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 909c339d8513bd8a6e1d4ccafc5cf541998d84aa..c6406887a379e7fc137315266d7bc9d9fe6ca25c 100644 GIT binary patch delta 625 zcmY*VQA-q26#mZ4ompoMDji+RBGcWS3{!Ep-H1_^9;$~4K|<nK_vft!3ce&|1| zySu>uoE^a;_U&!%+V~^2Q%5dLghRHvgCf?#?-KnQa03sqK|PJj;sGrLFM_x(4Cv^` z5K_njiC!aVB-7bUHZv0IjCJY}HKH0LflddR-azX?rajfscQ}>E#v+MW#E`Dl%0+W@ z)GU^NHA!u1VtjCTcyN4Ttx4*ScbvcPRxYi`(Q|w{`}|>{v(FzEQr@BbB-^(cKx0$6 eBDX3ekxYUVQvIZM>QK~n?K$s^Tb?O|AMg*w3y(1X delta 381 zcmdlYazThKfRlk?3CBb>GnV6SbN^0s=&5&p9@50Xz}UmUzz~+4n^2C0CW?*2R1LSvPq$Z}wU!0~5RQmvk%`$)jocb(Vf$Tj%tdfyiQo$zxWHB&4 z0TKc^`N@flDhypf{S$zEuH3|m0!ASQH=w)(kgt%Jm@Atq!|~LVfq_*8s7R|Izqq94 z{YjuBIRbzRLMCT0Dyy3xgE{ z%j9#6xr{B7ZJ2DBUaL>8Vp5yDgh|*l18fKbLlOfsn56@xxqzl-Ft9L~0nOk5LM8@= z*Xr*@K9v0bkIVww!3b8t!N9PYi&>bF6BtBbz&zQAMUy=N=*1&IsT7t@#?4FFe3&^| T7?~KE8Ce)vC;#Ep0GbN`nFUnm 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 43af91b5c2c9d6b1838ef21caecfff2353dcefe6..df53c9ef53f8d7cea92a9bfae2fd0461cd6f7a17 100644 GIT binary patch delta 609 zcmY*VO=uHA7=7RFZ2l@}&9*E4U`&&&6>UpX6Oj~xf?gt(Dy4czUAl=0?6x6Bs6kqf zDjr%FJbCn_g4TdqD5Zy96+8>YgM!$DJt&ld)Ni&F+F9Prd*6F+2j)fl!{}^m=EB$O zO8`9qFf#61wG)L8Pg!p;-raWYl{bGrU`zc7DEUgsvX6gRXz}11BU9l)xL3SqzQ{;a z+{Vgr}3tE z{}m8UaKM^d?7FCdm@*25yEn)7=l-HiyyXd24==3jKE4!&1ZyLbqM6S8u5R{jWzSPzTVi{0(Nsw$VHsn{s7Us zszj+H?;9*-VH*&hqjraZTX>8WinX4rk7!1dL2*Nv(9w-vq>%-ZaWiG62C|uKrr+o^ zI`v>67%=;#9*|C4YF#?fbVpZvI+-Q5oyTP}afq{7rkl&G! znwTPgahf(z?E@e-%K!>+>a%PGviAV7N=9x;1)l(r#lZLkNC@QQCnqwhFmwU+PXO|{ zauX{G7=;+zfbtSRzCvDNu579d$5T@V238fIBCUe_;*y&8Cpj4yI0AqQLMHA}c4lE< z1Tum6?_7)P@%%Pl8Ms+C07V$?Nv!};aGIr#r4GpDU|<3ZgY_`5Fjz6LOjcsdWo(%| zfzgKPwff|9jB1mAFbaESfDL9~NMc|Hvvhzo7f@FQP?H(hAh1!d)!&PJDEa@NfdRn+ zTfhjk3IrK8$1w>rasopQ445akF>A6X0DXM~D7AyRlX3G;Rv%_g7DgsUW=0l9*2w{! I8bBuk0KOPdXaE2J diff --git a/saturn/server/static/icons/remixicon.woff b/saturn/server/static/icons/remixicon.woff index e431a2956dfe17ce43ce5ee3f2ed41081279ddcc..b161b6854189bfd6770f6c0dd65a72e5c43e82c0 100644 GIT binary patch delta 1030 zcmbQky@E%i+~3WOfsp|S*fbcpK{RK_L=p3Pdmt;!>2}DzP>y=Y*_NKH&(U|`+?RHp~TX7U$zZq5J-0>z#H`4T{^!l}=) zEhD$20x0$e$ma)Q5upP>gY%Pt>R5Pyd@yEIv1447n^*y~m<6O!4u};PMHt-j5_405 zVirJ)R{#yslHqu2T998{!oa}#0I0?dh!fYx)vTV(!RT0Tcfg{tacX1ZOZCm{%*=NVnAF%P=)%D8p`2TTp<>S4iH3X) z1{|*O*`~)V%04s1+O)728QE^-`^F~P)!hDJvipN}1BMICb2o4?-f48++WmUgeM3|G z4W9Ofk3K#xT53J5K1RFdb-3R%os!jgpOX0g%!!Ubw%@cp>g(_JLna zMq+ivoY0B(8Mhroj@_Re!X3r2;^Ipu$77Q=v~(9X{|lN@(YY`{gORt-w`aFZq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%$R|JZx3T6NWOH!-n`oeBCY*0n_XCz dGjg_0?3_4rV(Y}IlfSVlvP(!Xm_Fb$1pqD^Pmllr diff --git a/saturn/server/static/icons/remixicon.woff2 b/saturn/server/static/icons/remixicon.woff2 index fc1b74ca70b4c3030e5d0bfc534f1b6077fff952..4ac38dd42e97aeba2ac67bf08d33f12f8b687c9a 100644 GIT binary patch delta 1151 zcmV-_1c3YO2aE|AcTYw#00961000Dx01E&B000Sy000C)kr*C-G75x1gf0O#0weT(UVNRYD9DffNcwAXHr|KcA}t0D|1zw+Mogh-)6lfkqs8S8Lhn07-5a+}$AP z@FUI5^xjPs?f3M5glxWiRE&5g1*idy;uIqIFN%{N?w5Lr37F~je&oA|TvXbDoh?9T z5lN9a!vXPB#Eq<&Om5Z-P*mT80G1wxQDeqU2`SyMbjKzd8FafqI#D*PUA+`<6vs5^ z1TW+=H|nQy1qakWJps5C+Nlu?ioToUX!Nx+R*hZ3i1$r@U%5xX2A`Iz0u0BXfiB0B zlx=K&13DJEglM_HGmHQ%9t!oo>BBF+@{@9B6tpG}M&ut)fw*WahH^yIaOG&{f`JcR z(C~!|0$(|fg4{XX0;RwcNOLdTM)H9QjZ<0amlPM*7n_$b9Y1s zs!XDAf53ISM{e2j^3BBpadPv|AL{1S&N1LuPo0{7R~PZMfS4^GI(qc)-MP6qD%24> zE}CMzdN1NTh^5iTj?R7Qc=-@b>9EI7kByx+7J{&eFDkYCx1Vc1)SOcTPxt@5ruMdb zKi_Svw!Rq%;DVRJ$eR_KAFxsR+8d(wpTnE0!2|w3D|_Jh-l@*w%nZ&}eU|I9KTL{zV1$&~?+zf{?$4 zf^rs@>He0S#E=nBoo}4|p!aMQ1YHPtbO|rkw;0s7a z`O&PDdMoI8@DC(L6`t8q8;yd?DSMc$m*T2GyVPzLTD`R>y`xB~Cm+H}G=lORx{e_Q zjkPeGjw1PX($xSdr&IF-w8ppmr5lllb z+h&IOU^`z#b~xH9^Nc*=`H)0zh799gHXtz{^(r85)B)8SXqEj1=@`*9lRR#0OcU8~ zSqfA!R+yF>jCNQ{D+?5y&aRhB R4LT)g6s-}@A=)HXDgpdo8xH^g delta 990 zcmV<410np33G4?LcTYw#00961000B*01E&B000Q2000A?kr*C-914R7g8~6I0weEyprscysH&vf;01(@mf7g-inLbC#$W!tFl4o~nv z`4;gEF14MU;W_bt3IbRv(-76XW&7@=ju|**9CVp0Bj5#J=hj@+ zOJoBMsQ_%1pb?kf{&%XX8$%ND~qI>YTt-f|9FA|aoOd6M*vhuqvnoD92*+GW@kg- zTTh^XH)OXD1i&od1cCg=4GNu^8Kgu}?#PT!J~EEP!-p2v{r>%M{2=Z*EMrVQs)A7Q zfPbU={qBQS-&=Th)$Ij$;#ChHE`0Q8^@9fs?%$uCwt5%J>QoZRnW?LGiw;$q#NB6y zbzyhGPMcnTF7+1f2}21p5eX_th5hRZ{Cit^St_>z}0WaH(+mp2AA z|1TBZP?!nu5>wXn0WkAS8i45#UKc>%^N!k&`lr?Z?T6pZz{|WlL1}mKHz8R`x=4MA zMw`_cLFS}?15Mr9G!$Ts4Zf%(Wb#r&8*~nX5U?brC_FMLnt(iT1By}{Ldq#!1~n;` zNi^Dj6q1cY8Zp5!wdV;g;2}kk$~&cAY5yS1pv9*+XMSYAofb0H;_t>iZc zIj%az8o{Obo0rv7&C4<0!maoGHBC0f9$)ZD z=@f=<4su*|inRnpBu}=io~qP^;Q!Iu1jmCX^{Of%J&t`Vq=C@5BU%4c<~X*rRwOWD z_1Y_WA=*zrakn$?ahN(M}PH45AMh&cphlw^>j;F2XsE)FzUcC)H zmas@TrEu##e@#ZDqK!upbyBM<)`ss-_P6b_d(vE#Xffgt1
{% 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 %}