diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2020-07-11 17:39:27 +0200 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2020-07-11 17:39:27 +0200 |
commit | 55803c4dc76c08eea490c1f46b863b4921f080b7 (patch) | |
tree | 238c910464bdecced76b400e22114e3a8b266fe0 /module/output/html.scm | |
parent | Add (vcomponent build). (diff) | |
download | calp-55803c4dc76c08eea490c1f46b863b4921f080b7.tar.gz calp-55803c4dc76c08eea490c1f46b863b4921f080b7.tar.xz |
HTML Change template code for new events.
Diffstat (limited to 'module/output/html.scm')
-rw-r--r-- | module/output/html.scm | 36 |
1 files changed, 17 insertions, 19 deletions
diff --git a/module/output/html.scm b/module/output/html.scm index fcf69888..feb68795 100644 --- a/module/output/html.scm +++ b/module/output/html.scm @@ -6,6 +6,7 @@ #:use-module (vcomponent) #:use-module (vcomponent group) #:use-module (vcomponent datetime) + #:use-module (vcomponent build) #:use-module (util) #:use-module (util app) #:use-module (util exceptions) @@ -804,25 +805,22 @@ (extract 'DTSTART)) (cdr (stream-car evs)))))) ,@(stream->list (stream-map fmt-day evs)))) - (template (@ (id "popup-template")) - (div (@ (class "popup-container")) - (div (@ (class "popup")) - ;; TODO have dummy calendar for events under creation - (nav (@ (class "popup-control CAL_Calendar")) - ;; TODO why isn't this using the @var{btn} procedure. - (button (@ (title "Stäng") (onclick "") (class "btn close-tooltip")) (div "×"))) - (form - (article (@ (class "eventtext CAL_bg_Calendar")) - (h3 (input (@ (type "text") - (name "summary") - (placeholder "Summary") - (required)))) - (div (div (input (@ (type "time") (name "dtstart") (required))) - " — " - (input (@ (type "time") (name "dtend") (required)))) - (textarea (@ (name "description") - (placeholder "Description"))) - (input (@ (type "submit")))))))))))))) + + ;; This would idealy be a <template> element, but there is some + ;; form of special case with those in xhtml, but I can't find + ;; the documentation for it. + (div (@ (class "template") (id "event-template")) + ,(let ((cal (vcalendar + name: "Generated" + children: (list (vevent + uid: (uuidgen) + dtstart: (datetime) + dtend: (datetime) + summary: "New Event"))))) + (caddar ; strip <a> tag + (make-block (car (children cal)) + `((class " generated ") + (style " width: calc(100% * var(--editmode)) "))))))))))) ;; file existing but is of wrong type, |