$rs = $rs->search(undef, {order_by => 'me.id'}) unless $rs->is_ordered;
if (my $page = $env->{'gruntmaster.page'}) {
my $pages = int ($rs->count / PAGE_SIZE);
+ $params{default_page} = $page == -1;
$pages = 1 if $pages < 1;
$page = $pages if $page == -1;
@params{'page', 'pages'} = ($page, $pages);
$_->{problem_name} = $_->{rs}->problem->name;
$_->{size} = length $_->{source};
delete $_->{source};
- $_->{pageprefix} = $env->{'gruntmaster.page'} && $env->{'gruntmaster.page'} == -1 ? 'page/' : '';
}
};
</table>
<ul class="pager">
-<%perl if (__CURRENT__->{page} > 1) { %><li class="previous"><a href="<tmpl_var pageprefix><%perl __OUT__ __CURRENT__->{page} - 1; %>">Previous</a><%perl } %>
-<%perl if (__CURRENT__->{page} < __CURRENT__->{pages} - 1) { %><li class="next"><a href="<tmpl_var pageprefix><%perl __OUT__ __CURRENT__->{page} + 1; %>">Next</a><%perl } %>
+<%perl if (__CURRENT__->{page} > 1) { %><li class="previous"><a href="<tmpl_if default_page>page/</tmpl_if><%perl __OUT__ __CURRENT__->{page} - 1; %>">Previous</a><%perl } %>
+<%perl if (__CURRENT__->{page} < __CURRENT__->{pages} - 1) { %><li class="next"><a href="<%perl __OUT__ __CURRENT__->{page} + 1; %>">Next</a><%perl } %>
</ul>