diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2021-11-10 00:09:30 +0100 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2021-11-10 00:12:14 +0100 |
commit | 720863f5e183fb78866041df36ee8bd4f9a42f72 (patch) | |
tree | e4ff1333d980b9ccc0561da3f8f6d53ad17c6a44 /module/calp/server/routes.scm | |
parent | Better handle debug tab. (diff) | |
download | calp-720863f5e183fb78866041df36ee8bd4f9a42f72.tar.gz calp-720863f5e183fb78866041df36ee8bd4f9a42f72.tar.xz |
Calendar colors now handled through html datasets.
Previously css rules for each calendar (governing color) where handled
through CSS classes. This however had the problem that all calendar
names needed to be mapped unto valid classnames, and it brought some
problems with updating it.
This change places the calendar information in the dataset.calendar
attribute. It's still base64 encoded, so special characters don't need
escaping, and XML doesn't trip up.
Diffstat (limited to 'module/calp/server/routes.scm')
-rw-r--r-- | module/calp/server/routes.scm | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/module/calp/server/routes.scm b/module/calp/server/routes.scm index b024ed4f..0bbd1579 100644 --- a/module/calp/server/routes.scm +++ b/module/calp/server/routes.scm @@ -20,7 +20,7 @@ :use-module ((rnrs io ports) :select (get-bytevector-all)) :use-module ((xdg basedir) :prefix xdg-) - :use-module ((calp html util) :select (html-unattr)) + :use-module ((base64) :select (base64decode)) :use-module (web http make-routes) @@ -162,8 +162,7 @@ (format #f "No event with UID '~a'" uid)))) ;; TODO this fails when dtstart is <date>. - ;; @var{cal} should be the name of the calendar encoded with - ;; modified base64. See (calp html util). + ;; @var{cal} should be the name of the calendar encoded in base64. (POST "/insert" (cal data) (unless (and cal data) @@ -174,7 +173,7 @@ ;; NOTE that this leaks which calendar exists, ;; but you can only query for existance. ;; also, the calendar view already show all calendars. - (let* ((calendar-name (html-unattr cal)) + (let* ((calendar-name (base64decode cal)) (calendar (find (lambda (c) (string=? calendar-name (prop c 'NAME))) (get-calendars global-event-object)))) |