From 487daf1c72f86a064b659f68d9f7722706997ab2 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Tue, 18 Jan 2011 10:14:28 -0600 Subject: Make package signoffs AJAX if JS is enabled This makes the signoffs page a heck of a lot more usable as you can go through and click a bunch at once without waiting for the rather slow page to reload. Hopefully the first step to bringing life back into this part of the site. Signed-off-by: Dan McGee --- media/archweb.js | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'media') diff --git a/media/archweb.js b/media/archweb.js index b2f3af2..b735187 100644 --- a/media/archweb.js +++ b/media/archweb.js @@ -154,3 +154,26 @@ function todolist_flag() { }); return false; } + +/* signoffs.html */ +function signoff_package() { + var link = this; + $.getJSON(link.href, function(data) { + if (data.created) { + var signoff = $('
  • ').addClass('signed-username').text(data.user); + $(link).append(signoff); + } + /* update the approved column to reflect reality */ + if (data.approved) { + var approved = $(link).closest('tr').children('.signoff-no'); + approved.text('Yes').addClass( + 'signoff-yes').removeClass('signoff-no'); + } else { + var approved = $(link).closest('tr').children('.signoff-yes'); + approved.text('No').addClass( + 'signoff-no').removeClass('signoff-yes'); + } + $('.results').trigger('updateCell', approved); + }); + return false; +} -- cgit v1.2.3-24-g4f1b