From 7edd0d40639c5478050743868e5513fd07ae1c8c Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Fri, 1 Feb 2019 12:45:34 +0100 Subject: controller: Load expensive lists via JavaScript * mumi/web/controller.scm (controller): Add routes for rendering snippets. * mumi/web/view/html.scm (list-of-bugs): Export; add severity class. (priority-bugs): New procedure. (index): Add sections for priority bugs. * assets/js/mumi.js: New file. * assets/css/screen.css: Color serious and important bugs. --- assets/css/screen.css | 8 ++++++++ assets/img/spin.gif | Bin 0 -> 4210 bytes assets/js/mumi.js | 19 +++++++++++++++++++ 3 files changed, 27 insertions(+) create mode 100644 assets/img/spin.gif create mode 100644 assets/js/mumi.js (limited to 'assets') diff --git a/assets/css/screen.css b/assets/css/screen.css index 73dceae..012d359 100644 --- a/assets/css/screen.css +++ b/assets/css/screen.css @@ -93,6 +93,14 @@ tr td:nth-child(3){ 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; diff --git a/assets/img/spin.gif b/assets/img/spin.gif new file mode 100644 index 0000000..00bce1a Binary files /dev/null and b/assets/img/spin.gif differ diff --git a/assets/js/mumi.js b/assets/js/mumi.js new file mode 100644 index 0000000..317bdcf --- /dev/null +++ b/assets/js/mumi.js @@ -0,0 +1,19 @@ +// @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 -- cgit v1.2.3