dynamicweb/hosting/templates/hosting/user_keys.html

106 lines
5.3 KiB
HTML
Raw Normal View History

2017-06-03 13:03:55 +00:00
{% extends "hosting/base_short.html" %}
{% load staticfiles bootstrap3 i18n %}
2017-07-04 12:00:08 +00:00
{% block content %}
2017-06-03 13:03:55 +00:00
<div>
<div class="container virtual-machine-container dashboard-container ">
<h1 class="h1-thin"><i class="fa fa-key" aria-hidden="true"></i>&nbsp;{% trans "My SSH Keys" %}</h1>
2017-08-02 18:21:44 +00:00
{% if messages %}
<div class="alert alert-warning">
{% for message in messages %}
<span>{{ message }}</span>
{% endfor %}
</div>
{% endif %}
<div class="ssh-header-container">
<p>{% trans "To generate a new key pair or to upload your existing key, click 'Add Key'" %}</p>
2017-08-02 19:20:27 +00:00
<a class="btn choice-btn" href="{% url 'hosting:choice_ssh_keys' %}" >
2017-08-02 19:57:29 +00:00
<span class="fa fa-plus"></span>&nbsp;&nbsp;{% trans "Add SSH Key" %}
2017-08-02 18:21:44 +00:00
</a>
</div>
2017-07-04 12:00:08 +00:00
2017-08-02 18:21:44 +00:00
<table class="table borderless table-hover ssh-keys-table">
<br/>
<thead>
<tr>
2017-08-02 19:57:29 +00:00
<th>{% trans "Name" %}</th>
<th>{% trans "Delete Key" %}</th>
<th>{% trans "Public Key" %}</th>
<th>{% trans "Private Key" %}</th>
2017-08-02 18:21:44 +00:00
</tr>
</thead>
<tbody>
{% for user_key in keys %}
<tr>
<td scope="row">{{user_key.name}}</td>
<td>
<button type="button" class="btn btn-default btn-custom-delete" data-toggle="modal" data-target="#Modal{{ user_key.id }}" style="color: #717274">
2017-08-02 19:57:29 +00:00
<span class="pc-only">{% trans "Delete" %}</span>
<span class="mob-only"><i class="fa fa-trash"></i></span>
2017-08-02 18:21:44 +00:00
</button>
<div class="modal fade" id="Modal{{user_key.id }}" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Confirm"><span aria-hidden="true">&times;</span></button>
2017-07-04 12:00:08 +00:00
</div>
2017-08-02 18:21:44 +00:00
<div class="modal-body">
<div class="modal-icon"><i class="fa fa-trash" aria-hidden="true"></i></div>
<h4 class="modal-title" id="ModalLabel">{% trans "Delete SSH Key"%}</h4>
<div class="modal-text">
<p>{% trans "Do you want to delete this key?"%}</p>
</div>
2017-08-02 18:21:44 +00:00
<form method="post" action="{% url 'hosting:delete_ssh_key' user_key.id %}">
{% csrf_token %}
<div class="modal-footer">
<button type="submit" class="btn btn-danger btn-wide">{% trans "Delete"%}</button>
2017-07-04 14:55:43 +00:00
</div>
2017-08-02 18:21:44 +00:00
</form>
2017-07-04 14:55:43 +00:00
</div>
2017-08-02 18:21:44 +00:00
</div>
</div>
</div>
</td>
<td>
<p data-toggle="modal" style="margin: 0" data-target="#Modal_public_key{{ user_key.id }}">
2017-08-02 19:57:29 +00:00
<a href="#">{% trans "Show" %}</a>
2017-08-02 18:21:44 +00:00
</p>
<div class="modal fade" id="Modal_public_key{{user_key.id }}" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Confirm"><span aria-hidden="true">&times;</span></button>
2017-08-02 18:21:44 +00:00
</div>
<div class="modal-body">
2017-08-15 22:56:17 +00:00
<h4 class="modal-title" id="ModalLabel_Public_Key">{% trans "Public SSH Key" %}</h4>
<p class="key_contain" style="margin-top: 10px;">{{ user_key.public_key }}</p>
2017-08-02 18:21:44 +00:00
</div>
</div>
</div>
</div>
</td>
</td>
<td>
{% if user_key.private_key %}
<form action="{{ user_key.private_key.url }}">
<button style="color: #717274" type="submit" class="btn btn-default">
<span class="pc-only">{% trans "Download" %}</span>
<span class="mob-only"><i class="fa fa-download"></i></span>
2017-08-02 18:21:44 +00:00
</button>
</form>
{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
2017-06-03 13:03:55 +00:00
</div>
</div>
{% if next_url %}
2017-07-04 12:00:08 +00:00
<script type="text/javascript">
2017-06-03 13:03:55 +00:00
window.location.href = '{{next_url}}';
</script>
{% endif %}
{%endblock%}