You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

93 lines
2.4 KiB

  1. {% extends "base.html" %}
  2. {% load compress static hc_extras %}
  3. {% block content %}
  4. <div class="row">
  5. <form
  6. id="add-credential-form"
  7. class="col-sm-6 col-sm-offset-3"
  8. data-options="{{ options }}"
  9. method="post"
  10. encrypt="multipart/form-data">
  11. <h1>Add Security Key</h1>
  12. {% csrf_token %}
  13. <input id="attestation_object" type="hidden" name="attestation_object">
  14. <input id="client_data_json" type="hidden" name="client_data_json">
  15. <div class="form-group">
  16. <label for="name">Name</label>
  17. <input
  18. type="text"
  19. class="form-control"
  20. id="name"
  21. name="name"
  22. required>
  23. <div class="help-block">
  24. Give this credential a descriptive name. Example: "My primary Yubikey"
  25. </div>
  26. </div>
  27. <div class="form-group text-right">
  28. <button
  29. id="name-next"
  30. class="btn btn-default" type="button">
  31. Confirm Name and Continue
  32. </button>
  33. </div>
  34. <div id="waiting" class="hide">
  35. <h2>Waiting for security key</h2>
  36. <p>
  37. Follow your browser's steps to register your security key
  38. with {% site_name %}.
  39. </p>
  40. <div class="spinner started">
  41. <div class="d1"></div>
  42. <div class="d2"></div>
  43. <div class="d3"></div>
  44. </div>
  45. </div>
  46. <div id="error" class="alert alert-danger hide">
  47. <p>
  48. <strong>Something went wrong.</strong>
  49. </p>
  50. <p id="error-text"></p>
  51. <div class="text-right">
  52. <button id="retry" type="button" class="btn btn-danger">
  53. Try Again
  54. </button>
  55. </div>
  56. </div>
  57. <div id="success" class="hide">
  58. <div class="alert alert-success">
  59. <strong>Success!</strong>
  60. Credential acquired.
  61. </div>
  62. <div class="form-group text-right">
  63. <input
  64. id="add-credential-submit"
  65. class="btn btn-primary"
  66. type="submit"
  67. name=""
  68. value="Save Security Key">
  69. </div>
  70. </div>
  71. </form>
  72. </div>
  73. {% endblock %}
  74. {% block scripts %}
  75. {% compress js %}
  76. <script src="{% static 'js/jquery-3.6.0.min.js' %}"></script>
  77. <script src="{% static 'js/bootstrap.min.js' %}"></script>
  78. <script src="{% static 'js/cbor.js' %}"></script>
  79. <script src="{% static 'js/add_credential.js' %}"></script>
  80. {% endcompress %}
  81. {% endblock %}