2019-09-23 12:06:54 +02:00
|
|
|
{% extends 'base.html' %}
|
|
|
|
|
|
|
|
{% block header %}
|
|
|
|
<h1>{% block title %}
|
|
|
|
{% if g.user %}
|
|
|
|
Pubkeys for {{ g.user['fullname'] }}
|
|
|
|
{% else %}
|
|
|
|
Pubkeys
|
|
|
|
{% endif %}
|
|
|
|
{% endblock %}</h1>
|
|
|
|
{% if g.user %}
|
|
|
|
<a class="action" href="{{ url_for('pubkeys.create') }}">New</a>
|
|
|
|
{% endif %}
|
|
|
|
{% endblock %}
|
|
|
|
|
|
|
|
{% block content %}
|
|
|
|
{% if g.user %}
|
|
|
|
{% for pubkey in pubkeys %}
|
|
|
|
{% if pubkey['deleted'] == 0 %}
|
|
|
|
<article class="post{% if pubkey['revoked'] != 0 %} revoked{% endif %}{% if pubkey['deleted'] != 0 %} deleted{% endif %}">
|
|
|
|
<header>
|
|
|
|
<div>
|
2019-09-23 16:41:15 +02:00
|
|
|
<h1>
|
|
|
|
<a class="action" href="{{ url_for('pubkeys.certs_index', id=pubkey['id']) }}">
|
|
|
|
{% if pubkey['revoked'] != 0 %}
|
|
|
|
<div class="danger">revoked key<div> -
|
|
|
|
{% endif %}
|
|
|
|
({{ pubkey['id'] }}): {{ pubkey['key_name'] }}
|
|
|
|
</a>
|
|
|
|
</h1>
|
2019-09-23 12:06:54 +02:00
|
|
|
</div>
|
|
|
|
{% if g.user['id'] == pubkey['user_id'] %}
|
|
|
|
<a class="action" href="{{ url_for('pubkeys.update', id=pubkey['id']) }}">Edit</a>
|
|
|
|
{% if pubkey['deleted'] == 0 %}
|
|
|
|
<a class="action" href="{{ url_for('pubkeys.delete', id=pubkey['id']) }}" onclick="return confirm('Are you sure?');">Delete</a>
|
|
|
|
{% endif %}
|
|
|
|
{% if pubkey['revoked'] == 0 %}
|
|
|
|
<a class="action" href="{{ url_for('pubkeys.revoke', id=pubkey['id']) }}" onclick="return confirm('Are you sure?');">Revoke</a>
|
|
|
|
{% endif %}
|
|
|
|
{% endif %}
|
|
|
|
</header>
|
|
|
|
<div name="ssh_pubkey" id="ssh_pubkey">{{ request.form['ssh_pubkey'] or pubkey['ssh_pubkey'] }}</div>
|
|
|
|
<p class="about">registered on {{ pubkey['created'].strftime('%Y-%m-%d') }}</p>
|
|
|
|
</form>
|
2019-09-23 16:41:15 +02:00
|
|
|
<!--form action="{{ url_for('pubkeys.revoke', id=pubkey['id']) }}" method="POST">
|
2019-09-23 12:06:54 +02:00
|
|
|
<input class="danger" type="submit" value="Revoke" onclick="return confirm('Are you sure?');">
|
2019-09-23 16:41:15 +02:00
|
|
|
</form-->
|
|
|
|
<form action="{{ url_for('pubkeys.certs_index', id=pubkey['id']) }}" method="POST">
|
|
|
|
<input class="danger" type="submit" value="Certificates">
|
2019-09-23 12:06:54 +02:00
|
|
|
</form>
|
|
|
|
</article>
|
|
|
|
{% if not loop.last %}
|
|
|
|
<hr>
|
|
|
|
{% endif %}
|
|
|
|
{% endif %}
|
|
|
|
{% endfor %}
|
|
|
|
{% else %}
|
|
|
|
<div class="danger">To view pubkeys and certificates, please log in</div>
|
|
|
|
{% endif %}
|
|
|
|
{% endblock %}
|