view/html: search-form: Accept search query text.
authorRicardo Wurmus <rekado@elephly.net>
Tue, 31 Mar 2020 21:52:41 +0000 (23:52 +0200)
committerRicardo Wurmus <rekado@elephly.net>
Tue, 31 Mar 2020 21:52:41 +0000 (23:52 +0200)
mumi/web/view/html.scm

index 2f05e1dce33409d7828f11b3941e8fb164af3d8a..281b684f9ce28efb69ebdc202fc1e65f74699eb2 100644 (file)
@@ -1,5 +1,5 @@
 ;;; mumi -- Mediocre, uh, mail interface
-;;; Copyright © 2016, 2017, 2018, 2019 Ricardo Wurmus <rekado@elephly.net>
+;;; Copyright © 2016, 2017, 2018, 2019, 2020 Ricardo Wurmus <rekado@elephly.net>
 ;;; Copyright © 2018, 2019 Arun Isaac <arunisaac@systemreboot.net>
 ;;;
 ;;; This program is free software: you can redistribute it and/or
@@ -87,7 +87,7 @@
                           "source code here") ".")))))
     #:extra-headers ,extra-headers))
 
-(define* (search-form #:key (standalone? #f))
+(define* (search-form #:key (standalone? #f) (text ""))
   `(form (@ (id "search")
             ,(if standalone?
                  '(class "")
                     (class "form-control")
                     (id   "query")
                     (name "query")
+                    (value ,text)
                     (placeholder "Input your search query...")))
           (span (@ (class "input-group-append"))
                     (button