summaryrefslogtreecommitdiffstats
path: root/media
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2011-01-18 10:14:28 -0600
committerDan McGee <dan@archlinux.org>2011-01-18 10:21:47 -0600
commit487daf1c72f86a064b659f68d9f7722706997ab2 (patch)
tree11240c6831e3dfac969b4b4fd02fa28710d6f991 /media
parentb66f11dedfc86dfd35b09b0d0c86f0d8f60bf412 (diff)
downloadarchweb-487daf1c72f86a064b659f68d9f7722706997ab2.tar.gz
archweb-487daf1c72f86a064b659f68d9f7722706997ab2.zip
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 <dan@archlinux.org>
Diffstat (limited to 'media')
-rw-r--r--media/archweb.js23
1 files changed, 23 insertions, 0 deletions
diff --git a/media/archweb.js b/media/archweb.js
index b2f3af2a..b7351878 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 = $('<li>').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;
+}