{% extends "layout.html" %}
{% block content %}
	  <div class="page-header">
      <h1>Signed Certificates <small>requested by end users</small></h1>
    </div>

    <div class="row">
      <div class="col-md-12"><h4>Click on <strong>Revoke</strong> button to revoke a certificate. Revoked certificate will be added to cacrl.pem file.</h4></div>
    </div>

		<div class="row">
		  <div class="col-md-12">
				<div class="panel panel-primary margin-top-40 table">
					<div class="panel-heading">
						<h3 class="panel-title">All Signed Certificates</h3>
						<div class="pull-right">
							<span class="clickable filter" data-toggle="tooltip" title="Toggle table filter" data-container="body">
								<i class="glyphicon glyphicon-filter"></i>
							</span>
						</div>
					</div>
					<div class="panel-body">
						<input type="text" class="form-control" id="cacert-table-filter" data-action="filter" data-filters="#cacert-table" placeholder="Filter Columns" />
					</div>
					<table class="table table-hover" id="cacert-table">
						<thead>
							<tr>
								<th>#</th>
								<th>serial</th>
								<th>Filename</th>
								<th>Common Name</th>
								<th>Start Date</th>
								<th>Expiration Date</th>
								<th></th>
							</tr>
						</thead>
						<tbody>
							{% for cert in data_list -%}
        		  <tr>
        		    <td>{{ cert['index'] }}</td>
        		    <td><a href="/viewcert?name={{ cert['filename'] }}&type=X509">{{ cert['serial'] }}</a></td>
        		    <td><a href="/viewcert?name={{ cert['filename'] }}&type=X509">{{ cert['filename'] }}</a></td>
        		    <td>{{ cert['cn'] }}</td>
        		    <td>{{ cert['start_date'] }}</td>
        		    <td>{{ cert['expiration_date'] }}</td>
        		    <td><a class="btn btn-danger" href="/revoke_cert?serial={{ cert['serial'] }}" role="button" title="Revoke certificate">
        		      <i class="fa fa-times" aria-hidden="true"></i> Revoke</a>
        		    </td>
        		  </tr>
        		  {% endfor -%}
						</tbody>
					</table>
				</div>
			</div>
		</div>
{% endblock %}