From 70dd50111a339fd9fcf54cc2f9670c1313a154a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Tue, 11 Aug 2020 20:25:56 +0200 Subject: Mercge CAL and CAL_bg css classes. --- module/html/vcomponent.scm | 20 +++++++++----------- module/html/view/calendar.scm | 2 +- 2 files changed, 10 insertions(+), 12 deletions(-) (limited to 'module') diff --git a/module/html/vcomponent.scm b/module/html/vcomponent.scm index 308f779a..1b17f039 100644 --- a/module/html/vcomponent.scm +++ b/module/html/vcomponent.scm @@ -50,7 +50,7 @@ ;; (format (current-error-port) "fmt-single-event: ~a~%" (prop ev 'X-HNH-FILENAME)) `(article (@ ,@(assq-merge attributes - `((class "eventtext CAL_bg_" + `((class "eventtext CAL_" ,(html-attr (or (prop (parent ev) 'NAME) "unknown")) ,(when (and (prop ev 'PARTSTAT) (eq? 'TENTATIVE (prop ev 'PARTSTAT))) @@ -119,16 +119,14 @@ (define-public (calendar-styles calendars) `(style - ,(format - #f "~:{.CAL_~a { background-color: ~a; color: ~a }~%.CAL_bg_~a { border-color: ~a }~%~}" - (map (lambda (c) - (let* ((name (html-attr (prop c 'NAME))) - (bg-color (prop c 'COLOR)) - (fg-color (and=> (prop c 'COLOR) - calculate-fg-color))) - (list name (or bg-color 'white) (or fg-color 'black) - name (or bg-color 'black)))) - calendars)))) + ,(format #f "~:{.CAL_~a { --color: ~a; --complement: ~a }~%~}" + (map (lambda (c) + (let* ((name (html-attr (prop c 'NAME))) + (bg-color (prop c 'COLOR)) + (fg-color (and=> (prop c 'COLOR) + calculate-fg-color))) + (list name (or bg-color 'white) (or fg-color 'black)))) + calendars)))) ;; "Physical" block in calendar view (define*-public (make-block ev optional: (extra-attributes '())) diff --git a/module/html/view/calendar.scm b/module/html/view/calendar.scm index 7d38140f..4fad41c8 100644 --- a/module/html/view/calendar.scm +++ b/module/html/view/calendar.scm @@ -284,7 +284,7 @@ (summary "Calendar list") (ul ,@(map (lambda (calendar) - `(li (@ (class "CAL_bg_" + `(li (@ (class "CAL_" ,(html-attr (prop calendar 'NAME)))) ,(prop calendar 'NAME))) calendars)))) -- cgit v1.2.3