cleanup dump_path usage
[MojoFacets.git] / templates / data / items.html.ep
index cc76769..0a25c75 100644 (file)
@@ -51,12 +51,14 @@ items
 <%= include 'data/items/' . session('show') %>
 
 <div class=pager>
+% my $url = url_for( action => 'items' )->query( offset => 0 );
+% $url =~ s{=0}{=}; # FIXME url_for is very very slow
 % foreach my $p ( 0 .. int( $rows / $limit ) ) {
 % my $o = $p * $limit;
 %      if ( $o == $offset ) {
 <b><%= $p + 1 %></b>
 %      } else {
-<a href="<%= url_for( action => 'items' )->query( offset => $p * $limit ) %>"><%= $p + 1 %></a>
+<a href="<%= $url . ( $p * $limit ) %>"><%= $p + 1 %></a>
 %      }
 % }
 </div>
@@ -67,3 +69,12 @@ items
 <li>numeric: <%= dumper $numeric %>
 <li>order: <%= session('order') %> sort: <%= session('sort') %>
 </ul>
+
+<script type="text/javascript">
+$(document).ready( function(){
+       $('select[name=limit]').change( function(){
+               console.debug( 'limit changed', this );
+               $(this).closest('form').submit();
+       });
+});
+</script>