Show full names in stream subscriber lists

(imported from commit 6be00256da74db6af9a6dd14e70929679c19db52)
This commit is contained in:
Zev Benjamin 2013-01-14 16:19:13 -05:00
parent cb8c67b325
commit 0e2401199a
1 changed files with 6 additions and 2 deletions

View File

@ -310,7 +310,8 @@ $(function () {
if (data.subscribed.length) {
error_elem.addClass("hide");
warning_elem.addClass("hide");
$('<li>').prependTo(list).text(principal);
var subscriber = people_dict[principal].full_name + ' <' + principal + '>';
$('<li>').prependTo(list).text(subscriber);
} else {
error_elem.addClass("hide");
warning_elem.removeClass("hide").text("User already subscribed");
@ -341,7 +342,10 @@ $(function () {
dataType: 'json', // This seems to be ignored. We still get back an xhr.
data: {stream: stream},
success: function (data) {
$.each(data.subscribers.sort(), function (idx, elem) {
var subscribers = $.map(data.subscribers, function (elem) {
return people_dict[elem].full_name + ' <' + elem + '>';
});
$.each(subscribers.sort(), function (idx, elem) {
$('<li>').appendTo(list).text(elem);
});
},