summaryrefslogtreecommitdiff
path: root/sitestatic/archweb.js
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2012-12-28 00:27:20 -0600
committerDan McGee <dan@archlinux.org>2012-12-28 14:48:29 -0600
commitc8ece67cec9c421ac0c711554edd34f022623b45 (patch)
treea894e1e82df91fda22807efbc3519bd18e12f321 /sitestatic/archweb.js
parentc7658ca4cd0f89969086fed172519ca2097270ba (diff)
Convert to using new todolist models everywhere
This is a rather widespread set of changes converting usage to the new todo list and todo list package model recently introduced. The data migration is not included in this commit. After this commit, the old model should no longer be referenced anywhere. Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'sitestatic/archweb.js')
-rw-r--r--sitestatic/archweb.js17
1 files changed, 9 insertions, 8 deletions
diff --git a/sitestatic/archweb.js b/sitestatic/archweb.js
index 42efb3fa..4a02fb63 100644
--- a/sitestatic/archweb.js
+++ b/sitestatic/archweb.js
@@ -15,7 +15,12 @@ if (typeof $ !== 'undefined' && typeof $.tablesorter !== 'undefined') {
id: 'todostatus',
is: function(s) { return false; },
format: function(s) {
- return s.match(/incomplete/i) ? 1 : 0;
+ if (s.match(/incomplete/i)) {
+ return 1;
+ } else if (s.match(/in-progress/i)) {
+ return 0.5;
+ }
+ return 0;
},
type: 'numeric'
});
@@ -304,13 +309,9 @@ function todolist_flag() {
// TODO: fix usage of this
var link = this;
$.getJSON(link.href, function(data) {
- if (data.complete) {
- $(link).text('Complete').addClass(
- 'complete').removeClass('incomplete');
- } else {
- $(link).text('Incomplete').addClass(
- 'incomplete').removeClass('complete');
- }
+ $(link).text(data.status).removeClass(
+ 'complete inprogress incomplete').addClass(
+ data.css_class.toLowerCase());
/* let tablesorter know the cell value has changed */
$('.results').trigger('updateCell', [$(link).closest('td')[0], false, null]);
});