min-width: 8rem;
}
+tr.serious td:nth-child(1) {
+ background-color: #ff5a2a;
+ color: #fff;
+}
+tr.important td:nth-child(1) {
+ background-color: #feaaaa;
+}
+
#header {
background: #333333;
border-color: #1A1A1A1A;
--- /dev/null
+// @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL-v3.0-or-later
+(function () {
+ var loadSnippet = function (targetId, URL) {
+ var req = new XMLHttpRequest();
+ req.onload = function (e) {
+ var target = document.getElementById(targetId);
+ target.innerHTML = req.responseText;
+ };
+ req.onerror = function (e) {
+ var target = document.getElementById(targetId);
+ target.innerHTML = "Never mind...";
+ };
+ req.open('GET', URL, true);
+ req.send();
+ };
+ loadSnippet ('snippet-recent', '/snippet/recent');
+ loadSnippet ('snippet-priority', '/snippet/priority');
+})();
+// @license-end
;;; mumi -- Mediocre, uh, mail interface
-;;; Copyright © 2016, 2017, 2018 Ricardo Wurmus <rekado@elephly.net>
+;;; Copyright © 2016, 2017, 2018, 2019 Ricardo Wurmus <rekado@elephly.net>
;;;
;;; This program is free software: you can redistribute it and/or
;;; modify it under the terms of the GNU Affero General Public License
(map string->number path)))
((GET "issue" not-an-id)
(apply render-html (unknown not-an-id)))
+ ((GET "snippet" "recent")
+ (apply render-html (list #:sxml (list-of-bugs (recent-bugs 10)))))
+ ((GET "snippet" "priority")
+ (apply render-html (priority-bugs)))
((GET "help")
(apply render-html (help)))
((GET path ...)
;;; mumi -- Mediocre, uh, mail interface
-;;; Copyright © 2016, 2017, 2018 Ricardo Wurmus <rekado@elephly.net>
+;;; Copyright © 2016, 2017, 2018, 2019 Ricardo Wurmus <rekado@elephly.net>
;;; Copyright © 2018, 2019 Arun Isaac <arunisaac@systemreboot.net>
;;;
;;; This program is free software: you can redistribute it and/or
unknown
error-page
issue-page
- list-of-matching-bugs))
+ list-of-matching-bugs
+ list-of-bugs
+ priority-bugs))
(define (status-tag bug)
"Return a colored tag indicating the BUG status."
", and "
(a (@ (href "help#search"))
"many more!"))))
- ;; TODO: do this via JS?
- ,@(let ((bugs (recent-bugs 5)))
- (if (null? bugs)
- '()
- `((h2 "Recent activity")
- ,(list-of-bugs bugs))))))))
+ (h2 "Recent activity")
+ (div (@ (id "snippet-recent"))
+ (img (@ (src "/img/spin.gif"))))
+ (h2 "Priority bugs")
+ (div (@ (id "snippet-priority"))
+ (img (@ (src "/img/spin.gif"))))
+ (script
+ (@ (type "text/javascript")
+ (src "/js/mumi.js")))))))
(define (help)
(layout
(tbody
,@(map (lambda (bug)
(let ((id (number->string (bug-num bug))))
- `(tr
+ `(tr (@ (class ,(bug-severity bug)))
(td ,(or id "-"))
(td ,(if id
`(a (@ (href ,(string-append "/issue/" id)))
(td ,(status-tag bug)))))
bugs)))))
+(define (priority-bugs)
+ (list #:sxml
+ (list-of-bugs
+ (sort
+ (append
+ (bugs-by-severity "serious" "open")
+ (bugs-by-severity "important" "open"))
+ (lambda (a b) (< (bug-num a) (bug-num b)))))))
+
(define (list-of-matching-bugs query bugs)
(layout
#:body