From 4fa4519b34c8ded19ee606b59a9d49d03c2493d3 Mon Sep 17 00:00:00 2001 From: Tyler Renelle Date: Fri, 15 Nov 2013 21:32:25 -0800 Subject: [PATCH] [#1829] sort challenge-box by creation date --- src/controllers/groups.js | 6 +++++- views/options/social/challenges.jade | 6 ++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/controllers/groups.js b/src/controllers/groups.js index bf4e2db89d..d2e6d53ea8 100644 --- a/src/controllers/groups.js +++ b/src/controllers/groups.js @@ -33,7 +33,11 @@ var populateQuery = function(type, q){ else q.populate(guildPopulate); q.populate('invites', nameFields); - q.populate('challenges', challengeFields); + q.populate({ + path: 'challenges', + select: challengeFields, + options: {sort: [['timestamp',-1]]} + }); return q; } diff --git a/views/options/social/challenges.jade b/views/options/social/challenges.jade index 177dde1730..ba5a8f9df4 100644 --- a/views/options/social/challenges.jade +++ b/views/options/social/challenges.jade @@ -113,8 +113,10 @@ script(type='text/ng-template', id='partials/options.social.challenges.html') .accordion-group(ng-repeat='challenge in challenges|filter:filterChallenges') .accordion-heading ul.pull-right.challenge-accordion-header-specs - li. - {{challenge.group.name}} (by {{challenge.leader.profile.name}}) + li {{challenge.group.name}} + li + | by  + strong {{challenge.leader.profile.name}} li {{challenge.memberCount}} Participants li(ng-show='challenge.prize') // prize