aboutsummaryrefslogtreecommitdiff
path: root/module/calp/html
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2021-05-17 01:32:25 +0200
committerHugo Hörnquist <hugo@lysator.liu.se>2021-05-17 01:32:25 +0200
commit6c21cb7b669a6778e57f7043c15446a38a1fc614 (patch)
treed4df2d192ab5c6b6f8a4c4bd8e3e6b0b4b36d8b8 /module/calp/html
parentTerminal reload events when jumping to today. (diff)
parentLong events now wholeday per default. (diff)
downloadcalp-6c21cb7b669a6778e57f7043c15446a38a1fc614.tar.gz
calp-6c21cb7b669a6778e57f7043c15446a38a1fc614.tar.xz
Merge branch 'jcal'
Diffstat (limited to 'module/calp/html')
-rw-r--r--module/calp/html/vcomponent.scm81
-rw-r--r--module/calp/html/view/calendar.scm6
2 files changed, 46 insertions, 41 deletions
diff --git a/module/calp/html/vcomponent.scm b/module/calp/html/vcomponent.scm
index 9764f513..ca38bdf7 100644
--- a/module/calp/html/vcomponent.scm
+++ b/module/calp/html/vcomponent.scm
@@ -160,44 +160,42 @@
(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
- "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)))))
- ))))
+ "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) "~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
+ "Heldag?"
+ `(input (@ (type "checkbox")
+ (class "bind")
+ (data-bindby "bind_wholeday")
+ (name "wholeday")
+ ,@(when (date? start) '((checked)))))))
+
+ ))
,@(with-label
"Plats"
@@ -544,8 +542,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"))
@@ -558,7 +557,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..f84d2133 100644
--- a/module/calp/html/view/calendar.scm
+++ b/module/calp/html/view/calendar.scm
@@ -115,8 +115,12 @@
(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))
+ ,(calendar-styles calendars)
+
+ ,@(when (debug)
+ '((style ".root { background-color: pink; }"))))
(body
(div (@ (class "root"))