small circular points
[MojoFacets.git] / templates / admin.html.ep
index a8f9526..0cfb378 100644 (file)
@@ -1,16 +1,72 @@
 <div class=admin>
 
-<a href="<%= url_for( action => 'index' ) %>">load</a>
-<a href="<%= url_for( action => 'columns' ) %>">columns</a>
+% 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;
 items:
 % foreach my $show ( glob 'templates/data/items/*.html.ep' ) {
 %  $show =~ s{^.+/([^/]+)\.html\.ep$}{$1};
-%  if ( session('show') eq $show ) {
-<%= $show %>
-%  } else {
-<a href="<%= url_for( action => 'items' )->query( show => $show ) %>"><%= $show %></a>
-%  }
+%  my $class = session('show') eq $show ? 'class=active' : '';
+<a href="<%= url_for( controller => 'data', action => 'items', id => $show ) %>" <%= $class %>><%= $show %></a>
 % }
 
+% if ( $self->can('_export_path') && glob $self->_export_path('*') ) {
+&middot;
+<a href="<%= url_for( controller => 'data', action => 'export', id => 0 ) %>">export</a>
+% }
+
+&middot;
+<a id=code href="<%= url_for( controller => 'code', action => 'index', id => 0 ) %>">code</a>
+<a id=console href="#" style="display:none">console</a>
+
+% if ( my $id = stash('nytprof.id') ) {
+&middot;
+<a href="<%= url_for( controller => 'profile', action => 'index', id => 0 ) %>">profile</a>
+% }
+
+<span class=middle>
+</span>
+
+<span class=right>
+
+<a href="<%= url_for( controller => 'config', action => 'index', id => 0 ) %>">config</a>
+&middot;
+
+<a href="<%= url_for( controller => 'changes', action => 'index', id => 0 ) %>">changes</a>
+<a href="<%= url_for( controller => 'actions', action => 'index', id => 0 ) %>">actions</a>
+
+% my $visible_class = session('modified') ? '' : 'hide';
+% my $path = session('path');
+<span class="save_actions <%= $visible_class %>">
+&middot;
+<a title="<%= $path %>" href="<%= url_for( controller => 'data', action => 'save' ) %>" >save</a>
+</span>
+
+</span>
+
 </div>