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

    <div class="row">
			<div class="col-xs-6 col-md-3">
			  <a href="/manage">
				<div class="panel panel-default">
					<div class="panel-body dash-panel">
						<h4><strong>Signature Requests</strong></h4>
						<div class="dash" id="dash-orange">
						<span class="number">{{ counter['csr'] }}</span></div>
					</div>
				</div>
				</a>
			</div>
			<div class="col-xs-6 col-md-3">
			  <a href="/signed_certs">
				<div class="panel panel-default">
					<div class="panel-body dash-panel">
						<h4><strong>Signed Certificates</strong></h4>
						<div class="dash" id="dash-teal">
  						<span class="number">{{ counter['cert'] }}</span>
						</div>
					</div>
				</div>
				</a>
			</div>
			<div class="col-xs-6 col-md-3">
			  <a href="/revocation_requests">
			  <div class="panel panel-default">
					<div class="panel-body dash-panel">
						<h4><strong>Revoke Requests</strong></h4>
						<div class="dash" id="dash-red">
						<span class="number">{{ counter['crr'] }}</span></div>
					</div>
				</div>
				</a>
			</div>
			<div class="col-xs-6 col-md-3">
			  <a href="/revoked_certs">
				<div class="panel panel-default">
					<div class="panel-body dash-panel">
						<h4><strong>Revoked</strong></h4>
						<div class="dash" id="dash-darkred">
						  <span class="number">{{ counter['crl'] }}</span>
					  </div>
					</div>
				</div>
				</a>
			</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">Certificates Signature request list</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 class="hidden-xs">#</th>
								<th class="hidden-xs">CSR Key</th>
								<th>Common Name</th>
								<th class="hidden-xs">Request Date</th>
								<th></th>
							</tr>
						</thead>
						<tbody>
							{% for csr in data_list -%}
        		  <tr>
        		    <td class="hidden-xs">{{ csr['index'] }}</td>
        		    <td class="hidden-xs">{{ csr['key'] }}</td>
        		    <td>{{ csr['cn'] }}</td>
        		    <td class="hidden-xs">{{ csr['request_date'] }}</td>
        		    <td>
                  <div class="btn-group">
                    <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                      Action <span class="caret"></span>
                    </button>
                    <ul class="dropdown-menu dropdown-menu-right">
                      <li><a href="/signcert_web?name={{ csr['filename_quote'] }}"><i class="fa fa-check-square" aria-hidden="true"></i> Sign CSR</a></li>
                      <li><a href="/viewcert?name={{ csr['filename_quote'] }}&type=req"><i class="fa fa-eye" aria-hidden="true"></i> View details</a></li>
                      <li role="separator" class="divider"></li>
                      <li><a href="/deletecsr?name={{ csr['filename_quote'] }}"><i class="fa fa-times" aria-hidden="true"></i> Delete CSR</a></li>
                    </ul>
                  </div>
                </td>
        		  </tr>
        		  {% endfor -%}
						</tbody>
					</table>
				</div>
			</div>
		</div>
{% endblock %}