From 16f3c44f43fe6a5f1163e3e95559b76c40b91d7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Wed, 9 Sep 2020 00:56:05 +0200 Subject: HTML Better RRULE formatting. --- module/calp/html/vcomponent.scm | 22 +++++++++++++++++++++- static/style.scss | 5 +++++ 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/module/calp/html/vcomponent.scm b/module/calp/html/vcomponent.scm index 49b24fbc..c4e15374 100644 --- a/module/calp/html/vcomponent.scm +++ b/module/calp/html/vcomponent.scm @@ -4,6 +4,7 @@ :use-module (srfi srfi-1) :use-module (srfi srfi-41) :use-module (datetime) + :use-module ((text util) :select (add-enumeration-punctuation)) :use-module (calp html util) :use-module ((calp html config) :select (edit-mode)) :use-module ((calp html components) :select (btn tabset)) @@ -190,7 +191,26 @@ (define (repeat-info event) `(div (@ (class "eventtext")) (h2 "Upprepningar") - (pre ,(prop event 'RRULE)))) + (table (@ (class "recur-components")) + ,@((@@ (vcomponent recurrence internal) map-fields) + (lambda (key value) + `(tr (@ (class ,key)) (th ,key) + (td + ,(case key + ((wkst) (week-day-name value)) + ((until) (if (date? value) + (date->string value) + (datetime->string value))) + ((byday) (add-enumeration-punctuation + (map (lambda (pair) + (string-append + (if (car pair) + (format #f "~a " (car pair)) + "") + (week-day-name (cdr pair)))) + value))) + (else (->string value)))))) + (prop event 'RRULE))))) (define-public (popup ev id) diff --git a/static/style.scss b/static/style.scss index 322f62f3..33f55f81 100644 --- a/static/style.scss +++ b/static/style.scss @@ -724,6 +724,11 @@ along with their colors. overflow-y: auto; padding: 1em; word-break: break-word; + + table { + word-break: initial; + font-size: 65%; + } } .location { -- cgit v1.2.3