From 0d5277dc2db381f60604c5df93984c1abcfba30f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Fri, 20 Nov 2020 22:07:40 +0100 Subject: Start adding binding stuff too rrule edit form. --- module/calp/html/vcomponent.scm | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) (limited to 'module') diff --git a/module/calp/html/vcomponent.scm b/module/calp/html/vcomponent.scm index 7d057b67..60f270f7 100644 --- a/module/calp/html/vcomponent.scm +++ b/module/calp/html/vcomponent.scm @@ -372,7 +372,8 @@ (td ,(case key ((freq) - `(select (option "-") + `(select (@ (class "bind-rr") (name "freq")) + (option "-") ,@(map (lambda (x) `(option (@ (value ,x) ,@(awhen (prop event 'RRULE) (awhen (rrule:freq it) @@ -386,10 +387,13 @@ ((until) (if (date? (prop event 'DTSTART)) `(input (@ (type "date") + (name "until") + (class "bind-rr") (value ,(awhen (prop event 'RRULE) (awhen (rrule:until it) (date->string it)))))) - `(span + `(span (@ (class "bind-rr date-time") + (name "until")) (input (@ (type "date") (value ,(awhen (prop event 'RRULE) (awhen (rrule:until it) @@ -404,13 +408,19 @@ `(input (@ (type number) (min 0) (size 4) (value ,(awhen (prop event 'RRULE) (or (rrule:count it) ""))) + (name "count") + (class "bind-rr") ))) ((interval) `(input (@ (type number) (min 0) (size 4) (value ,(awhen (prop event 'RRULE) - (or (rrule:interval it) "")))))) + (or (rrule:interval it) "")))) + (name "interval") + (class "bind-rr") + )) ((wkst) - `(select (option "-") + `(select (@ (name "wkst") (class "bind-rr")) + (option "-") ,@(map (lambda (i) `(option (@ (value ,i) ,@(awhen (prop event 'RRULE) @@ -434,7 +444,8 @@ '((selected)) '())) ,(week-day-name i))) (iota 7))))))) - `(div (@ (class "input-list")) + ;; TODO how does this bind? + `(div (@ (class "bind-rr input-list")) ,@(cond ((and=> (prop event 'RRULE) rrule:byday) => (lambda (it) (map input it))) @@ -468,7 +479,8 @@ ((byweekno) 53) ((bymonth) 12) ((bysetpos) 366)))))))) - `(div (@ (class "input-list")) + `(div (@ (name ,key) + (class "bind-rr input-list")) ,@(map input (awhen (prop event 'RRULE) (or ((case key -- cgit v1.2.3