X-Git-Url: https://ruin.nu/git/?a=blobdiff_plain;f=lib%2FNDWeb%2FController%2FRankings.pm;h=b34792b74b115876d26d79c98d36eef4bb92fd46;hb=2a703f7250ea25f2f556eb25b644dcb7268f92ce;hp=30407c659c897884a6269315f2598baa969cc6fe;hpb=f9f06136c85f9634c409b71e18452c358530556e;p=ndwebbie.git diff --git a/lib/NDWeb/Controller/Rankings.pm b/lib/NDWeb/Controller/Rankings.pm index 30407c6..b34792b 100644 --- a/lib/NDWeb/Controller/Rankings.pm +++ b/lib/NDWeb/Controller/Rankings.pm @@ -36,10 +36,9 @@ sub planets : Local { my $error = ''; $offset = 0 unless $offset; + $c->detach('/default') if $offset < 0; $c->stash(offset => $offset); - $c->stash( comma => \&comma_value); - if (defined $order && $order =~ /^(scorerank|sizerank|valuerank|xprank|hit_us)$/){ $order = $1; }else { @@ -74,6 +73,7 @@ sub planets : Local { while (my $planet = $query->fetchrow_hashref){ push @planets,$planet; } + $c->detach('/default') unless @planets; $c->stash(planets => \@planets); } @@ -84,10 +84,9 @@ sub galaxies : Local { my $error = ''; $offset = 0 unless $offset; + $c->detach('/default') if $offset < 0; $c->stash(offset => $offset); - $c->stash( comma => \&comma_value); - if (defined $order && $order =~ /^(scorerank|sizerank|valuerank|xprank|planets)$/){ $order = $1; }else{ @@ -118,6 +117,7 @@ sub galaxies : Local { while (my $galaxy = $query->fetchrow_hashref){ push @galaxies,$galaxy; } + $c->detach('/default') unless @galaxies; $c->stash(galaxies => \@galaxies); } @@ -129,10 +129,9 @@ sub alliances : Local { my $error = ''; $offset = 0 unless $offset; + $c->detach('/default') if $offset < 0; $c->stash(offset => $offset); - $c->stash( comma => \&comma_value); - if (defined $order && $order =~ /^(scorerank|sizerank|valuerank|xprank|avgsize|avgscore|members)$/){ $order = $1; }else{ @@ -170,6 +169,7 @@ sub alliances : Local { while (my $alliance = $query->fetchrow_hashref){ push @alliances,$alliance; } + $c->detach('/default') unless @alliances; $c->stash(alliances => \@alliances); }