diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2020-08-12 15:57:55 +0200 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2020-08-12 15:57:55 +0200 |
commit | fd72079c5163f9881872d70b64aafde03b8b2385 (patch) | |
tree | 6840d4c4bf511f0e4a2c53fd0fe74240e076775c /module/html/view | |
parent | Calendar names now encoded with modified base64 (diff) | |
download | calp-fd72079c5163f9881872d70b64aafde03b8b2385.tar.gz calp-fd72079c5163f9881872d70b64aafde03b8b2385.tar.xz |
Add option for default calendar.
Diffstat (limited to 'module/html/view')
-rw-r--r-- | module/html/view/calendar.scm | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/module/html/view/calendar.scm b/module/html/view/calendar.scm index ed6ea066..76d1e79f 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) @@ -288,13 +292,17 @@ ,(html-attr (prop calendar 'NAME)))) ,(prop calendar 'NAME))) calendars)) - (div (@ (id "calendar-dropdown-template") (class "template")) - (select + (div (@ (id "calendar-dropdown-template") (class "template")) + (select (option "- Choose a Calendar -") - ,@(map (lambda (calendar) - `(option (@ (value ,(html-attr (prop calendar 'NAME)))) - ,(prop calendar 'NAME))) - calendars)) + ,@(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 |