popravki
This commit is contained in:
@@ -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 + "%";
|
||||
|
||||
@@ -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"></p>
|
||||
|
||||
<div class="tab-nav">
|
||||
@@ -122,36 +122,38 @@
|
||||
-->
|
||||
|
||||
|
||||
<div class="row">
|
||||
<!--<div class="row">
|
||||
<div class="col-12">
|
||||
<h2>Sodelujoči</h2>
|
||||
</div>
|
||||
</div>
|
||||
</div>-->
|
||||
<div class="row">
|
||||
<div class="col-6">
|
||||
{% for collaborator in collaborators %}
|
||||
<div class="collaborators-item">
|
||||
<div class="collaborators-item-name">{{collaborator.name}}</div>
|
||||
{% if collaborator.id in cooperation_history %}
|
||||
{% if cooperation_history[collaborator.id]["coordinator"]|length > 0 %}
|
||||
<div class="collaborators-item-years"><b>Vodenje:</b> {% for item in cooperation_history[collaborator.id]["coordinator"] %}
|
||||
{% if loop.index != 1 %}, {% endif %}
|
||||
{{item[0]}}
|
||||
{% endfor %}</div>
|
||||
{% endif %}
|
||||
{% if cooperation_history[collaborator.id]["mentor"]|length > 0 %}
|
||||
<div class="collaborators-item-years"><b>Mentorstvo:</b> {% for item in cooperation_history[collaborator.id]["mentor"] %}
|
||||
{% if loop.index != 1 %}, {% endif %}
|
||||
{{item[0]}}
|
||||
{% endfor %}</div>
|
||||
{% endif %}
|
||||
{% if cooperation_history[collaborator.id]["other"]|length > 0 %}
|
||||
<div class="collaborators-item-years"><b>Drugo:</b> {% for item in cooperation_history[collaborator.id]["other"] %}
|
||||
{% if loop.index != 1 %}, {% endif %}
|
||||
{{item[0]}}
|
||||
{% endfor %}</div>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
<div class="team-item">
|
||||
<div class="team-item-name">{{collaborator.name}}</div>
|
||||
<div class="team-item-collaborations">
|
||||
{% if collaborator.id in cooperation_history %}
|
||||
{% if cooperation_history[collaborator.id]["coordinator"]|length > 0 %}
|
||||
<div class="team-item-years">Vodenje: {% for item in cooperation_history[collaborator.id]["coordinator"] %}
|
||||
{% if loop.index != 1 %}, {% endif %}
|
||||
{{item[0]}}
|
||||
{% endfor %}</div>
|
||||
{% endif %}
|
||||
{% if cooperation_history[collaborator.id]["mentor"]|length > 0 %}
|
||||
<div class="team-item-years">Mentorstvo: {% for item in cooperation_history[collaborator.id]["mentor"] %}
|
||||
{% if loop.index != 1 %}, {% endif %}
|
||||
{{item[0]}}
|
||||
{% endfor %}</div>
|
||||
{% endif %}
|
||||
{% if cooperation_history[collaborator.id]["other"]|length > 0 %}
|
||||
<div class="team-item-years">Drugo: {% for item in cooperation_history[collaborator.id]["other"] %}
|
||||
{% if loop.index != 1 %}, {% endif %}
|
||||
{{item[0]}}
|
||||
{% endfor %}</div>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% endfor %}
|
||||
@@ -320,130 +322,8 @@
|
||||
</div>
|
||||
</div>-->
|
||||
</body>
|
||||
<!--{{ dropzone.load_js() }}-->
|
||||
<script src="/static/dropzone.js"></script>
|
||||
<script src="https://d3js.org/d3.v6.js"></script>
|
||||
<script>
|
||||
/////////////////////////
|
||||
// Dropzone //
|
||||
/////////////////////////
|
||||
var btnSubmit = document.getElementById("btn-submit");
|
||||
var errorMessage = document.getElementById("error-message");
|
||||
var form = document.forms["form-pogodbe"];
|
||||
|
||||
|
||||
function isEmptyOrSpaces(str){
|
||||
return str == null || str.match(/^ *$/) !== null;
|
||||
}
|
||||
|
||||
function showError(str) {
|
||||
errorMessage.querySelector("p").textContent = str;
|
||||
errorMessage.style.display = "block";
|
||||
window.scroll({
|
||||
top: 0,
|
||||
behavior: 'smooth'
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
Dropzone.options.myDropzone = { // The camelized version of the ID of the form element
|
||||
url: "../pogodbe",
|
||||
autoProcessQueue: false,
|
||||
uploadMultiple: false,
|
||||
parallelUploads: 20,
|
||||
paramName: "file[]", // The name that will be used to transfer the file
|
||||
maxFilesize: 1000, // MB
|
||||
timeout: 5000000, // milliseconds
|
||||
acceptedFiles: ".txt, .csv, .pdf, .doc, .docx, .xls, .xlsx, .ppt, .pptx, .jpg, .jpeg, .png, .mkv",
|
||||
maxFiles: 20,
|
||||
previewsContainer: "#dropzone-previews",
|
||||
dictDefaultMessage: "Kliknite ali odložite datoteke sem.",
|
||||
dictFallbackMessage: "Vaš brskalnik ne podpira izbiranje datotek z odlaganjem (\"drag & drop\").",
|
||||
dictInvalidFileType: "Datoteka je napačnega formata.",
|
||||
dictFileTooBig: "Datoteke je prevelika {{filesize}}. Največja dovoljena velikost: {{maxFilesize}}MiB.",
|
||||
dictResponseError: "Napaka strežnika: {{statusCode}}",
|
||||
dictMaxFilesExceeded: "Ne morete naložiti več datotek.",
|
||||
dictCancelUpload: "Prekini prenos",
|
||||
dictRemoveFile: "Odstrani datoteko",
|
||||
dictCancelUploadConfirmation: "Ali res želite odstraniti to datoteko?",
|
||||
dictUploadCanceled: "Prenos prekinjen",
|
||||
|
||||
// The setting up of the dropzone
|
||||
init: function() {
|
||||
var dz = this;
|
||||
|
||||
/*btnSubmit.addEventListener("click", function(e) {
|
||||
// Make sure that the form isn't actually being sent.
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
|
||||
// Check form validity.
|
||||
var program = form["program"].value;
|
||||
var predmet = form["predmet"].value;
|
||||
var predmetCustom = form["predmet-custom"].value;
|
||||
var letnik = form["letnik"].value;
|
||||
var vrsta = form["vrsta"].value;
|
||||
var vrstaCustom = form["vrsta-custom"].value;
|
||||
var solskoLeto = form["solsko-leto"].value;
|
||||
var jezikovniPopravki = form["jezikovni-popravki"].value;
|
||||
|
||||
/*if (predmet.startsWith("drug") && isEmptyOrSpaces(predmetCustom)) {
|
||||
showError("Polje za predmet ne more biti prazno!");
|
||||
} else if (vrsta === "delo-v-razredu" && isEmptyOrSpaces(vrstaCustom)) {
|
||||
showError("Polje za vrsto besedila ne more biti prazno!");
|
||||
} else if (dataConfirmNotification.style.display == "none") {
|
||||
dataConfirmNotification.style.display = "inherit";
|
||||
btnSubmit.style.display = "none";
|
||||
} else {*/
|
||||
|
||||
// Hand off data to dropzone
|
||||
/*dz.processQueue();
|
||||
|
||||
// Clear fields and hide popup agian
|
||||
dataConfirmNotification.style.display = "none";
|
||||
btnSubmit.textContent = "Oddaj";
|
||||
form.reset();*/
|
||||
//}
|
||||
//});
|
||||
|
||||
|
||||
// First change the button to actually tell dropzone to process the queue.
|
||||
btnSubmit.addEventListener("click", function(e) {
|
||||
// Make sure that the form isn't actually being sent.
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
// Hand off data to dropzone
|
||||
|
||||
dz.processQueue();
|
||||
console.log(dz.files);
|
||||
console.log(form["tip-pogodbe"].value);
|
||||
//form.submit();
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
this.on("sending", function(file, xhr, formData) {
|
||||
//alert("lalalala");
|
||||
formData.append("tip-pogodbe", form["tip-pogodbe"].value);
|
||||
});
|
||||
|
||||
|
||||
},
|
||||
uploadprogress: function(file, progress, bytesSent) {
|
||||
if (file.previewElement) {
|
||||
console.log(progress);
|
||||
var progressElement = file.previewElement.querySelector("[data-dz-uploadprogress]");
|
||||
progressElement.style.width = progress + "%";
|
||||
//progressElement.querySelector(".progress-text").textContent = progress + "%";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
</script>
|
||||
</html>
|
||||
|
||||
@@ -27,7 +27,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"></p>
|
||||
|
||||
|
||||
@@ -272,6 +272,14 @@
|
||||
for (var i = 0; i < elements.length; i++) {
|
||||
elements[i].addEventListener('click', toggleOpen, false);
|
||||
}
|
||||
|
||||
var files = document.getElementsByClassName("file-item");
|
||||
for (var i = 0; i < files.length; i++) {
|
||||
files[i].addEventListener('click', function(e) {
|
||||
e.stopPropagation();
|
||||
}, false);
|
||||
}
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user