From e22ac4903378fd3f0bde32ecb69a838cdaa8c2d0 Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Mon, 3 Sep 2018 14:49:34 +0200 Subject: view: Add /help page. --- assets/css/screen.css | 10 ++++++++ mumi/web/controller.scm | 2 ++ mumi/web/view/html.scm | 65 +++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 77 insertions(+) diff --git a/assets/css/screen.css b/assets/css/screen.css index 389cffb..1517a56 100644 --- a/assets/css/screen.css +++ b/assets/css/screen.css @@ -206,6 +206,16 @@ table { color: #888; } +.filter { + display: inline-block; + color: #fff; + background: #aaa; + text-align: center; + padding: 2px; + border-radius: 3px; + font-family: monospace; +} + .status-tag { display: inline-block; color: #fff; diff --git a/mumi/web/controller.scm b/mumi/web/controller.scm index d19e961..414b42e 100644 --- a/mumi/web/controller.scm +++ b/mumi/web/controller.scm @@ -103,5 +103,7 @@ `(p "Could not access issue #" (strong ,id) "."))) ((GET "issue" not-an-id) (apply render-html (unknown not-an-id))) + ((GET "help") + (apply render-html (help))) ((GET path ...) (render-static-asset request)))) diff --git a/mumi/web/view/html.scm b/mumi/web/view/html.scm index 9d5511d..3098bc3 100644 --- a/mumi/web/view/html.scm +++ b/mumi/web/view/html.scm @@ -24,6 +24,7 @@ #:use-module (srfi srfi-1) #:use-module (srfi srfi-19) #:export (index + help unknown error-page issue-page @@ -130,6 +131,70 @@ `((h2 "Recent activity") ,(list-of-bugs bugs)))))))) +(define (help) + (layout + #:extra-headers + ;; Cache for 24 hours. + '((cache-control . ((max-age . 86400)))) + #:body + `(,(header #:search-bar? #f) + (div + (@ (class "container")) + (h1 "Help") + (a (@ (href "search"))) + (p "You can improve the search results by making use of the +simple query language. Here is a list of supported query terms with +some examples.") + (table + (@ (class "table")) + (thead + (tr + (th (@ (class "col-md-3")) "Filter") + (th (@ (class "col-md-9")) "Description"))) + (tbody + (tr + (td (span (@ (class "filter")) "is:open") ", " + (span (@ (class "filter")) "is:pending")) + (td "Open issues.")) + (tr + (td (span (@ (class "filter")) "is:closed") ", " + (span (@ (class "filter")) "is:done")) + (td "Issues marked as done.")) + (tr + (td (span (@ (class "filter")) "submitter:")) + (td "Issues submitted by a person named " (strong "who") + ", e.g. " + (span (@ (class "filter")) "author:ludo") + " for all issues submitted by ludo. " + "The filter matches both the email address and the name.")) + (tr + (td (span (@ (class "filter")) "author:")) + (td "Issues where a person named " (strong "who") + " has commented, e.g. " + (span (@ (class "filter")) "author:rekado") + " for all messages where rekado has commented. " + "The filter matches both the email address and the name.")) + (tr + (td (span (@ (class "filter")) "date:..")) + (td "Issues submitted within the provided range. " + (strong "start") " and " (strong "end") " can be one of " + (strong "now") ", " (strong "today") ", " (strong "yesterday") + ", a date in the formats " + (strong "YYYY-MM-DD") " or " (strong "YYYYMMDD") + ", or an amount and a unit for a point in the past, such as " + (strong "12d") " for 12 days ago. " + "Supported units are: " + (strong "h") " (hours), " + (strong "d") " (days), " + (strong "w") " (weeks), " + (strong "m") " (months), and " + (strong "y") " (years).")) + (tr + (td (span (@ (class "filter")) "mdate:..")) + (td "Issues with comments submitted within the provided +range. The supported arguments are the same as for " + (span (@ (class "filter")) "date:") ".")))))))) + (define (unknown id) (layout #:body -- cgit v1.2.3