Skip to content

Commit

Permalink
#34 point calculation is now less complex
Browse files Browse the repository at this point in the history
  • Loading branch information
lazygalaxy committed Apr 30, 2016
1 parent 6badb91 commit 811e6aa
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 8 additions & 1 deletion client/common/users.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
Template.registerHelper('getUsersTotal', function () {
return UserInfo.find({}).fetch().length;
});

getUser = function (id) {
return UserInfo.findOne({
_id: id
});
}

Template.registerHelper('getUsers', function () {
return UserInfo.find({}, {
var selectedGroup = Session.get('selectedGroup');
return UserInfo.find({
groups: selectedGroup._id
}, {
sort: {
username: 1
}
Expand Down
2 changes: 1 addition & 1 deletion client/pages/account/login.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<div class="col-xs-12 col-sm-6 col-md-5 text-center">
<h3>Welcome to GoPredict.com</h3>
<p>GoPredict.com is a social sports prediction network. Challenge other users in the Euro2016 competition and become a prediction wizard.</p>
<p>Join our community of {{length getUsers}} wizards!</p>
<p>Join our community of {{getUsersTotal}} wizards!</p>
<p class="text-muted">
<small>Do you need to create a new account?</small>
<br>
Expand Down

0 comments on commit 811e6aa

Please sign in to comment.