aboutsummaryrefslogtreecommitdiff
path: root/module
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2021-10-03 21:54:30 +0200
committerHugo Hörnquist <hugo@lysator.liu.se>2021-10-03 21:54:30 +0200
commit4cf9587a5188e5853bbcf97b71109e7cb9331d9f (patch)
treef6f36930e263f3fee450a700b8e77da667c1afa9 /module
parentFurther work, rework popup. (diff)
downloadcalp-4cf9587a5188e5853bbcf97b71109e7cb9331d9f.tar.gz
calp-4cf9587a5188e5853bbcf97b71109e7cb9331d9f.tar.xz
work
Diffstat (limited to 'module')
-rw-r--r--module/calp/html/vcomponent.scm19
-rw-r--r--module/calp/html/view/calendar.scm15
-rw-r--r--module/calp/html/view/calendar/week.scm25
3 files changed, 30 insertions, 29 deletions
diff --git a/module/calp/html/vcomponent.scm b/module/calp/html/vcomponent.scm
index c5ae452d..1b97e9b8 100644
--- a/module/calp/html/vcomponent.scm
+++ b/module/calp/html/vcomponent.scm
@@ -22,6 +22,7 @@
format-summary
format-recurrence-rule
))
+ :use-module ((calp util config) :select (get-config))
)
(define-public (compact-event-list list)
@@ -203,11 +204,19 @@
`(vevent-edit (@ (class "vevent")
(data-uid ,(prop ev 'UID)))))
-(define-public (edit-template)
+(define-public (edit-template calendars)
`(div (@ (class " eventtext edit-tab "))
(form (@ (class "edit-form"))
- ;; TODO actually have calendar list here, since we are just a template
- (div (@ (class "dropdown-goes-here")))
+ (select (@ (class "calendar-selection"))
+ (option "- Choose a Calendar -")
+ ,@(let ((dflt (get-config 'default-calendar)))
+ (map (lambda (calendar)
+ (define name (prop calendar 'NAME))
+ `(option (@ (value ,(html-attr name))
+ ,@(when (string=? name dflt)
+ '((selected))))
+ ,name))
+ calendars)))
(h3 (input (@ (type "text")
(placeholder "Sammanfattning")
(name "summary") (required)
@@ -605,10 +614,6 @@
`(("📅" title: "Redigera"
,(fmt-for-edit ev))))
- ,@(when (debug)
- `(("🐸" title: "Debug"
- (div
- (pre ,(prop ev 'UID))))))
("⤓" title: "Nedladdning"
(div (@ (class "eventtext") (style "font-family:sans"))
diff --git a/module/calp/html/view/calendar.scm b/module/calp/html/view/calendar.scm
index f447773d..dfcd2264 100644
--- a/module/calp/html/view/calendar.scm
+++ b/module/calp/html/view/calendar.scm
@@ -269,18 +269,9 @@
(or (prop (parent event) 'NAME) ""))))))))
,(prop calendar 'NAME))))
calendars))
- (div (@ (id "calendar-dropdown-template") (class "template"))
- (select
- (option "- Choose a Calendar -")
- ,@(let ((dflt (get-config 'default-calendar)))
- (map (lambda (calendar)
- (define name (prop calendar 'NAME))
- `(option (@ (value ,(html-attr name))
- ,@(when (string=? name dflt)
- '((selected))))
- ,name))
- calendars)))
- )))
+ ;; (div (@ (id "calendar-dropdown-template") (class "template"))
+ ;; )
+ ))
;; List of events
(div (@ (class "eventlist")
diff --git a/module/calp/html/view/calendar/week.scm b/module/calp/html/view/calendar/week.scm
index 5361ab65..9911b162 100644
--- a/module/calp/html/view/calendar/week.scm
+++ b/module/calp/html/view/calendar/week.scm
@@ -22,7 +22,7 @@
)
-(define*-public (render-calendar key: events start-date end-date #:allow-other-keys)
+(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 "const VIEW='week';")
@@ -56,6 +56,7 @@
,@(for event in (stream->list
(events-between start-date end-date events))
`(popup-element
+ ;; TODO
(@ (class "vevent")
(data-uid ,(prop event 'UID)))
)
@@ -72,7 +73,9 @@
;; edit tab of popup
(template (@ (id "vevent-edit"))
- ,((@ (calp html vcomponent) edit-template)))
+ ,((@ (calp html vcomponent) edit-template)
+ calendars
+ ))
;; "physical" block
(template (@ (id "vevent-block"))
@@ -83,11 +86,11 @@
(template
(@ (id "popup-template"))
(div (@ ; (id ,id)
- (class "popup-container CAL_"
- #;
- ,(html-attr (or (prop (parent ev) 'NAME) ;
- "unknown")))
- (onclick "event.stopPropagation()"))
+ (class "popup-container CAL_"
+ #;
+ ,(html-attr (or (prop (parent ev) 'NAME) ;
+ "unknown")))
+ (onclick "event.stopPropagation()"))
(div (@ (class "popup"))
(nav (@ (class "popup-control"))
,(btn "×"
@@ -98,13 +101,15 @@
,(tabset
`(("📅" title: "Översikt"
- (vevent-description (@ (class "populate-with-uid")))
+ (vevent-description
+ (@ (class "vevent populate-with-uid")))
)
,@(when (edit-mode)
`(("📅" title: "Redigera"
- (vevent-edit (@ (class "populate-with-uid"))))))))))
- )
+ (vevent-edit (@ (class "populate-with-uid"))))))
+
+ )))))
)))