Load 100 users at a time for the badge page, with a button to load more.

This commit is contained in:
Vikhyat Korrapati
2014-04-22 15:10:47 +05:30
parent ba862439f2
commit 4e89b64e64
5 changed files with 69 additions and 13 deletions
@@ -0,0 +1,22 @@
/**
Controller for showing a particular badge.
@class BadgesShowController
@extends Discourse.ObjectController
@namespace Discourse
@module Discourse
**/
Discourse.BadgesShowController = Discourse.ObjectController.extend({
grantDates: Em.computed.mapBy('userBadges', 'grantedAt'),
minGrantedAt: Em.computed.min('grantDates'),
moreUserCount: function() {
if (this.get('userBadges')) {
return this.get('model.grant_count') - this.get('userBadges.length');
} else {
return 0;
}
}.property('model.grant_count', 'userBadges.length'),
showMoreUsers: Em.computed.gt('moreUserCount', 0)
});