Jul 16 - Update facilities QR codes - report can upload up to 5 photos
This commit is contained in:
@@ -160,9 +160,13 @@
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
{{ form.photo.label(class="form-label small fw-semibold") }}
|
||||
{{ form.photo(class="form-control", accept="image/*") }}
|
||||
{% for e in form.photo.errors %}
|
||||
{{ form.photos.label(class="form-label small fw-semibold") }}
|
||||
{{ form.photos(class="form-control", accept="image/*", id="reportPhotos", multiple=true) }}
|
||||
<div class="form-text">You can attach up to 5 photos.</div>
|
||||
<div class="text-danger small mt-1" id="photoLimitMsg" style="display:none;">
|
||||
Please select no more than 5 photos — only the first 5 will be used.
|
||||
</div>
|
||||
{% for e in form.photos.errors %}
|
||||
<div class="text-danger small mt-1">{{ e }}</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
@@ -177,5 +181,21 @@
|
||||
Janitorial Quality Control
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
(function () {
|
||||
'use strict';
|
||||
var input = document.getElementById('reportPhotos');
|
||||
var msg = document.getElementById('photoLimitMsg');
|
||||
if (!input) { return; }
|
||||
input.addEventListener('change', function () {
|
||||
if (input.files && input.files.length > 5) {
|
||||
if (msg) { msg.style.display = 'block'; }
|
||||
input.value = ''; // clear an over-limit selection so they re-pick
|
||||
} else if (msg) {
|
||||
msg.style.display = 'none';
|
||||
}
|
||||
});
|
||||
}());
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -159,9 +159,13 @@
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
{{ form.photo.label(class="form-label small fw-semibold") }}
|
||||
{{ form.photo(class="form-control", accept="image/*") }}
|
||||
{% for e in form.photo.errors %}
|
||||
{{ form.photos.label(class="form-label small fw-semibold") }}
|
||||
{{ form.photos(class="form-control", accept="image/*", id="reportPhotos", multiple=true) }}
|
||||
<div class="form-text">You can attach up to 5 photos.</div>
|
||||
<div class="text-danger small mt-1" id="photoLimitMsg" style="display:none;">
|
||||
Please select no more than 5 photos — only the first 5 will be used.
|
||||
</div>
|
||||
{% for e in form.photos.errors %}
|
||||
<div class="text-danger small mt-1">{{ e }}</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
@@ -176,5 +180,21 @@
|
||||
Janitorial Quality Control
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
(function () {
|
||||
'use strict';
|
||||
var input = document.getElementById('reportPhotos');
|
||||
var msg = document.getElementById('photoLimitMsg');
|
||||
if (!input) { return; }
|
||||
input.addEventListener('change', function () {
|
||||
if (input.files && input.files.length > 5) {
|
||||
if (msg) { msg.style.display = 'block'; }
|
||||
input.value = ''; // clear an over-limit selection so they re-pick
|
||||
} else if (msg) {
|
||||
msg.style.display = 'none';
|
||||
}
|
||||
});
|
||||
}());
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user