Browse files

sort by registered attendees then committed attendees

  • Loading branch information...
1 parent cfc0408 commit 63ac4d8636a7284d1a8ff5d091a9bbf0f7b20a61 @book committed Oct 6, 2011
Showing with 9 additions and 5 deletions.
  1. +9 −5 lib/Act/Handler/User/Stats.pm
View
14 lib/Act/Handler/User/Stats.pm
@@ -46,16 +46,20 @@ sub handler {
}
# sort the towns for each country
- $towns->{$_} =
- [ sort { $b->{count} <=> $a->{count} } values %{ $towns->{$_} } ]
+ $towns->{$_} = [ sort { $b->{count} <=> $a->{count}
+ || $b->{committed} <=> $a->{committed}
+ } values %{ $towns->{$_} } ]
for keys %$towns;
# update the stats information
$stats->{users} = scalar @$users;
- $stats->{countries} =
- [ sort { $b->{count} <=> $a->{count} } values %$countries ];
+ $stats->{countries} = [ sort { $b->{count} <=> $a->{count}
+ || $b->{committed} <=> $a->{committed}
+ } values %$countries ];
$stats->{towns} = $towns;
- $stats->{pm} = [ sort { $b->{count} <=> $a->{count} } values %$pm ];
+ $stats->{pm} = [ sort { $b->{count} <=> $a->{count}
+ || $b->{committed} <=> $a->{committed}
+ } values %$pm ];
my $template = Act::Template::HTML->new();
$template->variables( stats => $stats );

0 comments on commit 63ac4d8

Please sign in to comment.