diff options
Diffstat (limited to 'module')
-rw-r--r-- | module/calp/entry-points/server.scm | 2 | ||||
-rw-r--r-- | module/calp/html/vcomponent.scm | 24 | ||||
-rw-r--r-- | module/calp/html/view/calendar.scm | 1 | ||||
-rw-r--r-- | module/calp/server/routes.scm | 5 | ||||
-rw-r--r-- | module/vcomponent/xcal/parse.scm | 5 |
5 files changed, 26 insertions, 11 deletions
diff --git a/module/calp/entry-points/server.scm b/module/calp/entry-points/server.scm index 55f84c1a..a456c292 100644 --- a/module/calp/entry-points/server.scm +++ b/module/calp/entry-points/server.scm @@ -78,7 +78,7 @@ (catch 'system-error (lambda () - (start-server `(family: ,family port: ,port host: ,addr))) + (start-server (list family: family port: port host: addr))) ;; probably address already in use (lambda (err proc fmt args errno) diff --git a/module/calp/html/vcomponent.scm b/module/calp/html/vcomponent.scm index 5d10c996..cd8c207e 100644 --- a/module/calp/html/vcomponent.scm +++ b/module/calp/html/vcomponent.scm @@ -7,7 +7,7 @@ :use-module ((text util) :select (add-enumeration-punctuation)) :use-module ((web uri-query) :select (encode-query-parameters)) :use-module (calp html util) - :use-module ((calp html config) :select (edit-mode)) + :use-module ((calp html config) :select (edit-mode debug)) :use-module ((calp html components) :select (btn tabset form with-label)) :use-module ((calp util color) :select (calculate-fg-color)) :use-module ((vcomponent recurrence internal) :prefix #{rrule:}#) @@ -371,6 +371,10 @@ (define (editable-repeat-info event) `(div (@ (class "eventtext")) (h2 "Upprepningar") + ,@(when (debug) + '((button (@ (style "position:absolute;right:1ex;top:1ex") + (onclick "console.log(event_from_popup(this.closest('.popup-container')).properties.rrule.asJcal());")) + "js"))) (table (@ (class "recur-components bind") (name "rrule") (data-bindby "bind_recur")) @@ -531,10 +535,10 @@ (list (btn "🖊️" title: "Redigera" - onclick: "place_in_edit_mode(document.getElementById(this.closest('.popup-container').id.substr(5)))") + onclick: "place_in_edit_mode(event_from_popup(this.closest('.popup-container')))") (btn "🗑" title: "Ta bort" - onclick: "remove_event(document.getElementById(this.closest('.popup-container').id.substr(5)))")))) + onclick: "remove_event(event_from_popup(this.closest('.popup-container')))")))) ,(tabset `(("📅" title: "Översikt" @@ -546,10 +550,16 @@ ("⤓" title: "Nedladdning" (div (@ (class "eventtext") (style "font-family:sans")) (h2 "Ladda ner") - (ul (li (a (@ (href "/calendar/" ,(prop ev 'UID) ".ics")) - "som iCal")) - (li (a (@ (href "/calendar/" ,(prop ev 'UID) ".xcs")) - "som xCal"))))) + (div (@ (class "side-by-side")) + (ul (li (a (@ (href "/calendar/" ,(prop ev 'UID) ".ics")) + "som iCal")) + (li (a (@ (href "/calendar/" ,(prop ev 'UID) ".xcs")) + "som xCal"))) + ,@(when (debug) + `((ul + (li (button (@ (onclick "console.log(event_to_jcal(event_from_popup(this.closest('.popup-container'))));")) "js")) + (li (button (@ (onclick "console.log(jcal_to_xcal(event_to_jcal(event_from_popup(this.closest('.popup-container')))));")) "xml")))))) + )) ,@(when (prop ev 'RRULE) `(("↺" title: "Upprepningar" class: "repeating" diff --git a/module/calp/html/view/calendar.scm b/module/calp/html/view/calendar.scm index f66e347c..3f607bb7 100644 --- a/module/calp/html/view/calendar.scm +++ b/module/calp/html/view/calendar.scm @@ -106,6 +106,7 @@ (script (@ (defer) (src "/static/types.js"))) (script (@ (defer) (src "/static/lib.js"))) + (script (@ (defer) (src "/static/jcal.js"))) (script (@ (defer) (src "/static/dragable.js"))) (script (@ (defer) (src "/static/clock.js"))) (script (@ (defer) (src "/static/popup.js"))) diff --git a/module/calp/server/routes.scm b/module/calp/server/routes.scm index 276513f5..16ab2662 100644 --- a/module/calp/server/routes.scm +++ b/module/calp/server/routes.scm @@ -185,6 +185,8 @@ ;; (vcalendar ;; (vevent ...)))) ;; @end example + + ;; TODO ;; However, *PI* will probably be omited, and currently events ;; are sent without the vcalendar part. Earlier versions ;; Also omitted the icalendar part. And I'm not sure if the @@ -197,7 +199,8 @@ (move-to-namespace ;; TODO Multiple event components (car ((sxpath '(// IC:vevent)) - (xml->sxml data namespaces: '((IC . "urn:ietf:params:xml:ns:icalendar-2.0"))))) + (xml->sxml data namespaces: + '((IC . "urn:ietf:params:xml:ns:icalendar-2.0"))))) #f)) (lambda (err port . args) (return (build-response code: 400) diff --git a/module/vcomponent/xcal/parse.scm b/module/vcomponent/xcal/parse.scm index 6b877b9f..6b752874 100644 --- a/module/vcomponent/xcal/parse.scm +++ b/module/vcomponent/xcal/parse.scm @@ -50,8 +50,9 @@ [(recur) (apply (@ (vcomponent recurrence internal) make-recur-rule) - (for (k v) in value - (list (symbol->keyword k) v)))] + (concatenate + (for (k v) in value + (list (symbol->keyword k) v))))] [(time) (parse-iso-time (car value))] |