portal-oddajanje-solar/templates/solar-zgodovina.html
2022-02-14 17:37:41 +01:00

224 lines
9.1 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Portal za oddajanje besedil</title>
<!--<link rel="stylesheet" href="../static/style.css" type="text/css">-->
<script src="../static/chart.js"></script>
<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/history.css" type="text/css">
</head>
<body>
<header>
<div class="logo"><a href="../"><img src="../static/image/logo-white.svg"/></a></div>
<div class="dropdown">
<button class="dropbtn"><img src="/static/image/menu.svg"/></button>
<div class="dropdown-content">
<a href="../oddaja">Oddaja</a>
<a href="../zgodovina">Zgodovina</a>
<a href="../pogodbe">Ekipa</a>
{% if is_institution_coordinator %}
<hr/>
<a href="../manage-institution">Upravljaj z institucijo</a>
{% endif %}
{% if is_admin %}
<hr/>
<a href="../admin">Administracijski meni</a>
{% endif %}
<hr/>
<a href="https://slovenscina.eu/" target="_blank">Več informacij</a>
<hr/>
<a href="../logout">Odjava</a>
</div>
</div>
</header>
<div class="container" style="margin-top:8rem;">
<div class="row">
<div class="col-12">
<h1 class="title">Korpus Šolar</h1>
<p class="subtitle"></p>
<div class="tab-nav">
<a href="../oddaja">Oddaja besedil</a>
<a href="../zgodovina" class="active">Zgodovina sodelovanja</a>
<a href="../pogodbe">Ekipa</a>
</div>
</div>
</div>
<!--<div class="row">
<div class="col-12">
<h2>Zgodovina naloženih datotek</h2>
</div>
</div>-->
{% set map_program = {
"OS" : "Osnovna šola",
"SSG" : "Splošna in strokovna gimnazija",
"MGP" : "Mednarodni gimnazijski programi",
"ZG" : "Zasebne gimnazije",
"NPI" : "Nižje poklicno izobraževanje",
"SPI" : "Srednje poklicno izobraževanje",
"SSI" : "Srednje strokovno izobraževanje",
"PTI" : "Poklicno-tehnično izobraževanje"
}%}
{% set map_subject = {
"SLO" : "Slovenščina",
"DJP" : "Drugi jezikoslovni predmeti",
"DDP" : "Drugi družboslovni predmeti",
"DNP" : "Drugi naravoslovni predmeti",
"DSP" : "Drugi strokovni predmeti",
"DIP" : "Drugi izbirni ali dodatni predmeti",
}%}
{% set map_text_type = {
"E" : "Esej ali spis",
"PB" : "Praktično besedilo, napisano za oceno",
"T" : "Šolski test",
"R" : "Delo v razredu, ne za oceno",
}%}
{% set map_grammar_corrections = {
"DD" : "Besedilo vsebuje učiteljske popravke",
"N" : "Besedilo ne vsebuje učiteljskih popravkov",
"DN" : "Besedilo vsebuje učiteljske popravke in ne strinjam se z njihovo vključitvijo v korpus",
}%}
{% set map_regions = {
"CE" : "Celje",
"GO" : "Nova Gorica",
"KK" : "Krško",
"KP" : "Koper",
"KR" : "Kranj",
"LJ" : "Ljubljana",
"MB" : "Maribor",
"MS" : "Murska Sobota",
"NM" : "Novo Mesto",
"PO" : "Postojna",
"SG" : "Slovenj Gradec",
}%}
{% if upload_history|length == 0 %}
<div class="row">
<div class="col-6">
<p>Zgodovina sodelovanja je trenutno še prazna.</p>
</div>
</div>
{% endif %}
{% for item in upload_history %}
{% set item_values = [] %}
{% if institution_names[loop.index - 1] %}
{% set item_values = item_values + [institution_names[loop.index - 1]] %}
{% endif %}
{% if item.region %}
{% set item_values = item_values + [map_regions[item.region]] %}
{% endif %}
{% if item.program %}
{% set item_values = item_values + [map_program[item.program]] %}
{% endif %}
{% if item.subject %}
{% set item_values = item_values + [map_subject[item.subject]] %}
{% endif %}
{% if item.subject_custom %}
{% set item_values = item_values + [item.subject_custom] %}
{% endif %}
{% if item.grade %}
{% set item_values = item_values + [item.grade ~ ". razred"] %}
{% endif %}
{% if item.text_type %}
{% set item_values = item_values + [map_text_type[item.text_type]] %}
{% endif %}
{% if item.text_type_custom %}
{% set item_values = item_values + [item.text_type_custom] %}
{% endif %}
{% if item.school_year %}
{% set item_values = item_values + ['20' ~ item.school_year | replace("-", "/")] %}
{% endif %}
{% if item.grammar_corrections %}
{% set item_values = item_values + [map_grammar_corrections[item.grammar_corrections]] %}
{% endif %}
<div class="row">
<div class="col-12">
<div class="history-item">
<div class="history-item-date">Dodano {{ item.timestamp.strftime('%d. %m. %Y') }}</div>
<div class="history-item-uploader">{{ uploader_names[loop.index - 1] }}</div>
<div class="history-item-filecount">Št. datotek: {{ item.upload_file_hashes|length }}</div>
<div class="history-item-chevron"><img src="../static/image/chevron-down.svg"/></div>
<div class="history-item-desc">
{{ item_values | join(" | ") |truncate(120) }}
</div>
<div class="row">
<div class="col-6" style="margin:0">
<div class="history-item-desc-full">
{% for v in item_values %}
{{v}}<br>
{% endfor %}
</div>
</div>
<div class="col-6" style="margin:0">
<div class="history-item-files-full">
{% if item.upload_file_names != None %}
{% for f_name in item.upload_file_names %}
<div class="file-item">
<div class="file-icon"><img src="../static/image/file.svg"/></div>
<a href="getuploadfile/{{item.id}}/{{item.upload_file_hashes[loop.index - 1]}}" class="file-name" {% if item.upload_file_codes != None %}download="{{item.upload_file_codes[loop.index - 1]}}.{{f_name.split('.')[1]}}"{%endif%}>
{% if item.upload_file_codes != None %}
{{item.upload_file_codes[loop.index - 1]}}.{{f_name.split('.')[1]}}
{%else%}
{{f_name}}
{% endif %}
</a>
</br>
{% if item.upload_file_codes != None %}
<!--<div>{{item.upload_file_codes[loop.index - 1]}}</div>-->
{% endif %}
</div>
{% endfor %}
{% else %}
{% for f_hash in item.upload_file_hashes %}
<div class="file-item">
<div class="file-icon"><img src="../static/image/file.svg"/></div>
<a href="getuploadfile/{{item.id}}/{{f_hash}}" class="file-name">{{f_hash}}</a>
</div>
{% endfor %}
{% endif %}
</div>
</div>
</div>
</div>
</div>
</div>
{% endfor %}
</div>
<br/><br/><br/><br/><br/><br/><br/>
<script>
var toggleOpen = function() {
this.classList.toggle("open");
};
var elements = document.getElementsByClassName("history-item");
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>