This commit is contained in:
2023-10-16 11:03:39 +02:00
parent ac52768ca7
commit e7fd2db581
15 changed files with 270223 additions and 43 deletions

View File

@@ -2,6 +2,16 @@
{% block content %}
<h2>{{ user.username }}'s Attributes</h2>
{% if user.public_key %}
<h3 class="mt-4">Public Key</h3>
<pre class="bg-light p-3">{{ user.public_key }}</pre>
{% else %}
<div class="alert alert-warning mt-3">
<strong>Note:</strong> No public key uploaded.
<a href="{% url 'abac:upload_public_key' username=user.username %}" class="alert-link">Click here to upload.</a>
</div>
{% endif %}
<table class="table">
<thead>
<tr>
@@ -30,4 +40,22 @@
{% endfor %}
</tbody>
</table>
<h3 class="mt-4">Upload Precertified Definitions</h3>
<form method="post" enctype="multipart/form-data" class="mb-3">
{% csrf_token %}
<div class="custom-file mb-3">
<input type="file" class="custom-file-input" id="precertifiedFile" name="precertified_file">
<label class="custom-file-label" for="precertifiedFile">Choose file</label>
</div>
<button type="submit" class="btn btn-primary">Upload</button>
</form>
<script>
// This script ensures that the file name is displayed in the custom file input after selection
document.querySelector('.custom-file-input').addEventListener('change', function (e) {
var fileName = document.getElementById("precertifiedFile").files[0].name;
var nextSibling = e.target.nextElementSibling;
nextSibling.innerText = fileName;
});
</script>
{% endblock %}