Add inventory audit feature
All checks were successful
ci/woodpecker/manual/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/manual/woodpecker Pipeline was successful
This commit is contained in:
@@ -65,6 +65,19 @@
|
||||
<td>{{ item.inventory.get("user").username | display_name }}</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Last audited</td>
|
||||
<td>
|
||||
{% if item.inventory.get("audit") %}
|
||||
{{ item.inventory.audit.timestamp | timeago }}
|
||||
by
|
||||
{{ item.inventory.audit.username | display_name }}
|
||||
{% else %}
|
||||
Never
|
||||
{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>URL slug</td>
|
||||
<td>
|
||||
@@ -149,6 +162,48 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% if can_audit %}
|
||||
<div class="row">
|
||||
<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>
|
||||
</div>
|
||||
</div>
|
||||
<div id="audit-modal" class="modal">
|
||||
<div class="modal-content">
|
||||
<h4>Check that:</h4>
|
||||
<p>
|
||||
<label>
|
||||
<input class="audit-check" type="checkbox"/>
|
||||
<span>Object is present at the space</span>
|
||||
</label>
|
||||
</p>
|
||||
<p>
|
||||
<label>
|
||||
<input class="audit-check" type="checkbox"/>
|
||||
<span>There is no obvious issues and it does not present danger</span>
|
||||
</label>
|
||||
</p>
|
||||
<p>
|
||||
<label>
|
||||
<input class="audit-check" type="checkbox"/>
|
||||
<span>Object has QR code attached to it and it's up to date</span>
|
||||
</label>
|
||||
</p>
|
||||
<p>
|
||||
<label>
|
||||
<input class="audit-check" type="checkbox"/>
|
||||
<span>Picture is up to date</span>
|
||||
</label>
|
||||
</p>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<form action="/m/inventory/{{ item._id }}/audit" method="post" style="display: inline;">
|
||||
<button id="audit-modal-send" disabled="" type="submit" class="orange waves-effect waves-light btn"><i class="material-icons left">done</i>Confirm</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
</div>
|
||||
<script>
|
||||
$(function() {
|
||||
@@ -163,6 +218,23 @@ $(function() {
|
||||
}
|
||||
});
|
||||
photoInput.change();
|
||||
|
||||
var auditModal = $("div#audit-modal");
|
||||
var auditButton = $("button#audit-modal-send");
|
||||
var auditChecks = $("input.audit-check");
|
||||
auditModal.modal({
|
||||
onOpenStart() {
|
||||
auditChecks.prop('checked', false);
|
||||
auditButton.prop("disabled", true);
|
||||
}
|
||||
});
|
||||
auditChecks.on("change", function() {
|
||||
if (auditChecks.not(":checked").length == 0) {
|
||||
auditButton.prop("disabled", false);
|
||||
} else {
|
||||
auditButton.prop("disabled", true);
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
Reference in New Issue
Block a user