From aa9e98374f79ffcc7f017744c22fae67110cdb50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Thu, 14 Jan 2021 01:09:09 +0100 Subject: Handle types of xcal rrule. --- module/vcomponent/xcal/parse.scm | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) (limited to 'module') diff --git a/module/vcomponent/xcal/parse.scm b/module/vcomponent/xcal/parse.scm index 6ae8c2f9..124a91f4 100644 --- a/module/vcomponent/xcal/parse.scm +++ b/module/vcomponent/xcal/parse.scm @@ -58,7 +58,31 @@ ((@ (vcomponent recurrence parse) rfc->datetime-weekday) (string->symbol v))) - (else v))))))] + ((freq) (string->symbol v)) + ((until) + ;; RFC 6321 (xcal), p. 30 specifies type-until as + ;; type-until = element until { + ;; type-date | + ;; type-date-time + ;; } + ;; but doesn't bother defining type-date[-time]... + ;; This is acknowledged in errata 3315 [1], but + ;; it lacks a solution... + ;; Seeing as RFC 7265 (jcal) in Example 2 (p. 16) + ;; show the date as a direct string we will roll + ;; with that here to. + ;; [1]: https://www.rfc-editor.org/errata/eid3315 + (string->date/-time v)) + ((byday) #|TODO|# + (throw 'not-yet-implemented)) + ((count interval bysecond bymunite byhour + bymonthday byyearday byweekno + bymonth bysetpos) + (string->number v)) + (else (throw + 'key-error + "Invalid key ~a, with value ~a" + k v)))))))] [(time) (parse-iso-time (car value))] -- cgit v1.2.3 From 3007ad2f8b45947ebfe21996ee590e1d4f38bc33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Thu, 28 Jan 2021 13:41:56 +0100 Subject: Limit edit tab to when in edit mode. --- module/calp/html/vcomponent.scm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'module') diff --git a/module/calp/html/vcomponent.scm b/module/calp/html/vcomponent.scm index cd8c207e..5c498f0e 100644 --- a/module/calp/html/vcomponent.scm +++ b/module/calp/html/vcomponent.scm @@ -544,8 +544,9 @@ `(("๐Ÿ“…" title: "ร–versikt" ,(fmt-single-event ev)) - ("๐Ÿ“…" title: "Redigera" - ,(fmt-for-edit ev)) + ,@(when (edit-mode) + `(("๐Ÿ“…" title: "Redigera" + ,(fmt-for-edit ev)))) ("โค“" title: "Nedladdning" (div (@ (class "eventtext") (style "font-family:sans")) -- cgit v1.2.3 From cbe3c46a898822b6ee0f10366e561c6a8055a1b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Tue, 2 Mar 2021 23:34:14 +0100 Subject: Start moving vcal stuff to own class. --- module/calp/html/vcomponent.scm | 4 +++- module/calp/html/view/calendar.scm | 1 + module/calp/repl.scm | 7 ++++++- 3 files changed, 10 insertions(+), 2 deletions(-) (limited to 'module') diff --git a/module/calp/html/vcomponent.scm b/module/calp/html/vcomponent.scm index 5c498f0e..4852390c 100644 --- a/module/calp/html/vcomponent.scm +++ b/module/calp/html/vcomponent.scm @@ -559,7 +559,9 @@ ,@(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")))))) + (li (button (@ (onclick "console.log(jcal_to_xcal(event_to_jcal(event_from_popup(this.closest('.popup-container')))));")) "xml")) + (li (button (@ (onclick "console.log(event_from_popup(this.closest('.popup-container')))")) "this")) + )))) )) ,@(when (prop ev 'RRULE) diff --git a/module/calp/html/view/calendar.scm b/module/calp/html/view/calendar.scm index 3f607bb7..e3b0bd3d 100644 --- a/module/calp/html/view/calendar.scm +++ b/module/calp/html/view/calendar.scm @@ -115,6 +115,7 @@ (script (@ (defer) (src "/static/server_connect.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/script.js"))) ,(calendar-styles calendars)) diff --git a/module/calp/repl.scm b/module/calp/repl.scm index d4f087aa..e6fbfe3d 100644 --- a/module/calp/repl.scm +++ b/module/calp/repl.scm @@ -31,4 +31,9 @@ [(address port) (make-tcp-server-socket host: address port: port)]) (string-split address #\:))] ;; currently impossible - [(IPv6) (error "How did you get here?")]))) + [(IPv6) (error "How did you get here?")])) + + ;; TODO setup repl environment here + + + ) -- cgit v1.2.3 From 2d91f05dfda49b61f2d83b2438975abb78dc3df1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Sat, 15 May 2021 23:57:21 +0200 Subject: Change background when in debug mode. --- module/calp/html/view/calendar.scm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'module') diff --git a/module/calp/html/view/calendar.scm b/module/calp/html/view/calendar.scm index e3b0bd3d..f84d2133 100644 --- a/module/calp/html/view/calendar.scm +++ b/module/calp/html/view/calendar.scm @@ -117,7 +117,10 @@ (script (@ (defer) (src "/static/date_time.js"))) (script (@ (defer) (src "/static/vcal.js"))) (script (@ (defer) (src "/static/script.js"))) - ,(calendar-styles calendars)) + ,(calendar-styles calendars) + + ,@(when (debug) + '((style ".root { background-color: pink; }")))) (body (div (@ (class "root")) -- cgit v1.2.3 From 24e06a13894f885bbb75b79beaa43d1c6fdfbae5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Mon, 17 May 2021 00:53:51 +0200 Subject: Rework date-time input to be cleaner + work again. --- module/calp/html/vcomponent.scm | 63 ++++++++++++++++++----------------------- 1 file changed, 27 insertions(+), 36 deletions(-) (limited to 'module') diff --git a/module/calp/html/vcomponent.scm b/module/calp/html/vcomponent.scm index 4852390c..7530de91 100644 --- a/module/calp/html/vcomponent.scm +++ b/module/calp/html/vcomponent.scm @@ -160,44 +160,35 @@ (end (prop ev 'DTEND))) `(div (@ (class "timeinput")) - (input (@ (type "date") - (name "dtstart-date") - (style "grid-column:1;grid-row:2") - (class "bind") - (data-property "--dtstart-date") - (value ,(date->string (as-date start))))) - - (input (@ (type "date") - (name "dtend-date") - (style "grid-column:1;grid-row:3") - (class "bind") - (data-property "--dtend-date") - ,@(when end `((value ,(date->string (as-date end))))))) + ,@(with-label + "Starttid" + `(div (@ (class "date-time bind") + (data-bindby "bind_date_time") + (name "dtstart")) + (input (@ (type "date") + (value ,(date->string (as-date start))))) + (input (@ (type "time") + (value ,(time->string (as-time start))))))) ,@(with-label - "Heldag?" - `(input (@ (type "checkbox") - (class "bind") - (data-bindby "bind_wholeday") - (style "display:none") - (name "wholeday")))) - - (input (@ (type "time") - (name "dtstart-time") - (class "bind") - (data-property "--dtstart-time") - (style "grid-column:3;grid-row:2;" - ,(when (date? start) "display:none")) - (value ,(time->string (as-time start))))) - - (input (@ (type "time") - (name "dtend-time") - (class "bind") - (data-property "--dtend-time") - (style "grid-column:3;grid-row:3;" - ,(when (date? end) "display:none")) - ,@(when end `((value ,(time->string (as-time end))))) - )))) + "Sluttid" + `(div (@ (class "date-time bind") + (data-bindby "bind_date_time") + (name "dtend")) + (input (@ (type "date") + ,@(when end `((value ,(date->string (as-date end))))))) + (input (@ (type "time") + ,@(when end `((value ,(time->string (as-time end))))))))) + + (div + ,@(with-label + "Heldag?" + `(input (@ (type "checkbox") + (class "bind") + (data-bindby "bind_wholeday") + (name "wholeday"))))) + + )) ,@(with-label "Plats" -- cgit v1.2.3 From 3d3963e53cb0646ded92c871a6ea7636b25714b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Mon, 17 May 2021 01:07:09 +0200 Subject: Cleanup + fix for wholeday checkbox. --- module/calp/html/vcomponent.scm | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) (limited to 'module') diff --git a/module/calp/html/vcomponent.scm b/module/calp/html/vcomponent.scm index 7530de91..787c4501 100644 --- a/module/calp/html/vcomponent.scm +++ b/module/calp/html/vcomponent.scm @@ -168,17 +168,23 @@ (input (@ (type "date") (value ,(date->string (as-date start))))) (input (@ (type "time") - (value ,(time->string (as-time start))))))) - - ,@(with-label - "Sluttid" - `(div (@ (class "date-time bind") - (data-bindby "bind_date_time") - (name "dtend")) - (input (@ (type "date") - ,@(when end `((value ,(date->string (as-date end))))))) - (input (@ (type "time") - ,@(when end `((value ,(time->string (as-time end))))))))) + (value ,(time->string (as-time start) "~H:~M")) + ,@(when (date? start) '((disabled))) + )))) + + ;; TODO some way to add an endtime if missing beforehand + ;; TODO, actually proper support for event without end times + ,@(when end + (with-label + "Sluttid" + `(div (@ (class "date-time bind") + (data-bindby "bind_date_time") + (name "dtend")) + (input (@ (type "date") + (value ,(date->string (as-date end))))) + (input (@ (type "time") + (value ,(time->string (as-time end) "~H:~M")) + ,@(when (date? end) '((disabled)))))))) (div ,@(with-label @@ -186,7 +192,8 @@ `(input (@ (type "checkbox") (class "bind") (data-bindby "bind_wholeday") - (name "wholeday"))))) + (name "wholeday") + ,@(when (date? start) '((checked))))))) )) -- cgit v1.2.3