aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2019-12-14 17:04:36 +0000
committerChristopher Baines <mail@cbaines.net>2019-12-14 17:04:36 +0000
commit4cc678dfb190702e190e77bec61214665119708f (patch)
treea737474ee642f81a2f8526f8424f7ce672bf3f40
parent67710065f04655bca38e8e044ed5cd4436557cb1 (diff)
downloaddata-service-4cc678dfb190702e190e77bec61214665119708f.tar
data-service-4cc678dfb190702e190e77bec61214665119708f.tar.gz
Add a parameter to form-horizontal-control affect multiple values
Previously, the behaviour was to accept multiple values, but enable just allowing one value to be entered.
-rw-r--r--guix-data-service/web/view/html.scm9
1 files changed, 7 insertions, 2 deletions
diff --git a/guix-data-service/web/view/html.scm b/guix-data-service/web/view/html.scm
index ee3d4c7..3391073 100644
--- a/guix-data-service/web/view/html.scm
+++ b/guix-data-service/web/view/html.scm
@@ -107,6 +107,7 @@
help-text
required?
options
+ (allow-selecting-multiple-options #t)
font-family
(type "text"))
(define (value->text value)
@@ -146,7 +147,9 @@
(string-append
"font-family: " font-family ";")
""))
- (multiple #t)
+ ,@(if allow-selecting-multiple-options
+ '((multiple #t))
+ '())
(id ,input-id)
,@(if show-help-span?
`((aria-describedby ,help-span-id))
@@ -157,7 +160,9 @@
(match (assq (string->symbol input-name)
query-parameters)
((_key . value)
- value)
+ (if (not allow-selecting-multiple-options)
+ (list value)
+ value))
(_ '()))))
(map (match-lambda