This commit is contained in:
Leon Noe Jovan
2021-12-15 21:23:26 +01:00
parent eb00a806fc
commit a72c5f03cf
20 changed files with 134 additions and 167 deletions

View File

@@ -25,7 +25,7 @@
<div class="container" style="margin-top:8rem;">
<div class="row">
<div class="col-12">
<h1 class="title">Korpus SOLAR</h1>
<h1 class="title">Korpus Šolar</h1>
<p class="subtitle">Prosimo, določite podatke o besedilih, ki jih želite oddati, in nato naložite besedila. Če oddajate besedila, ki so nastala v različnih razredih, se razlikujejo glede učiteljskih popravkov in podobno, jih oddajte v ločenih paketih.</p>
@@ -56,6 +56,10 @@
<img src="/static/image/alert.svg" alt="alert"/>
<p></p>
</div>
<div class="alert alert-success" id="success-message">
<img src="/static/image/success.svg" alt="alert"/>
<p></p>
</div>
</div>
</div>
@@ -219,7 +223,7 @@
<div class="row">
<div class="col-6">
<div class="form-wrapper">
<button id="button-submit" type="submit" class="btn">Oddaj</button>
<button id="button-submit" type="button" class="btn">Oddaj</button>
</div>
</div>
<div class="col-6">
@@ -229,7 +233,7 @@
<div class="row submit-alert" id="data-confirm-notification">
<div class="col-6">
<button id="button-submit-final" type="submit" class="btn">Potrdi in oddaj</button>
<button id="button-submit-final" type="button" class="btn">Potrdi in oddaj</button>
</div>
<div class="col-6">
<p>Prosimo, preverite, če so vneseni podatki ustrezni in besedila prava. Naknadno spreminjanje ne bo več mogoče.</p>
@@ -258,6 +262,7 @@
var termsScrollbox = document.getElementById("popup-terms-text");
var dataConfirmNotification = document.getElementById("data-confirm-notification");
var errorMessage = document.getElementById("error-message");
var successMessage = document.getElementById("success-message");
var form = document.forms["form-oddaja"];
{% if not institution %}
@@ -277,7 +282,14 @@
});
}
const reEmail = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
function showSuccess(str) {
successMessage.querySelector("p").textContent = str;
successMessage.style.display = "block";
window.scroll({
top: 0,
behavior: 'smooth'
});
}
//onready
@@ -331,6 +343,7 @@
var dz = this;
dataConfirmNotification.style.display = "none";
errorMessage.style.display = "none";
successMessage.style.display = "none";
btnSubmit.addEventListener("click", function(e) {
// Make sure that the form isn't actually being sent.
@@ -362,7 +375,7 @@
// Clear fields and hide popup agian
dataConfirmNotification.style.display = "none";
btnSubmit.textContent = "Oddaj";
form.reset();
//form.reset();
}
});
@@ -380,6 +393,12 @@
// Hide the success button or the complete form.
});
this.on("successmultiple", function(files, response) {
showSuccess(response);
dz.removeAllFiles();
dataConfirmNotification.style.display = "none";
btnSubmit.style.display = "";
return;
// Gets triggered when the files have successfully been sent.
// Redirect user or notify of success.
});
@@ -404,7 +423,7 @@
},
uploadprogress: function(file, progress, bytesSent) {
if (file.previewElement) {
console.log(progress);
//console.log(progress);
var progressElement = file.previewElement.querySelector("[data-dz-uploadprogress]");
progressElement.style.width = progress + "%";
//progressElement.querySelector(".progress-text").textContent = progress + "%";