Skip to content

Commit

Permalink
sort by registered attendees then committed attendees
Browse files Browse the repository at this point in the history
  • Loading branch information
book committed Jan 11, 2012
1 parent cfc0408 commit 63ac4d8
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions lib/Act/Handler/User/Stats.pm
Expand Up @@ -46,16 +46,20 @@ sub handler {
} }


# sort the towns for each country # sort the towns for each country
$towns->{$_} = $towns->{$_} = [ sort { $b->{count} <=> $a->{count}
[ sort { $b->{count} <=> $a->{count} } values %{ $towns->{$_} } ] || $b->{committed} <=> $a->{committed}
} values %{ $towns->{$_} } ]
for keys %$towns; for keys %$towns;


# update the stats information # update the stats information
$stats->{users} = scalar @$users; $stats->{users} = scalar @$users;
$stats->{countries} = $stats->{countries} = [ sort { $b->{count} <=> $a->{count}
[ sort { $b->{count} <=> $a->{count} } values %$countries ]; || $b->{committed} <=> $a->{committed}
} values %$countries ];
$stats->{towns} = $towns; $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(); my $template = Act::Template::HTML->new();
$template->variables( stats => $stats ); $template->variables( stats => $stats );
Expand Down

0 comments on commit 63ac4d8

Please sign in to comment.