{% extends "layout.html" %}
{% block content %}
	  <div class="page-header">
      <h1>Public Certificates <small>Certificate authority web</small></h1>
    </div>

		<div class="row">
		  <div class="col-md-12">
				<div class="panel panel-success margin-top-40 table">
					<div class="panel-heading">
						<h3 class="panel-title">List of 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>Name</th>
								<th>Common Name</th>
								<th>Expiration Date</th>
								<th></th>
							</tr>
						</thead>
						<tbody>
							{% for cert in data_list -%}
        		  <tr>
        		    <td>{{ cert['index'] }}</td>
        		    {% if cert['filename'] == 'cacert.pem' -%}
        		    <td><a href="/viewcert?name={{ cert['filename'] }}&type=cacert">{{ cert['name'] }}</a></td>
        		    {% elif cert['filename'] == 'cacrl.pem' -%}
        		    <td><a href="/viewcert?name={{ cert['filename'] }}&type=crl">{{ cert['name'] }}</a></td>
        		    {% else -%}
        		    <td><a href="/viewcert?name={{ cert['filename'] }}&type=X509">{{ cert['name'] }}</a></td>
        		    {% endif -%}
        		    <td>{{ cert['cn'] }}</td>
        		    <td>{{ cert['expiration_date'] }}</td>
        		    <td><a class="btn btn-default" href="/get/{{ cert['name'] }}" role="button"  title="Download file"><i class="fa fa-download" aria-hidden="true"></i></a></td>
        		  </tr>
        		  {% endfor -%}
						</tbody>
					</table>
				</div>
			</div>
		</div>
{% endblock %}