Show message during upload

This commit is contained in:
Alexandre Iooss 2021-10-23 17:48:30 +02:00
parent 18d64c4fe9
commit 3d36aded1f

View file

@ -60,6 +60,12 @@ gallerySelectUpdate = () => {
}
gallerySelect.addEventListener('change', gallerySelectUpdate);
gallerySelectUpdate();
// On submit, show a message to make user wait
document.getElementById('upload_form').addEventListener('submit', (e) => {
document.getElementById('submit-id-submit').disabled = true;
document.getElementById('submit-id-submit').value = "Please be patient";
})
</script>
{% endblock %}
@ -67,7 +73,7 @@ gallerySelectUpdate();
<h1>{% trans "Upload" %}</h1>
<div class="card">
<div class="card-body">
<form method="post" enctype="multipart/form-data">{% csrf_token %}
<form method="post" enctype="multipart/form-data" id="upload_form">{% csrf_token %}
<div class="upload-drop-zone" id="drop-zone">
{% trans "Drag and drop photos here" %}
</div>