btn-default -> btn-secondary
use mb-3 to add margin to bottom of input-groups
use $.modal('show') to show modals
use bi bi-trash icon (font-awesome doesn't seem to be included with bs5
data-bs-dismiss on the modal close buttons
put recheck templates in container divs
add input-group-text class to addon icons for input fields
37 lines
1.1 KiB
HTML
37 lines
1.1 KiB
HTML
<script type="application/javascript">
|
|
mfa_success_function=null;
|
|
mfa_failed_function=null;
|
|
function is_mfa() {
|
|
{% if request.session.mfa.verified %}
|
|
return true;
|
|
{% else %}
|
|
return false;
|
|
{% endif %}
|
|
}
|
|
function recheck_mfa(success_func,fail_func,must_mfa) {
|
|
if (!must_mfa) success_func()
|
|
window.mfa_success_function=success_func;
|
|
window.mfa_failed_function=fail_func;
|
|
$.ajax({
|
|
"url":"{% url 'mfa_recheck' %}",
|
|
success:function (data) {
|
|
if (data.hasOwnProperty("res")) {
|
|
if (data["res"])
|
|
success_func();
|
|
else fail_func();
|
|
}
|
|
else
|
|
{
|
|
$("#modal-title").html("Recheck Indentity")
|
|
$("#modal-body").html(data["html"])
|
|
$("#popUpModal").modal()
|
|
$("#popUpModal").modal('show')
|
|
}
|
|
|
|
|
|
|
|
}
|
|
})
|
|
}
|
|
</script>
|
|
{% include "modal.html" %} |