Show disabled button if no audit acl
All checks were successful
ci/woodpecker/manual/woodpecker Pipeline was successful

This commit is contained in:
Madis Mägi 2023-08-29 23:25:49 +03:00
parent 80eacfc46d
commit 5b3e284f1b

View File

@ -162,12 +162,14 @@
</div> </div>
</div> </div>
{% if can_audit %}
<div class="row"> <div class="row">
<div class="col s12"> <div class="col s12">
<button data-target="audit-modal" class="modal-trigger orange waves-effect waves-light btn"><i class="material-icons left">done</i>Audit</button> <button {% if can_audit %} data-target="audit-modal" {% else %} disabled="" {% endif %} class="modal-trigger orange waves-effect waves-light btn">
<i class="material-icons left">done</i>Audit
</button>
</div> </div>
</div> </div>
{% if can_audit %}
<div id="audit-modal" class="modal"> <div id="audit-modal" class="modal">
<div class="modal-content"> <div class="modal-content">
<h4>Check that:</h4> <h4>Check that:</h4>
@ -219,6 +221,7 @@ $(function() {
}); });
photoInput.change(); photoInput.change();
{% if can_audit %}
var auditModal = $("div#audit-modal"); var auditModal = $("div#audit-modal");
var auditButton = $("button#audit-modal-send"); var auditButton = $("button#audit-modal-send");
var auditChecks = $("input.audit-check"); var auditChecks = $("input.audit-check");
@ -235,6 +238,7 @@ $(function() {
auditButton.prop("disabled", true); auditButton.prop("disabled", true);
} }
}); });
{% endif %}
}); });
</script> </script>
{% endblock %} {% endblock %}