added remove class on storable unlink
[MojoFacets.git] / templates / data / index.html.ep
index 51633bb..80565e7 100644 (file)
@@ -1,21 +1,35 @@
 % layout 'default';
+% my $path = session('path');
+
 <h2>Select data file to load</h2>
 
 <form method=post action=/data/load >
 
+<input type=submit value="Load">
+
 <table>
-<tr><th>name</th><th>bytes</th></tr>
+<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>
+<tr><th>disk</th><th>storable</th></tr>
 % foreach my $n ( @$files ) {
 <tr><td>
 <label>
-<input name=path  type=radio    value="<%= $n %>" <%= session('path') eq $n ? 'disabled' : '' %>>
+<input name=path  type=radio    value="<%= $n %>" <%= $n eq $path && defined $loaded->{$path}->{data} ? 'disabled' : '' %>>
 <%= $n %>
 </label>
-</td><td align=right><%= $size->{$n} %>
+</td><td class=bytes><%= $size->{$n} %>
+</td><td class=bytes>
+% if ( my $size = -s $dump_path->{$n} ) {
+<a class="remove" title="remove" href="/data/unlink?path=<%= $dump_path->{$n} %>"><%= $size %></a>
+% }
+</td><td align=right><%= defined $loaded->{$n}->{data} ? $#{ $loaded->{$n}->{data}->{items} } + 1 : '' %>
+</td><td align=right><%= defined $changes->{$n} ? $#{ $changes->{$n} } + 1 : '' %>
 </td><td><input name=paths type=checkbox value="<%= $n %>" <%= defined $loaded->{$n}->{stats} ? 'checked' : '' %>>
 </td><td>
-%  if ( defined $loaded->{$n}->{header} ) {
-<%= join(" | ",@{ $loaded->{$n}->{header} }) %>
+%  if ( defined $loaded->{$n}->{columns} ) {
+%    my $visible = { map { $_ => 1 } @{ $loaded->{$n}->{columns} } };
+%    foreach my $n ( @{ $loaded->{$n}->{header} } ) {
+<span class="c<%= $filters->{$n} ? ' f' : '' %><%= ! $visible->{$n} ? ' h' : '' %>"><%= $n %></span>
+%    }
 %  }
 </td></tr>
 % }
@@ -23,5 +37,9 @@
 
 <input type=submit value="Load">
 
-<pre class=debug><%= dumper $loaded %></pre>
 </form>
+
+%#<pre class=debug><%= dumper $changes %></pre>
+<pre class=debug><%= dumper $loaded %></pre>
+<pre class=debug><%= dumper $filters %></pre>
+<pre class=debug><%= dumper $dump_path %></pre>