aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2020-07-15 00:38:07 +0200
committerHugo Hörnquist <hugo@lysator.liu.se>2020-07-15 00:38:07 +0200
commita90b868136e21f3af07f39eaf63439c619d73d24 (patch)
treedf24b4559b483f3641759a0ef37d969153fc9508
parentFix time input error after emptying. (diff)
downloadcalp-a90b868136e21f3af07f39eaf63439c619d73d24.tar.gz
calp-a90b868136e21f3af07f39eaf63439c619d73d24.tar.xz
HTML Generated events now come without an UID.
-rw-r--r--module/entry-points/server.scm6
-rw-r--r--module/output/html.scm13
2 files changed, 15 insertions, 4 deletions
diff --git a/module/entry-points/server.scm b/module/entry-points/server.scm
index 64204b9d..78950b24 100644
--- a/module/entry-points/server.scm
+++ b/module/entry-points/server.scm
@@ -170,6 +170,12 @@
(return (build-response code: 400)
"Object not a VEVENT\r\n"))
+ ;; NOTE add-event uses the given UID if one is given,
+ ;; but generates its own if not. It might be a good idea
+ ;; to require that UID is unset here, and force users
+ ;; to use a /update endpoint to change events. This to prevent
+ ;; accidental overwriting.
+
(parameterize ((warnings-are-errors #t))
(catch 'warning
(lambda () (add-event calendar event))
diff --git a/module/output/html.scm b/module/output/html.scm
index 56606719..acc93c0e 100644
--- a/module/output/html.scm
+++ b/module/output/html.scm
@@ -221,9 +221,10 @@
(inner x (right-subtree tree))))))
(define* (make-block ev optional: (extra-attributes '())
- key: (popup-id (symbol->string (gensym "popup"))))
+ key: element-id
+ (popup-id (symbol->string (gensym "popup"))))
- `((a (@ (href "#" ,(html-id ev))
+ `((a (@ (href "#" ,(or element-id (html-id ev)))
(class "hidelink"))
(div (@ ,@(assq-merge
extra-attributes
@@ -835,7 +836,10 @@
,(let ((cal (vcalendar
name: "Generated"
children: (list (vevent
- uid: (uuidgen)
+ ;; The event template SHOULD lack
+ ;; a UID, to stop potential problems
+ ;; with conflicts when multiple it's
+ ;; cloned mulitple times.
dtstart: (datetime)
dtend: (datetime)
summary: "New Event")))))
@@ -846,7 +850,8 @@
;; full width. Adding this however completely breaks
;; creation of long events.
;; (style "width:calc(100%*var(--editmode));")
- ))))))))))
+ )
+ element-id: "GENERATED")))))))))