correct remove storable link
[MojoFacets.git] / templates / data / index.html.ep
1 % layout 'ui';
2 % my $path = session('path');
3
4 <h2>Select data file to load</h2>
5
6 <form method=post action=/data/load >
7
8 <input type=submit value="Load">
9
10 %= include 'all_checkboxes', add_class_to => 'parent().parent()'
11
12 <table>
13 <tr><th rowspan=2>name</th><th colspan=2>size</th><th rowspan=2>items</th><th rowspan=2>changes</th><th rowspan=2 title="loaded in memory">m</th><th colspan=2>columns</th></tr>
14 <tr><th>disk</th><th>storable</th></tr>
15 % foreach my $n ( @$files ) {
16 <tr><td>
17 <label>
18 <input name=path  type=radio    value="<%= $n %>" <%= $n eq $path && defined $loaded->{$path}->{data} ? 'disabled' : '' %>>
19 <%= $n %>
20 </label>
21 </td><td class=bytes><%= $size->{$n} %>
22 </td><td class=bytes>
23 % if ( my $size = -s $dump_path->{$n} ) {
24 %  my $action = -M $dump_path->{$n} > -M "data/$n" ? 'reload' : 'remove';
25 <a class="<%= $action %>" title="<%= $action %>" href="<%= url_for( action => $action )->query([ path => $dump_path->{$n}, name => $n ]) %>"><%= $size %></a>
26 % }
27 </td><td align=right><%= defined $loaded->{$n}->{data} ? $#{ $loaded->{$n}->{data}->{items} } + 1 : '' %>
28 </td><td align=right><%= defined $changes->{$n} ? $#{ $changes->{$n} } + 1 : '' %>
29 </td><td><input name=paths type=checkbox value="<%= $n %>" <%= defined $loaded->{$n}->{stats} ? 'checked' : '' %>>
30 </td><td>
31 %  if ( defined $loaded->{$n}->{columns} ) {
32 %    my $visible = { map { $_ => 1 } @{ $loaded->{$n}->{columns} } };
33 %    foreach my $n ( @{ $loaded->{$n}->{header} } ) {
34 <span class="c<%= $filters->{$n} ? ' f' : '' %><%= ! $visible->{$n} ? ' h' : '' %>"><%= $n %></span>
35 %    }
36 %  }
37 </td></tr>
38 % }
39 </table>
40
41 <input type=submit value="Load">
42
43 </form>
44
45 <pre class=debug><%#= dumper $changes %></pre>
46 <pre class=debug><%#= dumper $loaded %></pre>
47 <pre class=debug><%#= dumper $filters %></pre>
48 <pre class=debug><%#= dumper $dump_path %></pre>