From 6ad74ec3383b7a8d8403cdf185caabd4332109a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Mon, 28 Sep 2020 01:01:45 +0200 Subject: Made timeinput checkbox needlesly fancy. --- module/calp/html/vcomponent.scm | 134 ++++++++++++++++++++++------------------ 1 file changed, 75 insertions(+), 59 deletions(-) (limited to 'module') diff --git a/module/calp/html/vcomponent.scm b/module/calp/html/vcomponent.scm index 67634492..54bfb9e8 100644 --- a/module/calp/html/vcomponent.scm +++ b/module/calp/html/vcomponent.scm @@ -125,65 +125,81 @@ optional: (attributes '()) key: (fmt-header list)) `(div (@ (class " eventtext ")) - (div (@ (class "edit-form")) - (h3 (input (@ (type "text") (class "summary") - (placeholder "Sammanfattning") - (name "summary") (required) - (value ,(prop ev 'SUMMARY))))) - - ,@(with-label "Heldag?" `(input (@ (name "wholeday") (type "checkbox")))) - - ,@(let ((start (prop ev 'DTSTART))) - (with-label "Start" - `(div (input (@ (type "date") - (name "dtstart-date") - (value ,(date->string (as-date start))))) - (input (@ ,@(when (date? start) - '((style "display:none"))) - (type "time") - (name "dtstart-end") - (value ,(time->string (as-time start)))))))) - ,@(let ((end (prop ev 'DTEND))) - (with-label "Slut" - `(div (input (@ (type "date") - (name "dtend-date") - ,@(when end `((value ,(date->string (as-date end))))))) - (input (@ ,@(when (date? end) - '((style "display:none"))) - (type "time") - (name "dtend-time") - ,@(when end `((value ,(time->string (as-time end))))) - ))))) - - ,@(with-label - "Plats" - `(input (@ (placeholder "Plats") - (name "location") - (type "text") - (value ,(or (prop ev 'LOCATION) ""))))) - - ,@(with-label - "Beskrivning" - `(textarea (@ (placeholder "Beskrivning") - (name "description")) - ,(prop ev 'DESCRIPTION))) - - ,@(with-label - "Kategorier" - `(div (@ (class "inline-edit")) - ,@(awhen (prop ev 'CATEGORIES) - (map (lambda (c) - `(input (@ (size 2) - (value ,c)))) - it)) - - (input (@ (class "final") - (size 2) - (type "text") - )))) - - (input (@ (type "submit"))) - ))) + (form (@ (class "edit-form")) + (h3 (input (@ (type "text") + (placeholder "Sammanfattning") + (name "summary") (required) + (value ,(prop ev 'SUMMARY))))) + + ,(let ((start (prop ev 'DTSTART)) + (end (prop ev 'DTEND))) + `(div (@ (class "timeinput")) + + (input (@ (type "date") + (name "dtstart-date") + (style "grid-column:1;grid-row:2") + (value ,(date->string (as-date start))))) + + (input (@ (type "date") + (name "dtend-date") + (style "grid-column:1;grid-row:3") + ,@(when end `((value ,(date->string (as-date end))))))) + + ,@(with-label + "Heldag?" + `(input (@ (type "checkbox") (style "display:none") + (name "wholeday")))) + + (input (@ ,@(when (date? start) + '((style "display:none"))) + (type "time") + (name "dtstart-end") + (style "grid-column:3;grid-row:2") + (value ,(time->string (as-time start))))) + + (input (@ ,@(when (date? end) + '((style "display:none"))) + (type "time") + (name "dtend-time") + (style "grid-column:3;grid-row:3") + ,@(when end `((value ,(time->string (as-time end))))) + )))) + + ,@(with-label + "Plats" + `(input (@ (placeholder "Plats") + (name "location") + (type "text") + (value ,(or (prop ev 'LOCATION) ""))))) + + ,@(with-label + "Beskrivning" + `(textarea (@ (placeholder "Beskrivning") + (name "description")) + ,(prop ev 'DESCRIPTION))) + + ,@(with-label + "Kategorier" + `(div (@ (class "inline-edit")) + ,@(awhen (prop ev 'CATEGORIES) + (map (lambda (c) + `(input (@ (size 2) + (value ,c)))) + it)) + + (input (@ (class "final") + (size 2) + (type "text") + )))) + + #; + (input (@ (type "text") + (list "known-fields") + (placeholder "Nytt fält"))) + + + (input (@ (type "submit"))) + ))) ;; Single event in side bar (text objects) -- cgit v1.2.3