From b24e655996463bbb17d732d81788b410f28ae05d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Tue, 7 Apr 2020 09:39:07 +0200 Subject: Add location to blocks, rrules and last-modified to text in html. --- module/output/html.scm | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) (limited to 'module/output') diff --git a/module/output/html.scm b/module/output/html.scm index 44e9d8d3..371edba9 100644 --- a/module/output/html.scm +++ b/module/output/html.scm @@ -159,7 +159,14 @@ (div (@ (class "popup")) ,(event-debug-html ev)) (div (@ (class "body")) - ,((get-config 'summary-filter) ev (attr ev 'SUMMARY)))))) + ,(when (attr ev 'RRULE) + `(span (@ (class "repeating")) "↺")) + ,((get-config 'summary-filter) ev (attr ev 'SUMMARY)) + ,(when (attr ev 'LOCATION) + `(span (@ (class "location")) + ,(string-map (lambda (c) (if (char=? c #\,) #\newline c)) + (attr ev 'LOCATION)))) + )))) ) @@ -308,14 +315,29 @@ " tentative"))) (h3 (a (@ (href "#" ,(date-link (as-date (attr ev 'DTSTART)))) (class "hidelink")) + ,(when (attr ev 'RRULE) + `(span (@ (class "repeating")) "↺")) ,(attr ev 'SUMMARY))) (div ,(call-with-values (lambda () (fmt-time-span ev)) (match-lambda* [(start end) `(div ,start " — " ,end)] [(start) `(div ,start)])) ,(when (and=> (attr ev 'LOCATION) (negate string-null?)) - `(div (b "Plats: ") ,(attr ev 'LOCATION))) - ,(and=> (attr ev 'DESCRIPTION) (lambda (str) ((get-config 'description-filter) ev str)))))) + `(div (b "Plats: ") (div (@ (class "location")),(string-map (lambda (c) (if (char=? c #\,) #\newline c)) (attr ev 'LOCATION))))) + ,(and=> (attr ev 'DESCRIPTION) (lambda (str) ((get-config 'description-filter) ev str))) + ,(awhen (attr ev 'RRULE) + `(span (@ (class "rrule")) + "Upprepas " + ,((compose (@ (vcomponent recurrence display) format-recurrence-rule) + (@ (vcomponent recurrence parse) parse-recurrence-rule)) + it) + ;; TODO exdate + ".")) + ,(when (attr ev 'LAST-MODIFIED) + `(span (@ (class "last-modified")) "Senast ändrad " + ,(datetime->string (attr ev 'LAST-MODIFIED) "~1 ~H:~M")) + ) + ))) ;; Single event in side bar (text objects) (define (fmt-day day) -- cgit v1.2.3