diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2020-08-13 10:43:33 +0200 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2020-08-13 10:43:33 +0200 |
commit | a902eb51621521d45c648d6a4d06d70d981dfaeb (patch) | |
tree | afc31d4d17fa3939585ad30878b5b690d3b80db3 /module/html/view | |
parent | Add TODO's (diff) | |
parent | Comment about generalizing. (diff) | |
download | calp-a902eb51621521d45c648d6a4d06d70d981dfaeb.tar.gz calp-a902eb51621521d45c648d6a4d06d70d981dfaeb.tar.xz |
Merge branch 'calchooser' into master
Diffstat (limited to '')
-rw-r--r-- | module/html/view/calendar.scm | 28 |
1 files changed, 25 insertions, 3 deletions
diff --git a/module/html/view/calendar.scm b/module/html/view/calendar.scm index a15b5c1d..a0de3551 100644 --- a/module/html/view/calendar.scm +++ b/module/html/view/calendar.scm @@ -16,10 +16,14 @@ )) :use-module (html config) :use-module (html util) + + :use-module (util config) + :use-module (srfi srfi-1) :use-module (srfi srfi-26) :use-module (srfi srfi-41) :use-module (srfi srfi-41 util) + :use-module ((vcomponent group) :select (group-stream get-groups-between)) :use-module ((git) @@ -292,10 +296,22 @@ (summary "Calendar list") (ul ,@(map (lambda (calendar) - `(li (@ (class "CAL_bg_" + `(li (@ (class "CAL_" ,(html-attr (prop calendar 'NAME)))) ,(prop calendar 'NAME))) - calendars)))) + calendars)) + (div (@ (id "calendar-dropdown-template") (class "template")) + (select + (option "- Choose a Calendar -") + ,@(let ((dflt (get-config 'default-calendar))) + (map (lambda (calendar) + (define name (prop calendar 'NAME)) + `(option (@ (value ,(html-attr name)) + ,@(when (string=? name dflt) + '((selected)))) + ,name)) + calendars))) + ))) ;; List of events (div (@ (class "eventlist") @@ -304,6 +320,8 @@ ;; but "spill" into our time span. (section (@ (class "text-day")) (header (h2 "Tidigare")) + ;; TODO this group gets styles applied incorrectly. + ;; Figure out way to merge it with the below call. ,@(stream->list (stream-map fmt-single-event @@ -325,7 +343,11 @@ ;; cloned mulitple times. dtstart: (datetime) dtend: (datetime) - summary: "New Event")))) + summary: "" + ;; force a description field, + ;; but don't put anything in + ;; it. + description: "")))) (event (car (children cal)))) `((div (@ (class "template event-container") (id "event-template") ;; Only needed to create a duration. So actual dates |