Skip to content

Instantly share code, notes, and snippets.

@whalesalad
Created August 4, 2009 09:47
Show Gist options
  • Select an option

  • Save whalesalad/161132 to your computer and use it in GitHub Desktop.

Select an option

Save whalesalad/161132 to your computer and use it in GitHub Desktop.
if (self.groups) {
var g = new Array(), g_strings = new Array();
for (group in self.groups) {
g.push({ id: group, name: self.groups[group] });
}
for (var i=0; i < g.length; i++) {
var g_suffix = (i == g.length) ? ' and ' : '';
var g_string = '<a href="/dashboard/ents/'+g[i].id+'/">'+g[i].name+'</a>'+g_suffix;
g_strings.push(g_string);
};
self.content.push('<p>'+self.getShortName()+' belongs to the '+g_strings.join('')+' group'+g.length.pluralize()+'.</p>');
} else {
self.content.push('<p>This member isn\'t a part of a group.');
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment