all values must be arrays
[MojoFacets.git] / templates / data / columns.html.ep
index 5d3eb5b..5ea9dff 100644 (file)
@@ -1,19 +1,55 @@
-% layout 'default';
-<h2><%= $message %></h2>
+% layout 'ui';
 
-<form method=post action=/data/table >
+<style type="text/css">
+/*
+#sortable { list-style-type: none; margin: 0; padding: 0; width: 60%; }
+#sortable li { margin: 0 3px 3px 3px; padding: 0.4em; padding-left: 1.5em; font-size: 1.4em; height: 18px; }
+#sortable li span { position: absolute; margin-left: -1.3em; }
+*/
+</style>
+<script type="text/javascript">
 
-<ul>
-% foreach my $n ( sort { $stats->{$b}->{count} <=> $stats->{$a}->{count} } keys %$stats ) {
+$(document).ready(function() {
+       $("#sortable").sortable();
+       $("#sortable").disableSelection();
+});
+
+</script>
+
+
+
+
+<h2>Select and reorder columns</h2>
+
+<form method=post>
+
+<input type=submit value="Select">
+
+<%= include 'all_checkboxes' %>
+
+<ul id="sortable">
+% foreach my $n ( @$columns ) {
 <li>
 <label>
 <input type=checkbox name=columns value="<%= $n %>" <%= $checked->{$n} ? 'checked' : '' %>>
 <%= $n %>
 <span class="count"><%= $stats->{$n}->{count} %></span>
+% if ( defined $stats->{$n}->{unique} ) {
+<span title="unique">&#9997;</a>
+% }
 </label>
 % }
 </ul>
 
-<input type=submit>
+<input type=submit value="Select">
+
+from <input type=text name=path value="<%= session('path') %>" readonly>
+
+<a href="<%= url_for( action => 'stats' ) %>">rebuild stats</a>
 
 </form>
+
+<pre class=debug>
+$columns = <%= dumper $columns %>
+$stats = <%= dumper $stats %>
+</pre>