diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2020-07-08 00:01:13 +0200 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2020-07-08 00:01:13 +0200 |
commit | 0bdec52cbf4c563bf08791fcd447fcfe6d1ec349 (patch) | |
tree | 2a7475b0b5b338e5b875304f3627ca682dc558fc /module | |
parent | Remove faulty top error handler from main. (diff) | |
parent | Draft of multiple tabs for HTML popups. (diff) | |
download | calp-0bdec52cbf4c563bf08791fcd447fcfe6d1ec349.tar.gz calp-0bdec52cbf4c563bf08791fcd447fcfe6d1ec349.tar.xz |
Merge branch 'html-popup-tabs'
Firefox decided to work again. It might just be my system that it
slightly unstable?
Diffstat (limited to 'module')
-rw-r--r-- | module/output/html.scm | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/module/output/html.scm b/module/output/html.scm index 3e9f71e6..5b06fe01 100644 --- a/module/output/html.scm +++ b/module/output/html.scm @@ -142,6 +142,18 @@ (div ,body)))) +(define (tabset elements) + (define tabgroup (symbol->string (gensym "tabgroup"))) + + `(div (@ (class "tabgroup")) + ,@(for (i (key body)) in (enumerate elements) + (define id (symbol->string (gensym "tab"))) + `(div (@ (class "tab")) + (input (@ (type "radio") (id ,id) (name ,tabgroup) + ,@(when (zero? i) '((checked))))) + (label (@ (for ,id) (style "top: " ,(* 6 i) "ex")) ,key) + (div (@ (class "content")) ,body))))) + (define (popup ev id) `(div (@ (class "popup-container") (id ,id)) (div (@ (class "popup")) @@ -156,7 +168,11 @@ title: "Ladda ner" href: (string-append "/calendar/" (prop ev 'UID) ".ics"))) - ,(fmt-single-event ev)))) + ,(tabset + `(("📅" ,(fmt-single-event ev)) + ;; TODO only on debug/edit? + ("</>" (script (@ (type "application/calendar+xml")) + ,((@ (output xcal) vcomponent->sxcal) ev)))))))) @@ -202,9 +218,6 @@ (eq? 'TENTATIVE (prop ev 'PARTSTAT))) " tentative")) (data-tipped-options ,(format #f "inline: '~a'" popup-id))))) - ,(when (debug) - `(script (@ (type "application/calendar+xml")) - ,((@ (output xcal) vcomponent->sxcal) ev))) ,(when (prop ev 'RRULE) `(span (@ (class "repeating")) "↺")) ,((get-config 'summary-filter) ev (prop ev 'SUMMARY)) |