PERF: Paginate public polls.

This commit is contained in:
Guo Xiang Tan
2016-06-09 21:33:17 +08:00
parent e66c51fd85
commit a36203ff78
15 changed files with 102 additions and 91 deletions

View File

@ -6,7 +6,6 @@ export default Ember.Controller.extend({
isRandom : Ember.computed.equal("poll.order", "random"),
isClosed: Ember.computed.equal("poll.status", "closed"),
isPublic: Ember.computed.equal("poll.public", "true"),
pollsVoters: Ember.computed.alias("post.polls_voters"),
// shows the results when
// - poll is closed
@ -152,10 +151,6 @@ export default Ember.Controller.extend({
this.setProperties({ vote: votes, showResults: true });
this.set("model", Em.Object.create(poll));
if (poll.public) {
this.get("pollsVoters")[currentUser.get("id")] = currentUser;
}
}).catch(() => {
bootbox.alert(I18n.t("poll.error_while_casting_votes"));
}).finally(() => {