{% extends "layout.html" %}
{% from "_helper.html" import image_button %}g
{% block content %}

<style>

</style>

<h1>Select Key</h1>

<form action="" name = "selectKeyForm" method=post enctype=multipart/form-data >
<table>
{% if haskeys %}
<tr><th>Select</th>
   <th>Key Name</th>
   <th>Path/Fingerprint</th>
   <th></th>
</tr>
	{% for name, key in keylist.iteritems() %}
		{% set value = key %}
		{% if name == defaultkey %}
			{% set checked = 'checked' %}
		{% else %}
			{% set checked = '' %}
		{% endif %}
		<tr>
			<td> <input type="radio" name="selectkeys" value="{{name}}" {{checked}}  
				  onclick="document.forms['selectKeyForm'].submit()"> 
				    </td>
			<td>{{name}}</td>
			<td>{{fun_fprint(value)}}</td>
			<td><a href="delete/{{name}}/">
			  <img
			  src="/static/img/icons/png/glyphicons_016_bin.png"
			  	     width="12" height="12">
			  </a>
			</td>
		</tr>
	{% endfor %}

{% else %}
	There are no keys present, please add one.
{% endif %}


</table>
</form>
<form action="" method=post enctype=multipart/form-data name = "addkeysform">

<!--http://www.html5rocks.com/en/tutorials/file/dndfiles/-->

<h1>Add Key</h1>

<table>
<tr><th>Attribute</th><th>Value</th></tr>
<tr><td>Key File or Path : </td><td><textarea name = "keyorpath" rows="2" cols="30"></textarea></td></tr>
<tr><td>Key Name : </td><td><input name = "keyname" type="text" /></td> </tr>
<tr><td colspan = "2" ><input type="submit" name = "addkey" value="Add"></td></tr>
</table>
		


{{show}}



</form>
{% endblock %}
