X-Git-Url: https://ruin.nu/git/?a=blobdiff_plain;f=lib%2FNDWeb%2FController%2FRankings.pm;h=1575d4e0d574642ed760c0bebc65d5870e350cc4;hb=28cc9c2d61cf6ee0bfcd02c82e0195efaf6cf27a;hp=30407c659c897884a6269315f2598baa969cc6fe;hpb=230e61ee1d992255138b56c50caf9cca52532c2b;p=ndwebbie.git diff --git a/lib/NDWeb/Controller/Rankings.pm b/lib/NDWeb/Controller/Rankings.pm index 30407c6..1575d4e 100644 --- a/lib/NDWeb/Controller/Rankings.pm +++ b/lib/NDWeb/Controller/Rankings.pm @@ -36,6 +36,7 @@ sub planets : Local { my $error = ''; $offset = 0 unless $offset; + $c->detach('/default') if $offset < 0; $c->stash(offset => $offset); $c->stash( comma => \&comma_value); @@ -74,6 +75,7 @@ sub planets : Local { while (my $planet = $query->fetchrow_hashref){ push @planets,$planet; } + $c->detach('/default') unless @planets; $c->stash(planets => \@planets); } @@ -84,6 +86,7 @@ sub galaxies : Local { my $error = ''; $offset = 0 unless $offset; + $c->detach('/default') if $offset < 0; $c->stash(offset => $offset); $c->stash( comma => \&comma_value); @@ -118,6 +121,7 @@ sub galaxies : Local { while (my $galaxy = $query->fetchrow_hashref){ push @galaxies,$galaxy; } + $c->detach('/default') unless @galaxies; $c->stash(galaxies => \@galaxies); } @@ -129,6 +133,7 @@ sub alliances : Local { my $error = ''; $offset = 0 unless $offset; + $c->detach('/default') if $offset < 0; $c->stash(offset => $offset); $c->stash( comma => \&comma_value); @@ -170,6 +175,7 @@ sub alliances : Local { while (my $alliance = $query->fetchrow_hashref){ push @alliances,$alliance; } + $c->detach('/default') unless @alliances; $c->stash(alliances => \@alliances); }