From 5a91457a5b8595969957cd6676afc2fff858251e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Tue, 11 Aug 2020 17:19:37 +0200 Subject: HTML Created events now have a description. Unfortunately they ALWAYS have a description. --- module/html/view/calendar.scm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'module/html/view/calendar.scm') diff --git a/module/html/view/calendar.scm b/module/html/view/calendar.scm index 2371cfe0..4753e1e6 100644 --- a/module/html/view/calendar.scm +++ b/module/html/view/calendar.scm @@ -317,7 +317,8 @@ ;; cloned mulitple times. dtstart: (datetime) dtend: (datetime) - summary: "New Event")))) + summary: "New Event" + description: "None yet")))) (event (car (children cal)))) `((div (@ (class "template event-container") (id "event-template") ;; Only needed to create a duration. So actual dates -- cgit v1.2.3 From ad78b193271abb6df486d3acfd7ab94f51cd101c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Tue, 11 Aug 2020 19:39:37 +0200 Subject: Can create events without descriptions again. --- module/html/view/calendar.scm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'module/html/view/calendar.scm') diff --git a/module/html/view/calendar.scm b/module/html/view/calendar.scm index 4753e1e6..f058d01e 100644 --- a/module/html/view/calendar.scm +++ b/module/html/view/calendar.scm @@ -318,7 +318,10 @@ dtstart: (datetime) dtend: (datetime) summary: "New Event" - description: "None yet")))) + ;; force a description field, + ;; but don't put anything in + ;; it. + description: "")))) (event (car (children cal)))) `((div (@ (class "template event-container") (id "event-template") ;; Only needed to create a duration. So actual dates -- cgit v1.2.3 From 7c914d16b60fb72aa25aa469b60b85f06fb3a518 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Tue, 11 Aug 2020 20:05:40 +0200 Subject: Keep summary when editing existing elements. --- module/html/view/calendar.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/html/view/calendar.scm') diff --git a/module/html/view/calendar.scm b/module/html/view/calendar.scm index f058d01e..7d38140f 100644 --- a/module/html/view/calendar.scm +++ b/module/html/view/calendar.scm @@ -317,7 +317,7 @@ ;; cloned mulitple times. dtstart: (datetime) dtend: (datetime) - summary: "New Event" + summary: "" ;; force a description field, ;; but don't put anything in ;; it. -- cgit v1.2.3 From 70dd50111a339fd9fcf54cc2f9670c1313a154a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Tue, 11 Aug 2020 20:25:56 +0200 Subject: Mercge CAL and CAL_bg css classes. --- module/html/view/calendar.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/html/view/calendar.scm') diff --git a/module/html/view/calendar.scm b/module/html/view/calendar.scm index 7d38140f..4fad41c8 100644 --- a/module/html/view/calendar.scm +++ b/module/html/view/calendar.scm @@ -284,7 +284,7 @@ (summary "Calendar list") (ul ,@(map (lambda (calendar) - `(li (@ (class "CAL_bg_" + `(li (@ (class "CAL_" ,(html-attr (prop calendar 'NAME)))) ,(prop calendar 'NAME))) calendars)))) -- cgit v1.2.3 From 54c613f48caa01f05fac2774dc2d2253568b552e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Tue, 11 Aug 2020 20:17:25 +0200 Subject: Add dropdown editing event. --- module/html/view/calendar.scm | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'module/html/view/calendar.scm') diff --git a/module/html/view/calendar.scm b/module/html/view/calendar.scm index 4fad41c8..39f1092d 100644 --- a/module/html/view/calendar.scm +++ b/module/html/view/calendar.scm @@ -287,7 +287,14 @@ `(li (@ (class "CAL_" ,(html-attr (prop calendar 'NAME)))) ,(prop calendar 'NAME))) - calendars)))) + calendars)) + (div (@ (id "calendar-dropdown-template") (class "template")) + (select + ,@(map (lambda (calendar) + `(option (@ (value ,(prop calendar 'NAME))) + ,(prop calendar 'NAME))) + calendars)) + ))) ;; List of events (div (@ (class "eventlist") -- cgit v1.2.3 From 263e64dfe8549e6c726fb06dd5cdc03fa6a90298 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Tue, 11 Aug 2020 20:41:28 +0200 Subject: Limit CAL_ class to once per 'thing'. --- module/html/view/calendar.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/html/view/calendar.scm') diff --git a/module/html/view/calendar.scm b/module/html/view/calendar.scm index 39f1092d..3c239bc6 100644 --- a/module/html/view/calendar.scm +++ b/module/html/view/calendar.scm @@ -291,7 +291,7 @@ (div (@ (id "calendar-dropdown-template") (class "template")) (select ,@(map (lambda (calendar) - `(option (@ (value ,(prop calendar 'NAME))) + `(option (@ (value ,(html-attr (prop calendar 'NAME)))) ,(prop calendar 'NAME))) calendars)) ))) -- cgit v1.2.3 From e360d3566eb878a944dada510a0c7e8437a5554b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Tue, 11 Aug 2020 21:31:52 +0200 Subject: Fix frontend for calendar choosing. --- module/html/view/calendar.scm | 1 + 1 file changed, 1 insertion(+) (limited to 'module/html/view/calendar.scm') diff --git a/module/html/view/calendar.scm b/module/html/view/calendar.scm index 3c239bc6..72fcccbd 100644 --- a/module/html/view/calendar.scm +++ b/module/html/view/calendar.scm @@ -290,6 +290,7 @@ calendars)) (div (@ (id "calendar-dropdown-template") (class "template")) (select + (option "- Choose a Calendar -") ,@(map (lambda (calendar) `(option (@ (value ,(html-attr (prop calendar 'NAME)))) ,(prop calendar 'NAME))) -- cgit v1.2.3 From aa1670d5a0973ef52f75d7771ccfc7f0f5807e1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Wed, 12 Aug 2020 06:47:49 +0200 Subject: Slightly clean up server imports. --- module/html/view/calendar.scm | 2 ++ 1 file changed, 2 insertions(+) (limited to 'module/html/view/calendar.scm') diff --git a/module/html/view/calendar.scm b/module/html/view/calendar.scm index 72fcccbd..ed6ea066 100644 --- a/module/html/view/calendar.scm +++ b/module/html/view/calendar.scm @@ -304,6 +304,8 @@ ;; but "spill" into our time span. (section (@ (class "text-day")) (header (h2 "Tidigare")) + ;; TODO this group gets styles applied incorrectly. + ;; Figure out way to merge it with the below call. ,@(stream->list (stream-map fmt-single-event -- cgit v1.2.3 From fd72079c5163f9881872d70b64aafde03b8b2385 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Wed, 12 Aug 2020 15:57:55 +0200 Subject: Add option for default calendar. --- module/html/view/calendar.scm | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'module/html/view/calendar.scm') diff --git a/module/html/view/calendar.scm b/module/html/view/calendar.scm index ed6ea066..76d1e79f 100644 --- a/module/html/view/calendar.scm +++ b/module/html/view/calendar.scm @@ -16,10 +16,14 @@ )) :use-module (html config) :use-module (html util) + + :use-module (util config) + :use-module (srfi srfi-1) :use-module (srfi srfi-26) :use-module (srfi srfi-41) :use-module (srfi srfi-41 util) + :use-module ((vcomponent group) :select (group-stream get-groups-between)) :use-module ((git) @@ -288,13 +292,17 @@ ,(html-attr (prop calendar 'NAME)))) ,(prop calendar 'NAME))) calendars)) - (div (@ (id "calendar-dropdown-template") (class "template")) - (select + (div (@ (id "calendar-dropdown-template") (class "template")) + (select (option "- Choose a Calendar -") - ,@(map (lambda (calendar) - `(option (@ (value ,(html-attr (prop calendar 'NAME)))) - ,(prop calendar 'NAME))) - calendars)) + ,@(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))) ))) ;; List of events -- cgit v1.2.3