portal-oddajanje-solar/templates/solar-pogodbe.html

170 lines
5.1 KiB
HTML
Raw Normal View History

2021-05-24 08:15:54 +00:00
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Portal za oddajanje besedil</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/contracts.css" type="text/css">
2021-05-24 08:15:54 +00:00
</head>
<body>
2021-11-26 12:50:32 +00:00
<header>
<div class="logo"><a href="../"><img src="../static/image/logo-white.svg"/></a></div>
2021-11-26 12:50:32 +00:00
<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 %}
2021-12-13 20:01:28 +00:00
<a href="https://slovenscina.eu/" target="_blank">Več informacij</a>
2021-11-26 12:50:32 +00:00
</div>
</header>
<div class="container" style="margin-top:8rem;">
<div class="row">
<div class="col-12">
2021-12-15 20:23:26 +00:00
<h1 class="title">Korpus Šolar</h1>
2021-12-13 20:01:28 +00:00
<p class="subtitle"></p>
2021-11-26 12:50:32 +00:00
<div class="tab-nav">
<a href="../oddaja">Oddaja besedil</a>
<a href="../zgodovina">Zgodovina sodelovanja</a>
<a href="../pogodbe" class="active">Ekipa</a>
2021-11-26 12:50:32 +00:00
</div>
</div>
</div>
2021-12-15 20:23:26 +00:00
<!--<div class="row">
2021-11-26 12:50:32 +00:00
<div class="col-12">
<h2>Sodelujoči</h2>
</div>
2021-12-15 20:23:26 +00:00
</div>-->
2022-01-05 18:33:43 +00:00
<div class="row">
<div class="col-12">
<h2>Število oddaj na uporabnika</h2>
</div>
</div>
<div class="row">
<div class="col-6">
<div id="my_dataviz">
2021-11-26 12:50:32 +00:00
2022-01-05 18:33:43 +00:00
</div>
</div>
</div>
2022-01-08 15:25:25 +00:00
{% set vars = {'prev_schoolyear': ''} %}
{% for item in cooperation_history %}
{% if item.school_year != vars.prev_schoolyear %}
<div class="row">
<div class="col-12">
<h2>Šolsko leto {{item.school_year}}</h2>
</div>
</div>
2021-11-26 12:50:32 +00:00
2022-01-08 15:25:25 +00:00
{% if vars.update({'prev_schoolyear': item.school_year}) %} {% endif %}
{% endif %}
<div class="row">
<div class="col-6">
<div class="team-item">
<div class="team-item-name">{{item.name}} <span class="team-item-role">{{item.badge_text}}</span></div>
</div>
</div>
</div>
{% endfor %}
2021-11-26 12:50:32 +00:00
2022-01-08 15:25:25 +00:00
</div>
2021-11-26 12:50:32 +00:00
2022-01-08 15:25:25 +00:00
<br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/>
2021-11-26 12:50:32 +00:00
2021-09-16 15:25:20 +00:00
2021-05-24 08:15:54 +00:00
</body>
2021-12-15 20:23:26 +00:00
<script src="https://d3js.org/d3.v6.js"></script>
2022-01-04 17:36:42 +00:00
<style>
#my_dataviz .tick line{
visibility:hidden;
}
#my_dataviz path.domain{
visibility:hidden;
}
</style>
2021-11-26 12:50:32 +00:00
<script>
2022-01-04 17:36:42 +00:00
// set the dimensions and margins of the graph
2022-01-05 18:33:43 +00:00
2022-01-04 17:36:42 +00:00
// append the svg object to the body of the page
2022-01-05 18:33:43 +00:00
2022-01-04 17:36:42 +00:00
var data;
// Parse the Data
d3.json("/topuploads-by-user/").then(function(jsondata) {
2022-01-05 18:33:43 +00:00
if(Object.keys(jsondata).length < 1) {
return;
}
2022-01-04 17:36:42 +00:00
data = [];
2022-01-05 18:33:43 +00:00
console.log(Object.keys(jsondata).length);
var margin = {top: 20, right: 0, bottom: 40, left: 0};
var width = document.getElementById("my_dataviz").clientWidth - margin.left - margin.right;
var height = Object.keys(jsondata).length * 56;
var svg = d3.select("#my_dataviz")
.append("svg")
.attr("width", width + margin.left + margin.right)
.attr("height", height + margin.top + margin.bottom)
.style("overflow","visible")
.append("g")
.attr("transform",
"translate(" + margin.left + "," + margin.top + ")");
2022-01-04 17:36:42 +00:00
for(var key in jsondata) {
data.push({'name': key, 'value':jsondata[key]});
}
console.log(data);
// Add X axis
var x = d3.scaleLinear()
.domain([0,d3.max(data, function (d) { return d.value})])
.range([ 0, width]);
svg.append("g")
.attr("transform", "translate(0," + height + ")")
.call(d3.axisBottom(x))
.selectAll("text")
.style("text-anchor", "center");
// Y axis
var y = d3.scaleBand()
2022-01-05 18:33:43 +00:00
.range([ 0, data.length*56 ])
2022-01-04 17:36:42 +00:00
.domain(data.map(function(d) { return d.name; }))
2022-01-05 18:33:43 +00:00
.padding(0);
2022-01-04 17:36:42 +00:00
svg.append("g")
.call(d3.axisLeft(y))
2022-01-05 18:33:43 +00:00
.selectAll("text")
.style("text-anchor", "start")
.style("font-size", "14px")
.attr("transform", "translate(8,-36)");
2022-01-04 17:36:42 +00:00
//Bars
svg.selectAll("myRect")
.data(data)
.enter()
.append("rect")
.attr("x", x(0) )
.attr("y", function(d) { return y(d.name); })
.attr("width", function(d) { return x(d.value); })
2022-01-05 18:33:43 +00:00
.attr("height", 32 )
.attr("fill", "#006CB7");
2022-01-04 17:36:42 +00:00
})
2021-11-26 12:50:32 +00:00
</script>
2021-05-24 08:15:54 +00:00
</html>