aboutsummaryrefslogtreecommitdiff
path: root/module
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2020-06-30 01:16:35 +0200
committerHugo Hörnquist <hugo@lysator.liu.se>2020-07-07 13:10:38 +0200
commit0539154c382cfdfe78d9d39d5fe0bbae2047b67d (patch)
tree284fc6d59a2a47991ec14e627fe585c3f6d80998 /module
parentHTTP POST insertion works. (diff)
downloadcalp-0539154c382cfdfe78d9d39d5fe0bbae2047b67d.tar.gz
calp-0539154c382cfdfe78d9d39d5fe0bbae2047b67d.tar.xz
Add basic event creation from HTML.
Diffstat (limited to 'module')
-rw-r--r--module/entry-points/server.scm3
-rw-r--r--module/output/html.scm19
2 files changed, 21 insertions, 1 deletions
diff --git a/module/entry-points/server.scm b/module/entry-points/server.scm
index 3356a142..f6d273ba 100644
--- a/module/entry-points/server.scm
+++ b/module/entry-points/server.scm
@@ -146,6 +146,9 @@
(return (build-response code: 400)
(format #f "~?~%" fmt args)))))
+ (format (current-error-port)
+ "Event inserted ~a~%" (attr event 'UID))
+
(return '((content-type text/plain))
"Event inserted\r\n"))))
diff --git a/module/output/html.scm b/module/output/html.scm
index 9cdd874a..5c963482 100644
--- a/module/output/html.scm
+++ b/module/output/html.scm
@@ -758,7 +758,24 @@
(compose (cut date/-time<? <> start-date)
(extract 'DTSTART))
(cdr (stream-car evs))))))
- ,@(stream->list (stream-map fmt-day evs))))))))
+ ,@(stream->list (stream-map fmt-day evs))))
+ (template (@ (id "popup-template"))
+ (div (@ (class "popup-container"))
+ (div (@ (class "popup"))
+ (nav (@ (class "popup-control CAL_Calendar"))
+ (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")))))))))))))
;; file existing but is of wrong type,