view/html: Add search-widget.
authorRicardo Wurmus <rekado@elephly.net>
Tue, 31 Mar 2020 21:53:07 +0000 (23:53 +0200)
committerRicardo Wurmus <rekado@elephly.net>
Tue, 31 Mar 2020 21:53:07 +0000 (23:53 +0200)
mumi/web/view/html.scm

index 281b684f9ce28efb69ebdc202fc1e65f74699eb2..8693fdcf2a85c8b3b15faffa21232d8276d8588d 100644 (file)
                                (d "M6.5 12a5.5 5.5 0 100-11 5.5 5.5 0 000 11zM13 6.5a6.5 6.5 0 11-13 0 6.5 6.5 0 0113 0z")
                                (clip-rule "evenodd")) "")))))))
 
+
+(define* (search-widget #:key (text ""))
+  `(div
+    (@ (class "card mb-3"))
+    (div (@ (class "card-body bg-light"))
+         ,(search-form #:standalone? #t #:text text)
+         (details
+          (summary (strong "Hint"))
+          (p
+           "Refine your search with filters like "
+           (span (@ (class "filter"))
+                 "is:open")
+           ", "
+           (span (@ (class "filter"))
+                 "author:me")
+           ", "
+           (span (@ (class "filter"))
+                 "submitter:me")
+           ", "
+           (span (@ (class "filter"))
+                 "date:2d..now")
+           ", "
+           (span (@ (class "filter"))
+                 "date:2018-04-01..2018-04-02")
+           ", "
+           (span (@ (class "filter"))
+                 "date:1m..today")
+           ", and "
+           (a (@ (href "help#search"))
+              "many more!"))))))
+
 (define* (header #:key (search-bar? #t))
   `(nav
     (@ (class "navbar navbar-expand navbar-light bg-light"))
          (a (@ (href ,(string-append "mailto:" (%config 'submission-bug-email-address))))
             ,(%config 'submission-bug-email-address))
          " to submit a bug report.")
-      (div
-       (@ (class "card"))
-       (div (@ (class "card-body bg-light"))
-          ,(search-form #:standalone? #t)
-          (details
-           (summary (strong "Hint"))
-           (p
-            "Refine your search with filters like "
-            (span (@ (class "filter"))
-                  "is:open")
-            ", "
-            (span (@ (class "filter"))
-                  "author:me")
-            ", "
-            (span (@ (class "filter"))
-                  "submitter:me")
-            ", "
-            (span (@ (class "filter"))
-                  "date:2d..now")
-            ", "
-            (span (@ (class "filter"))
-                  "date:2018-04-01..2018-04-02")
-            ", "
-            (span (@ (class "filter"))
-                  "date:1m..today")
-            ", and "
-            (a (@ (href "help#search"))
-               "many more!")))))
+      ,(search-widget)
 
       (table
        (@ (class "table table-borderless table-hover"))