 %include header.html media_prefix=media_prefix

<div id="sidebar">

<h1 class="logo"><a href="/overview?s={{ cur_server_index }}">PyRedisAdmin</a></h1>

<p>
<select id="server">
%for server in config['servers']:
<option value="{{server['index']}}"\\
%if server['index']==cur_server_index:
  selected="selected"\\
%end
 >{{server['name']}}</option>
%end
</select>
</p>

<p>
<a href="/info?s={{ cur_server_index }}"><img src="/{{media_prefix}}/images/info.png" width="16" height="16" title="Info" alt="[I]"></a>
<a href="/export?s={{ cur_server_index }}"><img src="/{{media_prefix}}/images/export.png" width="16" height="16" title="Export" alt="[E]"></a>
<a href="/import?s={{ cur_server_index }}"><img src="/{{media_prefix}}/images/import.png" width="16" height="16" title="Import" alt="[I]"></a>
</p>

<p>
<a href="/edit?s={{ cur_server_index }}" class="add">Add another key</a>
</p>

<div id="keys">
<ul>
{{! all_levels_tree }}
</ul>
</div><!-- #keys -->

<div id="frame">
<iframe src="/overview" id="iframe" frameborder="0" scrolling="0"></iframe>
</div><!-- #frame -->
<script>
	if (document.location.href.indexOf("/?")!=-1 && document.location.href.indexOf("/?s")==-1){
		var href = document.location.href.replace(/\/\?([a-z]*)\&/, '/$1?');
		$('#iframe').attr('src', href);
	}
</script>
</div><!-- #sidebar -->
 %include footer.html