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 ++++- module/vcomponent/parse/xcal.scm | 30 ++++++++++++++++++------------ 2 files changed, 22 insertions(+), 13 deletions(-) (limited to 'module') 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 diff --git a/module/vcomponent/parse/xcal.scm b/module/vcomponent/parse/xcal.scm index 76bdb251..06745864 100644 --- a/module/vcomponent/parse/xcal.scm +++ b/module/vcomponent/parse/xcal.scm @@ -126,21 +126,27 @@ (let ((params (handle-parameters parameters)) (tag* (symbol-upcase tag))) (for (type value) in (zip type value) - (set! (prop* component tag*) - (make-vline tag* - (handle-tag - tag (handle-value type params value)) - params))))] + ;; ignore empty fields + ;; mostly for + (unless (null? value) + (set! (prop* component tag*) + (make-vline tag* + (handle-tag + tag (handle-value type params value)) + params)))))] [(tag (type value ...) ...) (for (type value) in (zip type value) - (let ((params (make-hash-table)) - (tag* (symbol-upcase tag))) - (set! (prop* component tag*) - (make-vline tag* - (handle-tag - tag (handle-value type params value)) - params))))]))) + ;; ignore empty fields + ;; mostly for + (unless (null? value) + (let ((params (make-hash-table)) + (tag* (symbol-upcase tag))) + (set! (prop* component tag*) + (make-vline tag* + (handle-tag + tag (handle-value type params value)) + params)))))]))) ;; children (awhen (assoc-ref sxcal 'components) -- cgit v1.2.3