we have stub for console.debug only
[MojoFacets.git] / templates / admin.html.ep
index 5d01f8e..e76d655 100644 (file)
@@ -1,5 +1,29 @@
 <div class=admin>
 
+% if ( my $datasets = stash('datasets' ) ) {
+<form action=/data/load id="switch_dataset" style="display: inline">
+<select name="path">
+% foreach my $path ( @$datasets ) {
+<option <%= session('path') eq $path ? 'selected="selected"' : '' %> ><%= $path %></option>
+% }
+</select>
+% foreach my $path ( @$datasets ) {
+<input name=paths type=hidden value="<%= $path %>">
+% }
+</form>
+<script>
+$(document).ready( function() {
+       $('#switch_dataset').change( function() {
+               console.debug( 'switch_dataset', this );
+               $(this).submit();
+       });
+       console.debug('installed switch_dataset' );
+});
+</script>
+% } else {
+<tt><%= session('path') %></tt>
+% }
+
 <a href="<%= url_for( controller => 'data', action => 'index', id => 0 ) %>">load</a>
 <a href="<%= url_for( controller => 'data', action => 'columns', id => 0 ) %>">columns</a>
 &middot;
@@ -21,7 +45,7 @@ items:
 
 % if ( my $id = stash('nytprof.id') ) {
 &middot;
-<a href="<%= url_for( controller => 'profile', action => 'index', id => $id ) %>">profile</a>
+<a href="<%= url_for( controller => 'profile', action => 'index', id => 0 ) %>">profile</a>
 % }
 
 <span class=middle>