Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #1823 from metacpan/mickey/fix_leaderboard
fix leaderboard (read correct key from aggregations)
  • Loading branch information
ranguard committed Nov 27, 2016
2 parents cf1b30f + 98225cd commit 2fe72f1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/MetaCPAN/Web/Controller/Favorite.pm
Expand Up @@ -43,7 +43,7 @@ sub leaderboard : Local : Args(0) {

my $data = $c->model('API::Favorite')->leaderboard( $c->req->page )->recv;
my @leaders
= @{ $data->{aggregations}->{leaderboard}->{terms} }[ 0 .. 99 ];
= @{ $data->{aggregations}->{leaderboard}->{buckets} }[ 0 .. 99 ];

$c->stash(
{
Expand Down
4 changes: 2 additions & 2 deletions root/favorite/leaderboard.html
Expand Up @@ -14,8 +14,8 @@
<% FOREACH leader IN leaders %>
<tr>
<td class="number<% IF loop.index() < 5; " strong"; END %>"><% loop.index() + 1 %></td>
<td class="name"><strong><a href="/release/<% leader.term %>"><% leader.term %></a></strong></td>
<td class="number"><% leader.count %> ++</td>
<td class="name"><strong><a href="/release/<% leader.key %>"><% leader.key %></a></strong></td>
<td class="number"><% leader.doc_count %> ++</td>
</tr>
<% END %>
</tbody>
Expand Down

0 comments on commit 2fe72f1

Please sign in to comment.