summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRicardo Wurmus <rekado@elephly.net>2020-04-23 00:09:42 +0200
committerRicardo Wurmus <rekado@elephly.net>2020-04-23 00:09:42 +0200
commit9dfb0acb540ad56642932e592870c2aeca1754b1 (patch)
tree59747b7029f450a4de510c6b0b6711432956c0b4
parent41de24673434be53830b6adbe7fc5b0a0c62a44e (diff)
html: Add search hints.
-rw-r--r--assets/css/screen.css22
-rw-r--r--mumi/web/view/html.scm20
2 files changed, 40 insertions, 2 deletions
diff --git a/assets/css/screen.css b/assets/css/screen.css
index 6d91471..11e02e5 100644
--- a/assets/css/screen.css
+++ b/assets/css/screen.css
@@ -98,13 +98,35 @@ tr.important svg {
#search input:focus {
width: 400px;
}
+ #search #search-hints {
+ width: 400px;
+ }
}
@media (min-width: 768px) {
#search input:focus {
width: 500px;
}
+ #search.form-inline #search-hints {
+ width: 500px;
+ }
+}
+
+#search #search-hints {
+ display: none;
+ position: absolute;
+ background: white;
+ top: 2.5rem;
+ border: 1px solid #ced4da;
+ border-top: none;
+ box-shadow: 3px 3px 10px #ddd;
+ padding: 1em;
+ z-index: 2;
+}
+#search.form-inline:focus-within #search-hints {
+ display: block;
}
+#search { z-index: 3; }
footer {
border-color: #1A1A1A1A;
diff --git a/mumi/web/view/html.scm b/mumi/web/view/html.scm
index 7b04668..1549f58 100644
--- a/mumi/web/view/html.scm
+++ b/mumi/web/view/html.scm
@@ -126,8 +126,24 @@
(clip-rule "evenodd")) "")
(path (@ (fill-rule "evenodd")
(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")) "")))))))
-
+ (clip-rule "evenodd")) ""))))
+ (div
+ (@ (id "search-hints"))
+ (p "You can improve the search results by making use of the
+simple query language. Here is a list of supported query terms:")
+ (table
+ (@ (class "table table-sm table-borderless"))
+ (tbody
+ ,@(map (match-lambda
+ ((term description)
+ `(tr (td (span (@ (class "filter")) ,term))
+ (td ,description))))
+ '(("is:open" "open issues")
+ ("is:done" "closed issues")
+ ("submitter:<who>" "search issue submitter")
+ ("author:<who>" "search by message author")
+ ("date:yesterday..now" "search by issue date")
+ ("mdate:3m..2d" "search by message date")))))))))
(define* (search-widget #:key (text ""))
`(div