diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2022-06-12 00:13:02 +0200 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2022-06-12 00:13:02 +0200 |
commit | da8d1467dff8b27af7a3ae649d92ead5cbf704d8 (patch) | |
tree | cd4231abb8ec24d79dd3a4a8b5e563ee2bb82219 /module/calp/html | |
parent | Add number of TODO's. (diff) | |
parent | Handle error for user-additions salar. (diff) | |
download | calp-da8d1467dff8b27af7a3ae649d92ead5cbf704d8.tar.gz calp-da8d1467dff8b27af7a3ae649d92ead5cbf704d8.tar.xz |
Allow HTML output of all routes.
XHTML is still the far supperior format. However; Chrome(-like) browsers
Lighthouse feature is worth quite a bit when it comes to ensuring a good
web page, and Lighthouse refuses to work on anything except text/html.
This is my work-around for that.
Diffstat (limited to 'module/calp/html')
-rw-r--r-- | module/calp/html/components.scm | 1 | ||||
-rw-r--r-- | module/calp/html/view/calendar.scm | 7 | ||||
-rw-r--r-- | module/calp/html/view/calendar/month.scm | 2 | ||||
-rw-r--r-- | module/calp/html/view/calendar/week.scm | 2 |
4 files changed, 6 insertions, 6 deletions
diff --git a/module/calp/html/components.scm b/module/calp/html/components.scm index 9b3e4ce0..6ff59502 100644 --- a/module/calp/html/components.scm +++ b/module/calp/html/components.scm @@ -12,6 +12,7 @@ ((_ (@ attr ...) body ...) `(*TOP* (*PI* xml "version=\"1.0\" encoding=\"utf-8\"") + ,(lambda () (format #t "~%<!DOCTYPE html>~%")) (html (@ (xmlns "http://www.w3.org/1999/xhtml") attr ...) body ...))) ((_ body ...) diff --git a/module/calp/html/view/calendar.scm b/module/calp/html/view/calendar.scm index 6945c5d2..dd94dc16 100644 --- a/module/calp/html/view/calendar.scm +++ b/module/calp/html/view/calendar.scm @@ -102,12 +102,11 @@ (content ,(date->string (date+ end-date (date day: 1)) "~s")))) (script - ,(format #f - " + ,(lambda () (format #t " EDIT_MODE=~:[false~;true~]; window.default_calendar='~a';" - (edit-mode) - (base64encode ((@ (vcomponent) default-calendar))))) + (edit-mode) + (base64encode ((@ (vcomponent) default-calendar)))))) (style ,(format #f "html { diff --git a/module/calp/html/view/calendar/month.scm b/module/calp/html/view/calendar/month.scm index 2b4c888a..205d6049 100644 --- a/module/calp/html/view/calendar/month.scm +++ b/module/calp/html/view/calendar/month.scm @@ -35,7 +35,7 @@ (events-between s e (list->stream long-events))))) (date-range pre-start post-end (date day: 7)))) - `((script "window.VIEW='month';") + `((script ,(lambda () (format #t "window.VIEW='month';"))) (header (@ (class "table-head")) ,(string-titlecase (date->string start-date "~B ~Y"))) (div (@ (class "caltable") diff --git a/module/calp/html/view/calendar/week.scm b/module/calp/html/view/calendar/week.scm index 16337102..b68184f9 100644 --- a/module/calp/html/view/calendar/week.scm +++ b/module/calp/html/view/calendar/week.scm @@ -27,7 +27,7 @@ (define*-public (render-calendar key: calendars events start-date end-date #:allow-other-keys) (let* ((long-events short-events (partition long-event? (stream->list (events-between start-date end-date events)))) (range (date-range start-date end-date))) - `((script "window.VIEW='week';") + `((script ,(lambda () (format #t "window.VIEW='week';"))) (div (@ (class "calendar")) (div (@ (class "days")) ;; Top left area |