debug css class
[MojoFacets.git] / templates / data / table.html.ep
1 % layout 'default';
2
3 <table border=1>
4
5 <tr>
6 % foreach my $n ( @$columns ) {
7 <th><%= $n %>&nbsp;<a href="<%= url_for( action => 'facet' )->query( name => $n ) %>">#</a>
8 </th>
9 % }
10 </tr>
11
12 % foreach my $row ( @$sorted ) {
13 <tr>
14 % foreach my $col ( @$columns ) {
15 <td><%= ref $row->{$col} eq 'ARRAY' ? join(', ',@{ $row->{$col} }) : $row->{$col} %></td>
16 % }
17 </tr>
18 % }
19
20 </table>
21
22 <div class=pager>
23 % foreach my $p ( 0 .. int( $rows / $limit ) ) {
24 % my $o = $p * $limit;
25 %       if ( $o == $offset ) {
26 <b><%= $p + 1 %></b>
27 %       } else {
28 <a href="<%= url_for( action => 'table' )->query( offset => $p * $limit ) %>"><%= $p + 1 %></a>
29 %       }
30 % }
31 </div>
32
33 <ul class=debug>
34 <li>rows: <%= $rows %> offset: <%= $offset %> limit: <%= $limit %>
35 <li>columns: <%= join(',',@$columns) %>
36 <li>filters: <%= dumper session 'filters' %>
37 </ul>