aboutsummaryrefslogtreecommitdiff
path: root/module/calp/html/view/calendar.scm
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2021-09-29 23:36:21 +0200
committerHugo Hörnquist <hugo@lysator.liu.se>2021-09-29 23:36:21 +0200
commit1484155c211fe8452344ffdc501e858706ecbc51 (patch)
tree64906707a13f817f2175bd9a6251ff87fb695043 /module/calp/html/view/calendar.scm
parentAdd debug tab to HTML popups. (diff)
downloadcalp-1484155c211fe8452344ffdc501e858706ecbc51.tar.gz
calp-1484155c211fe8452344ffdc501e858706ecbc51.tar.xz
Start rework on js setup.
Diffstat (limited to 'module/calp/html/view/calendar.scm')
-rw-r--r--module/calp/html/view/calendar.scm64
1 files changed, 42 insertions, 22 deletions
diff --git a/module/calp/html/view/calendar.scm b/module/calp/html/view/calendar.scm
index 4574f517..00451984 100644
--- a/module/calp/html/view/calendar.scm
+++ b/module/calp/html/view/calendar.scm
@@ -111,12 +111,16 @@
(script (@ (defer) (src "/static/clock.js")))
(script (@ (defer) (src "/static/popup.js")))
(script (@ (defer) (src "/static/rrule.js")))
- (script (@ (defer) (src "/static/binders.js")))
+ ;; (script (@ (defer) (src "/static/binders.js")))
(script (@ (defer) (src "/static/server_connect.js")))
- (script (@ (defer) (src "/static/input_list.js")))
+ ;; (script (@ (defer) (src "/static/input_list.js")))
(script (@ (defer) (src "/static/date_time.js")))
- (script (@ (defer) (src "/static/vcal.js")))
+ ;; (script (@ (defer) (src "/static/vcal.js")))
(script (@ (defer) (src "/static/script.js")))
+ (script (@ (defer) (src "/static/globals.js")))
+
+ ;; on load
+
,(calendar-styles calendars)
,@(when (debug)
@@ -251,15 +255,15 @@
`(li (@ (class "CAL_"
,(html-attr (prop calendar 'NAME))))
(a (@ (href "/search?"
- ,((@ (web uri-query) encode-query-parameters)
- `((q . (and (date/-time<=?
- ,(current-datetime)
- (prop event 'DTSTART))
- ;; TODO this seems to miss some calendars,
- ;; I belive it's due to some setting X-WR-CALNAME,
- ;; which is only transfered /sometimes/ into NAME.
- (string=? ,(->string (prop calendar 'NAME))
- (or (prop (parent event) 'NAME) ""))))))))
+ ,((@ (web uri-query) encode-query-parameters)
+ `((q . (and (date/-time<=?
+ ,(current-datetime)
+ (prop event 'DTSTART))
+ ;; TODO this seems to miss some calendars,
+ ;; I belive it's due to some setting X-WR-CALNAME,
+ ;; which is only transfered /sometimes/ into NAME.
+ (string=? ,(->string (prop calendar 'NAME))
+ (or (prop (parent event) 'NAME) ""))))))))
,(prop calendar 'NAME))))
calendars))
(div (@ (id "calendar-dropdown-template") (class "template"))
@@ -311,17 +315,19 @@
;; it.
description: ""))))
(event (car (children cal))))
- `((div (@ (class "template event-container") (id "event-template")
- ;; Only needed to create a duration. So actual dates
- ;; dosen't matter
- (data-start "2020-01-01")
- (data-end "2020-01-02"))
- ,(caddar ; strip <a> tag
- (make-block event `((class " generated ")))))
+ `(
+ ;; (div (@ (class "template event-container") (id "event-template")
+ ;; ;; Only needed to create a duration. So actual dates
+ ;; ;; dosen't matter
+ ;; (data-start "2020-01-01")
+ ;; (data-end "2020-01-02"))
+ ;; ,(caddar ; strip <a> tag
+ ;; (make-block event `((class " generated ")))))
;; TODO merge this into the event-set, add attribute
;; for non-displaying elements.
- (div (@ (class "template") (id "popup-template"))
- ,(popup event (string-append "popup" (html-id event))))))
+ ;; (div (@ (class "template") (id "popup-template"))
+ ;; ,(popup event (string-append "popup" (html-id event))))
+ ))
;; Auto-complets when adding new fields to a component
;; Any string is however still valid.
@@ -344,4 +350,18 @@
RDATE RRULE ACTION REPEAT
TRIGGER CREATED DTSTAMP LAST-MODIFIED
SEQUENCE REQUEST-STATUS
- ))))))
+ )))
+
+ (div (@ (style "display:none !important;")
+ (id "xcal-data"))
+ ,((@ (vcomponent xcal output) ns-wrap)
+ (map (@ (vcomponent xcal output) vcomponent->sxcal)
+ (stream->list
+ (filter-sorted-stream
+ (lambda (ev)
+ ((@ (vcomponent datetime) event-overlaps?)
+ ev start-date
+ (date+ end-date (date day: 1))))
+ events))))))
+
+ ))