From 3759498f4ecf5cae88eecf197b1f2cf075bc0565 Mon Sep 17 00:00:00 2001 From: Aurélien Bompard Date: Fri, 17 May 2013 16:00:14 +0200 Subject: Load the lists descriptions from Mailman dynamically --- hyperkitty/static/js/hyperkitty.js | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'hyperkitty/static/js/hyperkitty.js') diff --git a/hyperkitty/static/js/hyperkitty.js b/hyperkitty/static/js/hyperkitty.js index a06aa79..62bacf4 100644 --- a/hyperkitty/static/js/hyperkitty.js +++ b/hyperkitty/static/js/hyperkitty.js @@ -377,6 +377,38 @@ function update_thread_replies(url) { } +/* + * List descriptions on the front page + */ +function update_list_properties(url) { + $.ajax({ + dataType: "json", + url: url, + success: function(data) { + $(".all-lists .mailinglist").each(function() { + var name = $(this).find(".list-address").text(); + if (!data[name]) { + return; + } + if (data[name]["display_name"]) { + $(this).find(".list-name").text(data[name]["display_name"]); + } + if (data[name]["description"]) { + $(this).find(".list-description") + .text(data[name]["description"]); + } + }); + }, + error: function(jqXHR, textStatus, errorThrown) { + //alert(jqXHR.responseText); + }, + complete: function(jqXHR, textStatus) { + $(".all-lists .mailinglist img.ajaxloader").remove(); + } + }); +} + + /* * Misc. */ -- cgit