aboutsummaryrefslogtreecommitdiff
path: root/module
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2020-09-28 03:10:54 +0200
committerHugo Hörnquist <hugo@lysator.liu.se>2020-09-28 03:10:54 +0200
commit04dcab7a429d9b034d41b5aca8bd715c4826de32 (patch)
tree6678fffe9c275eb2ae0562fa2834e3b793e5aed5 /module
parentMade timeinput checkbox needlesly fancy. (diff)
downloadcalp-04dcab7a429d9b034d41b5aca8bd715c4826de32.tar.gz
calp-04dcab7a429d9b034d41b5aca8bd715c4826de32.tar.xz
Groundwork for adding new fields from frontend.
Diffstat (limited to 'module')
-rw-r--r--module/calp/html/vcomponent.scm17
-rw-r--r--module/calp/html/view/calendar.scm25
2 files changed, 37 insertions, 5 deletions
diff --git a/module/calp/html/vcomponent.scm b/module/calp/html/vcomponent.scm
index 54bfb9e8..2497aa04 100644
--- a/module/calp/html/vcomponent.scm
+++ b/module/calp/html/vcomponent.scm
@@ -192,10 +192,19 @@
(type "text")
))))
- #;
- (input (@ (type "text")
- (list "known-fields")
- (placeholder "Nytt fält")))
+ (hr)
+
+ (div (@ (class "newfield"))
+ (input (@ (type "text")
+ (list "known-fields")
+ (placeholder "Nytt fält")))
+ (select (@ (name "TYPE"))
+ (option (@ (value "TEXT")) "Text"))
+ (span
+ (input (@ (type "text")
+ (placeholder "Värde")))))
+
+ (hr)
(input (@ (type "submit")))
diff --git a/module/calp/html/view/calendar.scm b/module/calp/html/view/calendar.scm
index a583d82b..64986b5c 100644
--- a/module/calp/html/view/calendar.scm
+++ b/module/calp/html/view/calendar.scm
@@ -296,4 +296,27 @@
;; TODO merge this into the event-set, add attribute
;; for non-displaying elements.
(div (@ (class "template") (id "popup-template"))
- ,(popup event (string-append "popup" (html-id event)))))))))
+ ,(popup event (string-append "popup" (html-id event))))))
+
+ ;; Auto-complets when adding new fields to a component
+ ;; Any string is however still valid.
+ (datalist (@ (id "known-fields"))
+ ,@(map (lambda (f)
+ `(option (@ (value ,f))))
+ '(CALSCALE
+ METHOD PRODID VERSION ATTACH
+ CATEGORIES CLASS COMMENT
+ DESCRIPTION GEO LOCATION
+ PERCENT-COMPLETE PRIORITY
+ RESOURCES STATUS SUMMARY
+ COMPLETED DTEND DUE DTSTART
+ DURATION FREEBUSY
+ TRANSP TZID TZNAME
+ TZOFFSETFROM TZOFFSETTO
+ TZURL ATTENDEE CONTACT
+ ORGANIZER RECURRENCE-ID
+ RELATED-TO URL EXDATE
+ RDATE RRULE ACTION REPEAT
+ TRIGGER CREATED DTSTAMP LAST-MODIFIED
+ SEQUENCE REQUEST-STATUS
+ ))))))