aboutsummaryrefslogtreecommitdiff
path: root/module/output
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2019-05-01 16:22:17 +0200
committerHugo Hörnquist <hugo@lysator.liu.se>2019-05-01 16:22:50 +0200
commitf5f363694506edaf50eb1c1f1e1001b94e1d5d1c (patch)
tree0096a895608c7554b2e5ee8bf7ea978d5816a642 /module/output
parentChange .hidelink to color: inherit. (diff)
downloadcalp-f5f363694506edaf50eb1c1f1e1001b94e1d5d1c.tar.gz
calp-f5f363694506edaf50eb1c1f1e1001b94e1d5d1c.tar.xz
Change how attributes are fetched.
Previous version failed when an attribute contained a list. This fixes that, by always returning a circular list, delimited with #f when it loops. Methods for moving through this list is currently lacking.
Diffstat (limited to 'module/output')
-rw-r--r--module/output/html.scm10
1 files changed, 3 insertions, 7 deletions
diff --git a/module/output/html.scm b/module/output/html.scm
index 1c79ad83..c6ba389c 100644
--- a/module/output/html.scm
+++ b/module/output/html.scm
@@ -82,8 +82,7 @@
`(a (@ (href "#" ,(UID ev))
(class "hidelink"))
- (div (@ (class "event CAL_" ,(html-attr (let ((l (attr (parent ev) 'NAME)))
- (if (pair? l) (car l) l)))
+ (div (@ (class "event CAL_" ,(html-attr (attr (parent ev) 'NAME))
,(when (time<? (attr ev 'DTSTART) time)
" continued")
,(when (time<? (add-day time) (attr ev 'DTEND))
@@ -137,8 +136,7 @@
(define (fmt-single-event ev)
`(article (@ (id ,(UID ev))
(class "eventtext CAL_bg_"
- ,(html-attr (let ((l (attr (parent ev) 'NAME)))
- (if (pair? l) (car l) l)))))
+ ,(html-attr (attr (parent ev) 'NAME))))
(h3 (a (@ (href "#" ,(time-link (attr ev 'DTSTART)))
(class "hidelink"))
,(attr ev 'SUMMARY)))
@@ -235,9 +233,7 @@
,(include-css "static/style.css")
(style ,(format #f "~:{.CAL_~a { background-color: ~a; color: ~a }~%.CAL_bg_~a { border-color: ~a }~%~}"
(map (lambda (c)
- (let* ((name (html-attr (if (pair? (attr c 'NAME))
- (car (attr c 'NAME))
- (attr c 'NAME))))
+ (let* ((name (html-attr (attr c 'NAME)))
(bg-color (attr c 'COLOR))
(fg-color (and=> (attr c 'COLOR)
calculate-fg-color)))