registration, charts, contracts history
This commit is contained in:
@@ -4,9 +4,16 @@
|
||||
<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>
|
||||
</head>
|
||||
<body>
|
||||
<a href="/solar/logout">Odjavi se</a>
|
||||
{% if is_institution_moderator %}
|
||||
<br><a href="/solar/manage-institution">Upravljaj z institucijo</a>
|
||||
{% endif %}
|
||||
{% if is_admin %}
|
||||
<br><a href="/solar/admin">Administracijski meni</a>
|
||||
{% endif %}
|
||||
<div class="bg"></div>
|
||||
<div id="main-window">
|
||||
<div id="rect1">
|
||||
@@ -72,6 +79,40 @@
|
||||
</div>
|
||||
</div>
|
||||
<div id="rect2" class="mock-side">
|
||||
<canvas id="myChart" width="400" height="400"></canvas>
|
||||
<script>
|
||||
function drawChart(data) {
|
||||
var ctx = document.getElementById('myChart').getContext('2d');
|
||||
var myChart = new Chart(ctx, {
|
||||
type: 'bar',
|
||||
data: {
|
||||
labels: Object.keys(data),
|
||||
datasets: [{
|
||||
label: 'št. naloženih datotek',
|
||||
data: Object.values(data),
|
||||
backgroundColor: 'rgba(54, 162, 235, 1.0)',
|
||||
borderWidth: 1
|
||||
}]
|
||||
},
|
||||
options: {
|
||||
plugins: {
|
||||
title: {
|
||||
display: true,
|
||||
text: ''
|
||||
}
|
||||
},
|
||||
scales: {
|
||||
y: {
|
||||
beginAtZero: true
|
||||
}
|
||||
},
|
||||
indexAxis: 'y'
|
||||
}
|
||||
});
|
||||
}
|
||||
fetch('/solar/topuploads').then(r => r.json()).then(j => drawChart(j));
|
||||
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
Reference in New Issue
Block a user