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

index 8693fdcf2a85c8b3b15faffa21232d8276d8588d..1b938277812d4514b67a0b1bfe932b89e4eac21d 100644 (file)
@@ -531,20 +531,28 @@ m1 3H6v5h2V4zm0 6H6v2h2v-2z")))))
 (define (list-of-matching-bugs query bugs)
   (layout
    #:body
-   `(,(header)
-     (div (@ (class "container"))
-          ,@(if (null? bugs)
-                `((h1 "No issues found")
-                  (p "We could not find any issues matching your query "
-                     (code ,query) ". "
-                     (a (@ (href "/"))
-                        "Try searching for something else?")))
-                `((h1 "Submissions matching " (code ,query))
-                  (table (@ (class "table table-condensed table-sm table-hover"))
-                         (thead
-                          (tr (th "ID")
-                              (th "Subject")
-                              (th "Date submitted")
-                              (th "Status")))
-                         (tbody
-                          ,@(list-of-bugs bugs)))))))))
+   `(,(header #:search-bar? #f)
+     (div
+      (@ (class "container"))
+      (h1 "Your search for " (code ,query))
+      ,(search-widget #:text query)
+      ,(if (null? bugs)
+           `(div
+             (@ (class "alert alert-warning")
+                (role "alert"))
+             (h4
+              (@ (class "alert-heading"))
+              "Nothing found!")
+             (p "We could not find any issues matching your query "
+                (code ,query) ". "
+                (a (@ (href "/"))
+                   "Try searching for something else?")))
+           `(table
+             (@ (class "table table-borderless table-hover"))
+             (tbody
+              (tr (@ (class "heading"))
+                  (th "ID")
+                  (th "Subject")
+                  (th "Date submitted")
+                  (th "Status"))
+              ,@(list-of-bugs bugs))))))))