2021-03-24 10:05:36 +00:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<html lang="en">
|
|
|
|
<head>
|
|
|
|
<meta charset="UTF-8">
|
|
|
|
<title>Portal za oddajanje besedil</title>
|
2021-11-16 17:45:20 +00:00
|
|
|
<link rel="stylesheet" href="/static/css/header.css" type="text/css">
|
|
|
|
<link rel="stylesheet" href="/static/css/form.css" type="text/css">
|
|
|
|
<link rel="stylesheet" href="/static/css/simple-grid.css" type="text/css">
|
|
|
|
<link rel="stylesheet" href="/static/css/utils.css" type="text/css">
|
2021-03-24 10:05:36 +00:00
|
|
|
</head>
|
|
|
|
<body>
|
2021-11-16 17:45:20 +00:00
|
|
|
<header>
|
|
|
|
<div class="logo"><a href="/"><img src="/static/image/logo-white.svg"/></a></div>
|
|
|
|
<div class="menu-items">
|
|
|
|
<a href="../logout">Odjava</a>
|
|
|
|
{% if is_institution_coordinator %}
|
|
|
|
<a href="../manage-institution">Upravljaj z institucijo</a>
|
|
|
|
{% endif %}
|
|
|
|
{% if is_admin %}
|
|
|
|
<a href="../admin">Administracijski meni</a>
|
|
|
|
{% endif %}
|
|
|
|
<a href="mailto:email@example.com">Pomoč</a>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</header>
|
|
|
|
<div class="container" style="margin-top:8rem;">
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-12">
|
|
|
|
<h1 class="title">Koprus SOLAR</h1>
|
|
|
|
<p class="subtitle">Zbiranje besedil za korpus Šolar poteka po naslednjem postopku, ki prinaša tudi točke za napredovanje.</p>
|
|
|
|
|
|
|
|
|
|
|
|
<div class="tab-nav">
|
|
|
|
<a href="/oddaja" class="active">Oddaja</a>
|
|
|
|
<a href="/zgodovina">Zgodovina</a>
|
|
|
|
<a href="/pogodbe">Pogodbe</a>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-6">
|
|
|
|
{% if not institution %}
|
|
|
|
<div class="alert">
|
|
|
|
<img src="/static/image/alert.svg" alt="alert"/>
|
|
|
|
<p>Niste član nobene institucije!</p>
|
|
|
|
</div>
|
|
|
|
{% elif not institution_contract %}
|
|
|
|
<div class="alert">
|
|
|
|
<img src="/static/image/alert.svg" alt="alert"/>
|
|
|
|
<p>Pogodba s šolo še ni naložena!</p>
|
|
|
|
</div>
|
|
|
|
{% endif %}
|
|
|
|
<div class="alert" id="error-message">
|
|
|
|
<img src="/static/image/alert.svg" alt="alert"/>
|
|
|
|
<p></p>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<form id="form-oddaja">
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-6">
|
|
|
|
<div class="form-wrapper">
|
|
|
|
<label>Program</label>
|
|
|
|
<select id="program" name="program">
|
|
|
|
<option value="OS" selected="selected">Osnovnošolski (OŠ)</option>
|
|
|
|
<option value="SSG">Splošna in strokovna gimnazija (SGG)</option>
|
|
|
|
<option value="MGP">Mednarodni gimnazijski programi (MGP)</option>
|
|
|
|
<option value="ZG">Zasebne gimnazije (ZG)</option>
|
|
|
|
<option value="NPI">Nižje poklicno izobraževanje (NPI)</option>
|
|
|
|
<option value="SPI">Srednje poklicno izobraževanje (SPI)</option>
|
|
|
|
<option value="SSI">Srednje strokovno izobraževanje (SSI)</option>
|
|
|
|
<option value="PTI">Poklicno-tehnično izobraževanje (PTI)</option>
|
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="col-6">
|
|
|
|
<p>lalala</p>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-6">
|
|
|
|
<div class="form-wrapper">
|
|
|
|
<label for="predmet">Predmet</label>
|
|
|
|
<select id="predmet" name="predmet">
|
|
|
|
<option value="slo" selected="selected">Slovenščina</option>
|
|
|
|
<option value="drug-jez">Drugi jezikoslovni predmeti</option>
|
|
|
|
<option value="drug-druz">Drugi družboslovni predmeti</option>
|
|
|
|
<option value="drug-narav">Drugi naravoslovni predmeti</option>
|
|
|
|
<option value="drug-strok">Drugi strokovni predmeti</option>
|
|
|
|
<option value="drug-izb">Drugi izbirni ali dodatni predmeti</option>
|
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="col-6">
|
|
|
|
<p>lalala</p>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="row set-open-transition">
|
|
|
|
<div class="col-6">
|
|
|
|
<div class="form-wrapper" id="predmet-custom-box">
|
|
|
|
<label for="predmet-custom">Ime predmeta:</label>
|
|
|
|
<input type="text" id="predmet-custom" name="predmet-custom"/>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="col-6">
|
|
|
|
<p>lalala</p>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-6">
|
|
|
|
<div class="form-wrapper">
|
|
|
|
<label for="letnik">Letnik</label>
|
|
|
|
<select id="letnik" name="letnik">
|
|
|
|
<option value="1" selected="selected">1</option>
|
|
|
|
<option value="2">2</option>
|
|
|
|
<option value="3">3</option>
|
|
|
|
<option value="4">4</option>
|
|
|
|
<option value="5">5</option>
|
|
|
|
<option value="6">6</option>
|
|
|
|
<option value="7">7</option>
|
|
|
|
<option value="8">8</option>
|
|
|
|
<option value="9">9</option>
|
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="col-6">
|
|
|
|
<p>lalala</p>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-6">
|
|
|
|
<div class="form-wrapper" >
|
|
|
|
<label for="vrsta">Vrsta besedila</label>
|
|
|
|
<select id="vrsta" name="vrsta">
|
|
|
|
<option value="esej-spis" selected="selected">Esej ali spis</option>
|
|
|
|
<option value="prakticno">Praktično besedilo (npr. vabila, prošnje ipd. pri pouku slovenščine), napisano za oceno</option>
|
|
|
|
<option value="solski-test">Šolski test</option>
|
|
|
|
<option value="delo-v-razredu">Delo v razredu, ne za oceno</option>
|
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="col-6">
|
|
|
|
<p>lalala</p>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="row set-open-transition">
|
|
|
|
<div class="col-6">
|
|
|
|
<div class="form-wrapper" id="vrsta-custom-box">
|
|
|
|
<label for="vrsta-custom">Vtipkajte besedilno vrsto:</label>
|
|
|
|
<input type="text" id="vrsta-custom" name="vrsta-custom"/>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="col-6">
|
|
|
|
<p>lalala</p>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-6">
|
|
|
|
<div class="form-wrapper">
|
|
|
|
<label for="solsko-leto">Šolsko leto</label>
|
|
|
|
<select id="solsko-leto" name="solsko-leto">
|
|
|
|
<option value="20-21" selected="selected">2020/21</option>
|
|
|
|
<option value="21-22">2021/22</option>
|
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="col-6">
|
|
|
|
<p>lalala</p>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-6">
|
|
|
|
<div class="form-wrapper">
|
|
|
|
<label for="jezikovni-popravki">Jezikovni popravki</label>
|
|
|
|
<select id="jezikovni-popravki" name="jezikovni-popravki">
|
|
|
|
<option value="popr-ne" selected="selected">Besedilo vsebuje učiteljske popravke in strinjam se z njihovo vključitvijo v korpus</option>
|
|
|
|
<option value="brez-popr">Besedilo ne vsebuje učiteljskih popravkov</option>
|
|
|
|
<option value="popr-da">Besedilo vsebuje učiteljske popravke in ne strinjam se z njihovo vključitvijo v korpus</option>
|
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="col-6">
|
|
|
|
<p>lalala</p>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-6">
|
|
|
|
<div class="form-wrapper">
|
|
|
|
<div id="dropzone-previews" class="dropzone-previews"></div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-6">
|
|
|
|
<div class="form-wrapper">
|
|
|
|
<label for="jezikovni-popravki">Datoteka</label>
|
|
|
|
<div id="my-dropzone" class="dropzone"></div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="col-6">
|
|
|
|
<p>lalala</p>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-6">
|
|
|
|
<div class="form-wrapper">
|
|
|
|
<button id="button-submit" type="submit" class="btn">Oddaj</button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="col-6">
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<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>
|
|
|
|
</div>
|
|
|
|
<div class="col-6">
|
|
|
|
<p>Prosimo, preverite in potrdite vnešene podatke.</p>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<!--
|
|
|
|
<div id="main-window" style="margin-top:100px;">
|
2021-03-24 10:05:36 +00:00
|
|
|
<div id="rect1">
|
|
|
|
<div id="logo-container">
|
2021-05-17 12:33:53 +00:00
|
|
|
<img src="/static/image/logo.svg" alt="logo"/>
|
2021-03-24 10:05:36 +00:00
|
|
|
</div>
|
|
|
|
<form id="my-dropzone" class="dropzone">
|
|
|
|
<div style="position: relative; right: 390px;">
|
2021-05-17 12:33:53 +00:00
|
|
|
<h1 id="title" style="font-size: 25px;">Korpus ŠOLAR</h1>
|
|
|
|
|
|
|
|
<div class="selection-tabs">
|
2021-05-24 08:15:54 +00:00
|
|
|
<button id="button-oddaja" class="selection-tab-button selected">ODDAJA</button>
|
|
|
|
<button id="button-zgodovina" class="selection-tab-button">ZGODOVINA</button>
|
|
|
|
<button id="button-pogodbe" class="selection-tab-button">POGODBE</button>
|
2021-05-17 12:33:53 +00:00
|
|
|
</div>
|
2021-05-05 12:26:26 +00:00
|
|
|
|
2021-09-02 12:40:54 +00:00
|
|
|
{% if not institution %}
|
|
|
|
<div class="warning">Niste član nobene institucije!</div>
|
|
|
|
{% elif not institution_contract %}
|
|
|
|
<div class="warning">Pogodba s šolo še ni naložena!</div>
|
|
|
|
{% endif %}
|
|
|
|
<div id="data-confirm-notification" class="message-notification" style="display: none;">Prosimo, preverite in potrdite vnešene podatke.</div>
|
|
|
|
|
2021-05-05 12:26:26 +00:00
|
|
|
<label for="program">PROGRAM</label>
|
|
|
|
<select id="program" name="program">
|
|
|
|
<option value="OS" selected="selected">Osnovnošolski (OŠ)</option>
|
|
|
|
<option value="SSG">Splošna in strokovna gimnazija (SGG)</option>
|
|
|
|
<option value="MGP">Mednarodni gimnazijski programi (MGP)</option>
|
|
|
|
<option value="ZG">Zasebne gimnazije (ZG)</option>
|
|
|
|
<option value="NPI">Nižje poklicno izobraževanje (NPI)</option>
|
|
|
|
<option value="SPI">Srednje poklicno izobraževanje (SPI)</option>
|
|
|
|
<option value="SSI">Srednje strokovno izobraževanje (SSI)</option>
|
|
|
|
<option value="PTI">Poklicno-tehnično izobraževanje (PTI)</option>
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<label for="predmet">PREDMET</label>
|
|
|
|
<select id="predmet" name="predmet">
|
|
|
|
<option value="slo" selected="selected">Slovenščina</option>
|
|
|
|
<option value="drug-jez">Drugi jezikoslovni predmeti</option>
|
|
|
|
<option value="drug-druz">Drugi družboslovni predmeti</option>
|
|
|
|
<option value="drug-narav">Drugi naravoslovni predmeti</option>
|
|
|
|
<option value="drug-strok">Drugi strokovni predmeti</option>
|
|
|
|
<option value="drug-izb">Drugi izbirni ali dodatni predmeti</option>
|
|
|
|
</select>
|
2021-05-17 12:33:53 +00:00
|
|
|
<div id="predmet-custom-box" style="display: none;">
|
|
|
|
<label for="predmet-custom">Ime predmeta:</label>
|
|
|
|
<input type="text" id="predmet-custom" name="predmet-custom"/>
|
|
|
|
</div>
|
2021-05-05 12:26:26 +00:00
|
|
|
|
|
|
|
<label for="letnik">LETNIK</label>
|
|
|
|
<select id="letnik" name="letnik">
|
|
|
|
<option value="1" selected="selected">1</option>
|
|
|
|
<option value="2">2</option>
|
|
|
|
<option value="3">3</option>
|
|
|
|
<option value="4">4</option>
|
|
|
|
<option value="5">5</option>
|
|
|
|
<option value="6">6</option>
|
|
|
|
<option value="7">7</option>
|
|
|
|
<option value="8">8</option>
|
|
|
|
<option value="9">9</option>
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<label for="vrsta">VRSTA BESEDILA</label>
|
|
|
|
<select id="vrsta" name="vrsta">
|
|
|
|
<option value="esej-spis" selected="selected">Esej ali spis</option>
|
|
|
|
<option value="prakticno">Praktično besedilo (npr. vabila, prošnje ipd. pri pouku slovenščine), napisano za oceno</option>
|
|
|
|
<option value="solski-test">Šolski test</option>
|
|
|
|
<option value="delo-v-razredu">Delo v razredu, ne za oceno</option>
|
|
|
|
</select>
|
2021-05-17 12:33:53 +00:00
|
|
|
<div id="vrsta-custom-box" style="display: none;">
|
|
|
|
<label for="vrsta-custom">Vtipkajte besedilno vrsto:</label>
|
|
|
|
<input type="text" id="vrsta-custom" name="vrsta-custom"/>
|
|
|
|
</div>
|
|
|
|
|
2021-05-05 12:26:26 +00:00
|
|
|
|
|
|
|
<label for="solsko-leto">ŠOLSKO LETO</label>
|
|
|
|
<select id="solsko-leto" name="solsko-leto">
|
|
|
|
<option value="20-21" selected="selected">2020/21</option>
|
|
|
|
<option value="21-22">2021/22</option>
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<label for="jezikovni-popravki">JEZIKOVNI POPRAVKI</label>
|
|
|
|
<select id="jezikovni-popravki" name="jezikovni-popravki">
|
|
|
|
<option value="popr-ne" selected="selected">Besedilo vsebuje učiteljske popravke in strinjam se z njihovo vključitvijo v korpus</option>
|
|
|
|
<option value="brez-popr">Besedilo ne vsebuje učiteljskih popravkov</option>
|
|
|
|
<option value="popr-da">Besedilo vsebuje učiteljske popravke in ne strinjam se z njihovo vključitvijo v korpus</option>
|
|
|
|
</select>
|
2021-03-24 10:05:36 +00:00
|
|
|
|
|
|
|
<button id="button-submit" type="submit">Oddaj</button>
|
|
|
|
</div>
|
|
|
|
|
2021-09-02 12:40:54 +00:00
|
|
|
<div class="dropzone-previews">
|
|
|
|
</div>
|
2021-03-24 10:05:36 +00:00
|
|
|
</form>
|
|
|
|
|
|
|
|
</div>
|
2021-11-16 17:45:20 +00:00
|
|
|
</div>-->
|
2021-03-24 10:05:36 +00:00
|
|
|
|
|
|
|
|
|
|
|
<!--{{ dropzone.load_js() }}-->
|
2021-05-17 12:33:53 +00:00
|
|
|
<script src="/static/dropzone.js"></script>
|
2021-03-24 10:05:36 +00:00
|
|
|
<script>
|
|
|
|
/////////////////////////
|
|
|
|
// Dropzone //
|
|
|
|
/////////////////////////
|
2021-05-17 12:33:53 +00:00
|
|
|
var selectPredmet = document.getElementById("predmet");
|
|
|
|
var selectVrsta = document.getElementById("vrsta");
|
2021-03-24 10:05:36 +00:00
|
|
|
var btnSubmit = document.getElementById("button-submit");
|
|
|
|
var btnSubmitFinal = document.getElementById("button-submit-final");
|
|
|
|
var btnSubmitCancel = document.getElementById("button-submit-cancel");
|
|
|
|
var elemTermsPopup = document.getElementById("popup-terms");
|
|
|
|
var termsScrollbox = document.getElementById("popup-terms-text");
|
2021-09-02 12:40:54 +00:00
|
|
|
var dataConfirmNotification = document.getElementById("data-confirm-notification");
|
2021-11-16 17:45:20 +00:00
|
|
|
var errorMessage = document.getElementById("error-message");
|
|
|
|
var form = document.forms["form-oddaja"];
|
2021-03-24 10:05:36 +00:00
|
|
|
|
2021-09-16 15:25:20 +00:00
|
|
|
{% if not institution %}
|
|
|
|
btnSubmit.disabled = true;
|
|
|
|
{% endif %}
|
|
|
|
|
2021-03-24 10:05:36 +00:00
|
|
|
function isEmptyOrSpaces(str){
|
|
|
|
return str == null || str.match(/^ *$/) !== null;
|
|
|
|
}
|
|
|
|
|
2021-11-16 17:45:20 +00:00
|
|
|
function showError(str) {
|
|
|
|
errorMessage.querySelector("p").textContent = str;
|
|
|
|
errorMessage.style.display = "block";
|
|
|
|
window.scroll({
|
|
|
|
top: 0,
|
|
|
|
behavior: 'smooth'
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2021-03-24 10:05:36 +00:00
|
|
|
const reEmail = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
|
|
|
|
2021-11-16 17:45:20 +00:00
|
|
|
|
|
|
|
//onready
|
|
|
|
selectPredmet.addEventListener("change", function(e) {
|
|
|
|
var predmetCustomBox = document.getElementById("predmet-custom-box").closest('.row');
|
|
|
|
if (selectPredmet.value.startsWith("drug")) {
|
|
|
|
predmetCustomBox.style.maxHeight = "150px";
|
|
|
|
} else {
|
|
|
|
predmetCustomBox.style.maxHeight = "0px";
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
selectVrsta.addEventListener("change", function(e) {
|
|
|
|
var vrstaCustomBox = document.getElementById("vrsta-custom-box").closest('.row');
|
|
|
|
if (selectVrsta.value == "delo-v-razredu") {
|
|
|
|
vrstaCustomBox.style.maxHeight = "150px";
|
|
|
|
} else {
|
|
|
|
vrstaCustomBox.style.maxHeight = "0px";
|
|
|
|
}
|
|
|
|
});
|
|
|
|
var event = new CustomEvent("change");
|
|
|
|
selectPredmet.dispatchEvent(event);
|
|
|
|
selectVrsta.dispatchEvent(event);
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-03-24 10:05:36 +00:00
|
|
|
Dropzone.options.myDropzone = { // The camelized version of the ID of the form element
|
2021-10-12 09:11:37 +00:00
|
|
|
url: "../upload",
|
2021-03-24 10:05:36 +00:00
|
|
|
autoProcessQueue: false,
|
|
|
|
uploadMultiple: true,
|
|
|
|
parallelUploads: 20,
|
|
|
|
paramName: "file", // The name that will be used to transfer the file
|
|
|
|
maxFilesize: 1000, // MB
|
2021-05-27 07:29:32 +00:00
|
|
|
timeout: 5000000, // milliseconds
|
2021-11-16 17:45:20 +00:00
|
|
|
acceptedFiles: ".txt, .csv, .pdf, .doc, .docx, .xls, .xlsx, .ppt, .pptx, .jpg, .jpeg, .png, .mkv",
|
2021-03-24 10:05:36 +00:00
|
|
|
maxFiles: 20,
|
2021-11-16 17:45:20 +00:00
|
|
|
previewsContainer: "#dropzone-previews",
|
2021-03-24 10:05:36 +00:00
|
|
|
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;
|
2021-11-16 17:45:20 +00:00
|
|
|
dataConfirmNotification.style.display = "none";
|
|
|
|
errorMessage.style.display = "none";
|
2021-03-24 10:05:36 +00:00
|
|
|
|
|
|
|
btnSubmit.addEventListener("click", function(e) {
|
|
|
|
// Make sure that the form isn't actually being sent.
|
|
|
|
e.preventDefault();
|
|
|
|
e.stopPropagation();
|
|
|
|
|
|
|
|
// Check form validity.
|
2021-05-17 12:33:53 +00:00
|
|
|
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)) {
|
2021-11-16 17:45:20 +00:00
|
|
|
showError("Polje za predmet ne more biti prazno!");
|
2021-05-17 12:33:53 +00:00
|
|
|
} else if (vrsta === "delo-v-razredu" && isEmptyOrSpaces(vrstaCustom)) {
|
2021-11-16 17:45:20 +00:00
|
|
|
showError("Polje za vrsto besedila ne more biti prazno!");
|
2021-09-02 12:40:54 +00:00
|
|
|
} else if (dataConfirmNotification.style.display == "none") {
|
|
|
|
dataConfirmNotification.style.display = "inherit";
|
2021-11-16 17:45:20 +00:00
|
|
|
btnSubmit.style.display = "none";
|
2021-03-24 10:05:36 +00:00
|
|
|
} else {
|
2021-09-16 15:25:20 +00:00
|
|
|
|
|
|
|
// Hand off data to dropzone
|
|
|
|
dz.processQueue();
|
|
|
|
|
|
|
|
// Clear fields and hide popup agian
|
|
|
|
dataConfirmNotification.style.display = "none";
|
|
|
|
btnSubmit.textContent = "Oddaj";
|
|
|
|
form.reset();
|
2021-03-24 10:05:36 +00:00
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
|
2021-05-24 08:15:54 +00:00
|
|
|
// First change the button to actually tell dropzone to process the queue.
|
2021-03-24 10:05:36 +00:00
|
|
|
btnSubmitFinal.addEventListener("click", function(e) {
|
|
|
|
// Hand off data to dropzone
|
|
|
|
dz.processQueue();
|
|
|
|
|
|
|
|
// Clear fields and hide popup agian
|
2021-11-16 17:45:20 +00:00
|
|
|
/*btnSubmit.disabled = false;
|
2021-09-02 12:40:54 +00:00
|
|
|
dataConfirmNotification.style.display = "none";
|
|
|
|
btnSubmit.textContent = "Oddaj";
|
2021-03-24 10:05:36 +00:00
|
|
|
form.reset();
|
2021-11-16 17:45:20 +00:00
|
|
|
scrollboxTriggered = false;*/
|
2021-03-24 10:05:36 +00:00
|
|
|
});
|
|
|
|
|
2021-11-16 17:45:20 +00:00
|
|
|
/*btnSubmitCancel.addEventListener("click", function(e) {
|
2021-03-24 10:05:36 +00:00
|
|
|
btnSubmit.disabled = false;
|
|
|
|
scrollboxTriggered = false;
|
|
|
|
elemTermsPopup.style.display = "none";
|
2021-11-16 17:45:20 +00:00
|
|
|
});*/
|
2021-05-24 08:15:54 +00:00
|
|
|
|
2021-11-16 17:45:20 +00:00
|
|
|
/*
|
2021-03-24 10:05:36 +00:00
|
|
|
// Enable final submit button only if user scrolls to the end of the terms.
|
|
|
|
function checkScrollboxTrigger(event) {
|
|
|
|
var element = event.target;
|
|
|
|
if (!scrollboxTriggered
|
|
|
|
&& element.scrollHeight - element.scrollTop <= element.clientHeight + 50
|
|
|
|
) {
|
|
|
|
scrollboxTriggered = true;
|
|
|
|
btnSubmitFinal.disabled = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
termsScrollbox.addEventListener('scroll', function(event) {
|
|
|
|
checkScrollboxTrigger(event);
|
|
|
|
});
|
|
|
|
|
|
|
|
termsScrollbox.addEventListener("mouseenter", function(event) {
|
|
|
|
checkScrollboxTrigger(event);
|
2021-11-16 17:45:20 +00:00
|
|
|
});*/
|
2021-03-24 10:05:36 +00:00
|
|
|
|
|
|
|
// Listen to the sendingmultiple event. In this case, it's the sendingmultiple event instead
|
|
|
|
// of the sending event because uploadMultiple is set to true.
|
2021-11-16 17:45:20 +00:00
|
|
|
/*this.on("sendingmultiple", function() {
|
2021-03-24 10:05:36 +00:00
|
|
|
// Gets triggered when the form is actually being sent.
|
|
|
|
// Hide the success button or the complete form.
|
|
|
|
});
|
|
|
|
|
|
|
|
this.on("successmultiple", function(files, response) {
|
|
|
|
// Gets triggered when the files have successfully been sent.
|
|
|
|
// Redirect user or notify of success.
|
|
|
|
alert("Odgovor strežnika: " + response);
|
|
|
|
location.reload();
|
|
|
|
});
|
|
|
|
|
|
|
|
this.on("errormultiple", function(files, response) {
|
|
|
|
// Gets triggered when there was an error sending the files.
|
|
|
|
// Maybe show form again, and notify user of error
|
2021-11-16 17:45:20 +00:00
|
|
|
});*/
|
|
|
|
this.on("sending", function(file, xhr, formData) {
|
|
|
|
formData.append("program",form["program"].value);
|
|
|
|
formData.append("predmet",form["predmet"].value);
|
|
|
|
formData.append("predmet-custom",form["predmet-custom"].value);
|
|
|
|
formData.append("letnik",form["letnik"].value);
|
|
|
|
formData.append("vrsta",form["vrsta"].value);
|
|
|
|
formData.append("vrsta-custom",form["vrsta-custom"].value);
|
|
|
|
formData.append("solsko-leto",form["solsko-leto"].value);
|
|
|
|
formData.append("jezikovni-popravki",form["jezikovni-popravki"].value);
|
|
|
|
|
2021-03-24 10:05:36 +00:00
|
|
|
});
|
2021-05-24 08:15:54 +00:00
|
|
|
|
2021-11-16 17:45:20 +00:00
|
|
|
|
|
|
|
},
|
|
|
|
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 + "%";
|
|
|
|
}
|
2021-03-24 10:05:36 +00:00
|
|
|
}
|
2021-11-16 17:45:20 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-03-24 10:05:36 +00:00
|
|
|
}
|
|
|
|
</script>
|
|
|
|
</body>
|
|
|
|
</html>
|