2020-05-06 13:25:17 -04:00
{% extends 'users/base.html' %}
2018-11-02 14:42:15 -04:00
{% load static %}
2016-03-01 11:23:03 -05:00
{% load form_helpers %}
{% block title %}User Key{% endblock %}
2016-12-09 16:23:11 -05:00
{% block usercontent %}
2020-11-19 13:43:17 -05:00
{% if object.is_active %}
2016-12-09 16:23:11 -05:00
< div class = "alert alert-danger" role = "alert" >
< strong > Warning:< / strong > Changing your public key will require your user key to be re-activated by another
user. You will be unable to retrieve any secrets until your key has been reactivated.
< / div >
{% endif %}
< form action = "." method = "post" class = "form" >
{% csrf_token %}
2021-04-13 21:51:12 -07:00
< div class = "field-group" >
2016-12-09 16:23:11 -05:00
{% render_field form.public_key %}
< / div >
2021-04-13 21:51:12 -07:00
< div class = "row my-3" >
< div class = "col-4 text-start" >
< button type = "button" class = "btn btn-info" id = "generate_keypair" data-bs-toggle = "modal" data-bs-target = "#new_keypair_modal" > Generate a New Key Pair< / button >
< / div >
< div class = "col-8 text-end" >
< a href = "{% url 'user:userkey' %}" class = "btn btn-outline-danger" > Cancel< / a >
< button type = "submit" name = "_update" class = "btn btn-primary" > Save< / button >
2016-03-01 11:23:03 -05:00
< / div >
2016-12-09 16:23:11 -05:00
< / div >
< / form >
< div class = "modal fade" id = "new_keypair_modal" tabindex = "-1" role = "dialog" >
2021-04-13 21:51:12 -07:00
< div class = "modal-dialog modal-lg" role = "document" >
2016-12-09 16:23:11 -05:00
< div class = "modal-content" >
< div class = "modal-header" >
< h4 class = "modal-title" id = "new_keypair_modal_title" >
New RSA Key Pair
< / h4 >
2021-04-13 21:51:12 -07:00
< button type = "button" class = "btn btn-close" data-bs-dismiss = "modal" aria-label = "Close" > < / button >
2016-12-09 16:23:11 -05:00
< / div >
< div class = "modal-body" >
2021-04-13 21:51:12 -07:00
< div class = "field-group" >
< h5 > New Public Key< / h5 >
< textarea class = "form-control" rows = "10" id = "new_pubkey" style = "height: 250px;font-family:var(--bs-font-monospace);" > < / textarea >
2016-03-01 11:23:03 -05:00
< / div >
2021-04-13 21:51:12 -07:00
< div class = "field-group" >
< h5 > New Private Key< / h5 >
< textarea class = "form-control" rows = "10" id = "new_privkey" style = "height: 250px;font-family:var(--bs-font-monospace);" > < / textarea >
2016-03-01 11:23:03 -05:00
< / div >
< / div >
2016-12-09 16:23:11 -05:00
< div class = "modal-footer text-center" >
2021-04-13 21:51:12 -07:00
< button type = "button" class = "btn btn-danger" id = "use_new_pubkey" data-bs-dismiss = "modal" > I Saved My New Private Key< / button >
2016-03-01 11:23:03 -05:00
< / div >
< / div >
< / div >
< / div >
{% endblock %}