aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2020-05-03 00:11:16 +0200
committerHugo Hörnquist <hugo@lysator.liu.se>2020-05-03 00:11:16 +0200
commitc0ad6255abf69ef89509698607ddd73a733f55fb (patch)
tree91b41bdce9fc9dc71d4740e32a81ceb1192c5267
parentServer now rounds to nearest sensible start. (diff)
downloadcalp-c0ad6255abf69ef89509698607ddd73a733f55fb.tar.gz
calp-c0ad6255abf69ef89509698607ddd73a733f55fb.tar.xz
Allow btn to take nothing, and default to <button>.
-rw-r--r--module/output/html.scm14
1 files changed, 6 insertions, 8 deletions
diff --git a/module/output/html.scm b/module/output/html.scm
index 0da52b0b..360151de 100644
--- a/module/output/html.scm
+++ b/module/output/html.scm
@@ -107,17 +107,15 @@
allow-other-keys:
rest: args)
(when (and onclick href)
- (error "Only give onclick or href."))
-
- (when (not (or onclick href))
- (error "One of onclick or href has to be given"))
+ (error "Only give one of onclick, href and submit."))
(let ((body #f))
- `(,(cond [onclick 'button]
- [href 'a])
+ `(,(cond [href 'a]
+ [else 'button])
(@ (class ,(string-join (cons "btn" class) " "))
- ,(cond [onclick `(onclick ,onclick)]
- [href `(href ,href)])
+ ,@(cond [onclick `((onclick ,onclick))]
+ [href `((href ,href))]
+ [else '()])
,@(let loop ((rem args))
(cond
[(null? rem) '()]