another every_param usage
[MojoFacets.git] / templates / admin.html.ep
index 5d01f8e..0cfb378 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>
@@ -35,11 +59,13 @@ items:
 <a href="<%= url_for( controller => 'changes', action => 'index', id => 0 ) %>">changes</a>
 <a href="<%= url_for( controller => 'actions', action => 'index', id => 0 ) %>">actions</a>
 
-% if ( session('modified') ) {
-%  my $path = session('path');
+% my $visible_class = session('modified') ? '' : 'hide';
+% my $path = session('path');
+<span class="save_actions <%= $visible_class %>">
 &middot;
-<a class=save_actions title="<%= $path %>" href="<%= url_for( controller => 'data', action => 'save', id => $path ) %>">save</a>
-% }
+<a title="<%= $path %>" href="<%= url_for( controller => 'data', action => 'save' ) %>" >save</a>
+</span>
+
 </span>
 
 </div>