391 lines
15 KiB
HTML
391 lines
15 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<title>Admin panel - Šolar</title>
|
|
<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/manage-institution.css" type="text/css">
|
|
<style>
|
|
.tableFixHead {
|
|
overflow-y: scroll;
|
|
max-height: 306px;
|
|
}
|
|
.tableFixHead thead th {
|
|
position: sticky;
|
|
top: 0;
|
|
}
|
|
table {
|
|
border-collapse: collapse;
|
|
width: 100%;
|
|
}
|
|
th,
|
|
td {
|
|
padding: 8px 16px;
|
|
border: 1px solid #ccc;
|
|
}
|
|
th {
|
|
background: #eee;
|
|
}
|
|
h2 {
|
|
color: blue;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<header>
|
|
<div class="logo"><a href="../"><img src="../static/image/logo-white.svg"/></a></div>
|
|
<div class="menu-items">
|
|
{% 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="https://slovenscina.eu/" target="_blank">Več informacij</a>
|
|
<a href="../logout">Odjava</a>
|
|
</div>
|
|
</header>
|
|
<div class="container" style="margin-top:8rem;">
|
|
{% with messages = get_flashed_messages() %}
|
|
{% if messages %}
|
|
<div style="background: blue;">
|
|
{{ messages[0] }}
|
|
</div>
|
|
{% endif %}
|
|
{% endwith %}
|
|
<h2>Uporabniki</h2>
|
|
<h3>Aktivni uporabniki</h3>
|
|
<div class="tableFixHead">
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>ID</th>
|
|
<th>Ime in priimek</th>
|
|
<th>Email</th>
|
|
<th>Vloga</th>
|
|
<th>ID institucije</th>
|
|
<th>Vloga v instituciji</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for item in users %}
|
|
<tr>
|
|
<td>{{item[0].id}}</td>
|
|
<td>{{item[0].name}}</td>
|
|
<td>{{item[0].email}}</td>
|
|
<td>{{item[0].role}}</td>
|
|
<td>{{item[1].institution}}</td>
|
|
<td>{{item[1].role}}</td>
|
|
{% endfor %}
|
|
</table>
|
|
</div>
|
|
<h3>Dodaj uporabnika</h3>
|
|
<form action="../adduser" method="post">
|
|
<label for="name">Ime in priimek:</label><br>
|
|
<input type="text" id="name" name="name"><br>
|
|
<label for="email">Email:</label><br>
|
|
<input type="text" id="email" name="email"><br>
|
|
<label for="password">Geslo:</label><br>
|
|
<input type="password" id="password" name="password"><br>
|
|
<input type="submit" value="Dodaj">
|
|
</form>
|
|
<h3>Spremeni email uporabnika</h3>
|
|
<form action="../changeuseremail" method="post">
|
|
<label for="user-id">ID uporabnika:</label><br>
|
|
<input type="text" id="user-id" name="user-id"><br>
|
|
<label for="email">Nov email:</label><br>
|
|
<input type="text" id="email" name="email"><br>
|
|
<input type="submit" value="Spremeni">
|
|
</form>
|
|
<h3>Spremeni ime in priimek uporabnika</h3>
|
|
<form action="../changeusername" method="post">
|
|
<label for="user-id">ID uporabnika:</label><br>
|
|
<input type="text" id="user-id" name="user-id"><br>
|
|
<label for="name">Ime in priimek:</label><br>
|
|
<input type="text" id="name" name="name"><br>
|
|
<input type="submit" value="Spremeni">
|
|
</form>
|
|
<h3>Odstrani uporabnika</h3>
|
|
<form action="../deluser" method="post">
|
|
<label for="user_id">ID uporabnika:</label><br>
|
|
<input type="text" id="user_id" name="user_id"><br>
|
|
<input type="submit" value="Odstrani">
|
|
</form>
|
|
<h3>Dodeli uporabnika instituciji</h3>
|
|
<form action="../addusertoinstitution" method="post">
|
|
<label for="user_id">ID uporabnika:</label>
|
|
<input type="text" id="user_id" name="user_id"><br>
|
|
<label for="institution_id">ID institucije:</label>
|
|
<input type="text" id="institution_id" name="institution_id"><br>
|
|
<label for="role">Vloga v instituciji:</label>
|
|
<select name="role" id="role">
|
|
<option value="coordinator">Koordinator/-ka</option>
|
|
<option value="mentor">Mentor/-ica</option>
|
|
<option value="other">Druga vloga</option>
|
|
</select>
|
|
<input type="submit" value="Dodeli">
|
|
</form>
|
|
<h3>Odstrani uporabnika iz institucije</h3>
|
|
<form action="../deluserfrominstitution" method="post">
|
|
<label for="user_id">ID uporabnika:</label>
|
|
<input type="text" id="user_id" name="user_id"><br>
|
|
<input type="submit" value="Odstrani">
|
|
</form>
|
|
<h3>Spremeni vlogo uporabniškega računa</h3>
|
|
<form action="../changeuserrole" method="post">
|
|
<label for="user-id">ID uporabnika:</label>
|
|
<input type="text" id="user-id" name="user-id"><br>
|
|
<label for="role">Vloga:</label>
|
|
<select name="role" id="role">
|
|
<option value="admin">Administrator/-ka</option>
|
|
<option value="user">Navaden uporabnik</option>
|
|
</select>
|
|
<input type="submit" value="Spremeni">
|
|
</form>
|
|
<h3>Čakajoči uporabniki</h3>
|
|
<div class="tableFixHead">
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>ID</th>
|
|
<th>Ime in priimek</th>
|
|
<th>Email</th>
|
|
<th>Institucija</th>
|
|
<th>Vloga v instituciji</th>
|
|
<th>Akcije</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for item in inactive_users %}
|
|
<tr>
|
|
<td>{{item[0].id}}</td>
|
|
<td>{{item[0].name}}</td>
|
|
<td>{{item[0].email}}</td>
|
|
<td>{{item[1].institution}}</td>
|
|
<td>{{item[1].role}}</td>
|
|
<td>
|
|
<form action="../activateuser" method="post">
|
|
<input type="hidden" id="id" name="id" value="{{item[0].id}}">
|
|
<input type="submit" value="Aktiviraj">
|
|
</form>
|
|
</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</table>
|
|
</div>
|
|
|
|
<div> </div>
|
|
<h2>Institucije</h2>
|
|
<h3>Dodaj institucijo</h3>
|
|
<form action="../addinstitution" method="post">
|
|
<label for="name">Naziv:</label>
|
|
<input type="text" id="name" name="name"><br>
|
|
<label for="region">Regija:</label>
|
|
<select name="region" id="region">
|
|
<option value="CE">Celje</option>
|
|
<option value="GO">Nova Gorica</option>
|
|
<option value="KK">Krško</option>
|
|
<option value="KP">Koper</option>
|
|
<option value="KR">Kranj</option>
|
|
<option value="LJ">Ljubljana</option>
|
|
<option value="MB">Maribor</option>
|
|
<option value="MS">Murska Sobota</option>
|
|
<option value="NM">Novo mesto</option>
|
|
<option value="PO">Postojna</option>
|
|
<option value="SG">Slovenj Gradec</option>
|
|
</select>
|
|
<input type="submit" value="Dodaj">
|
|
</form>
|
|
<h3>Seznam vseh instituticij</h3>
|
|
<div class="tableFixHead">
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>ID</th>
|
|
<th>Naziv</th>
|
|
<th>Regija</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for item in institutions %}
|
|
<tr>
|
|
<td>{{item.id}}</td>
|
|
<td>{{item.name}}</td>
|
|
<td>{{item.region}}</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</table>
|
|
</div>
|
|
<h3>Združi instituciji</h3>
|
|
<form action="../mergeinstitutions" method="post">
|
|
<label for="id-from">Institucijo z ID</label>
|
|
<input type="text" id="id-from" name="id-from">
|
|
<label for="id-to">združi v institucijo z ID</label>
|
|
<input type="text" id="id-to" name="id-to"><br>
|
|
<input type="submit" value="Združi">
|
|
</form>
|
|
<h3>Spremeni podatke institucije</h3>
|
|
<form action="../changeinstitutiondata" method="post">
|
|
<label for="id">ID institucije</label>
|
|
<input type="text" id="id" name="id"><br>
|
|
<label for="name">Nov naziv:</label>
|
|
<input type="text" id="name" name="name"><br>
|
|
<label for="region">Nova regija:</label>
|
|
<select name="region" id="region">
|
|
<option value="CE">Celje</option>
|
|
<option value="GO">Nova Gorica</option>
|
|
<option value="KK">Krško</option>
|
|
<option value="KP">Koper</option>
|
|
<option value="KR">Kranj</option>
|
|
<option value="LJ">Ljubljana</option>
|
|
<option value="MB">Maribor</option>
|
|
<option value="MS">Murska Sobota</option>
|
|
<option value="NM">Novo mesto</option>
|
|
<option value="PO">Postojna</option>
|
|
<option value="SG">Slovenj Gradec</option>
|
|
</select>
|
|
<input type="submit" value="Spremeni">
|
|
</form>
|
|
<h3>Odstrani vnos</h3>
|
|
<form action="../delcooperationhistoryitem" method="post">
|
|
<label for="entry-id">ID vnosa</label>
|
|
<input type="text" id="entry-id" name="entry-id"><br>
|
|
<input type="submit" value="Odstrani">
|
|
</form>
|
|
<h2>Nalaganja</h2>
|
|
<div class="tableFixHead">
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>ID</th>
|
|
<th>ID uporabnika</th>
|
|
<th>ID institucije</th>
|
|
<th>Čas nalaganja</th>
|
|
<th>Program</th>
|
|
<th>Predmet</th>
|
|
<th>Predmet (drugo)</th>
|
|
<th>Letnik</th>
|
|
<th>Vrsta besedila</th>
|
|
<th>Vrsta besedila (drugo)</th>
|
|
<th>Šolsko leto</th>
|
|
<th>Jezikovni popravki</th>
|
|
<th>ID-ji naloženih datotek</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for item in uploads %}
|
|
<tr>
|
|
<td>{{item.id}}</td>
|
|
<td>{{item.upload_user}}</td>
|
|
<td>{{item.institution}}</td>
|
|
<td>{{item.timestamp}}</td>
|
|
<td>{{item.program}}</td>
|
|
<td>{{item.subject}}</td>
|
|
<td>{{item.subject_custom}}</td>
|
|
<td>{{item.grade}}</td>
|
|
<td>{{item.text_type}}</td>
|
|
<td>{{item.text_type_custom}}</td>
|
|
<td>{{item.school_year}}</td>
|
|
<td>{{item.grammar_corrections}}</td>
|
|
<td>{{item.upload_file_hashes}}</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</table>
|
|
</div>
|
|
<h3>Posodobi podatke nalaganja</h3>
|
|
<form action="../updateuploaditem" method="post">
|
|
<label for="item-id">ID nalaganja</label>
|
|
<input type="text" id="item-id" name="item-id"/><br>
|
|
<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><br>
|
|
|
|
<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><br>
|
|
<div id="predmet-custom-box" style="display: none;">
|
|
<label for="predmet-custom">Ime predmeta:</label>
|
|
<input type="text" id="predmet-custom" name="predmet-custom"/><br>
|
|
</div>
|
|
|
|
<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><br>
|
|
|
|
<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 id="vrsta-custom-box" style="display: none;">
|
|
<label for="vrsta-custom">Vtipkajte besedilno vrsto:</label>
|
|
<input type="text" id="vrsta-custom" name="vrsta-custom"/><br>
|
|
</div>
|
|
|
|
<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><br>
|
|
|
|
<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><br>
|
|
|
|
<button id="button-submit" type="submit">Posodobi</button>
|
|
</form>
|
|
</div>
|
|
<script>
|
|
var selectPredmet = document.getElementById("predmet");
|
|
var selectVrsta = document.getElementById("vrsta");
|
|
|
|
selectPredmet.addEventListener("change", function(e) {
|
|
var predmetCustomBox = document.getElementById("predmet-custom-box");
|
|
if (selectPredmet.value.startsWith("drug")) {
|
|
predmetCustomBox.style.display = "inherit";
|
|
} else {
|
|
predmetCustomBox.style.display = "none";
|
|
}
|
|
});
|
|
|
|
selectVrsta.addEventListener("change", function(e) {
|
|
var vrstaCustomBox = document.getElementById("vrsta-custom-box");
|
|
if (selectVrsta.value == "delo-v-razredu") {
|
|
vrstaCustomBox.style.display = "inherit";
|
|
} else {
|
|
vrstaCustomBox.style.display = "none";
|
|
}
|
|
});
|
|
</script>
|
|
</body>
|