added remove class on storable unlink
[MojoFacets.git] / templates / data / index.html.ep
index 3da68ca..80565e7 100644 (file)
@@ -1,4 +1,6 @@
 % layout 'default';
+% my $path = session('path');
+
 <h2>Select data file to load</h2>
 
 <form method=post action=/data/load >
@@ -6,18 +8,21 @@
 <input type=submit value="Load">
 
 <table>
-<tr><th rowspan=2>name</th><th colspan=2>size</th><th rowspan=2>items</th><th rowspan=2>edits</th><th rowspan=2 title="loaded in memory">m</th><th colspan=2>columns</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 %>" <%= defined $loaded->{session('path')}->{data} eq $n ? 'disabled' : '' %>>
+<input name=path  type=radio    value="<%= $n %>" <%= $n eq $path && defined $loaded->{$path}->{data} ? 'disabled' : '' %>>
 <%= $n %>
 </label>
 </td><td class=bytes><%= $size->{$n} %>
-</td><td class=bytes><%= -s $dump_path->{$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 $edits->{$n} ? $#{ $edits->{$n} } + 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}->{columns} ) {
@@ -34,7 +39,7 @@
 
 </form>
 
-<pre class=debug><%= dumper $edits %></pre>
+%#<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>