From 4cf9587a5188e5853bbcf97b71109e7cb9331d9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Sun, 3 Oct 2021 21:54:30 +0200 Subject: work --- module/calp/html/vcomponent.scm | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'module/calp/html/vcomponent.scm') diff --git a/module/calp/html/vcomponent.scm b/module/calp/html/vcomponent.scm index c5ae452d..1b97e9b8 100644 --- a/module/calp/html/vcomponent.scm +++ b/module/calp/html/vcomponent.scm @@ -22,6 +22,7 @@ format-summary format-recurrence-rule )) + :use-module ((calp util config) :select (get-config)) ) (define-public (compact-event-list list) @@ -203,11 +204,19 @@ `(vevent-edit (@ (class "vevent") (data-uid ,(prop ev 'UID))))) -(define-public (edit-template) +(define-public (edit-template calendars) `(div (@ (class " eventtext edit-tab ")) (form (@ (class "edit-form")) - ;; TODO actually have calendar list here, since we are just a template - (div (@ (class "dropdown-goes-here"))) + (select (@ (class "calendar-selection")) + (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))) (h3 (input (@ (type "text") (placeholder "Sammanfattning") (name "summary") (required) @@ -605,10 +614,6 @@ `(("๐Ÿ“…" title: "Redigera" ,(fmt-for-edit ev)))) - ,@(when (debug) - `(("๐Ÿธ" title: "Debug" - (div - (pre ,(prop ev 'UID)))))) ("โค“" title: "Nedladdning" (div (@ (class "eventtext") (style "font-family:sans")) -- cgit v1.2.3