added check if empty

This commit is contained in:
Leon Noe Jovan 2022-02-14 17:37:41 +01:00
parent f898ee8d31
commit b19cfa6d48
2 changed files with 9 additions and 2 deletions

View File

@ -55,7 +55,7 @@
<h2>Sodelujoči</h2> <h2>Sodelujoči</h2>
</div> </div>
</div>--> </div>-->
<div class="row"> <div class="row" id="my_dataviz_title">
<div class="col-12"> <div class="col-12">
<h2>Število oddaj na uporabnika</h2> <h2>Število oddaj na uporabnika</h2>
</div> </div>
@ -112,6 +112,7 @@
// Parse the Data // Parse the Data
d3.json("/topuploads-institution/{{institution_id}}").then(function(jsondata) { d3.json("/topuploads-institution/{{institution_id}}").then(function(jsondata) {
if(Object.keys(jsondata).length < 1) { if(Object.keys(jsondata).length < 1) {
document.getElementById("my_dataviz_title").remove();
return; return;
} }
data = []; data = [];

View File

@ -98,7 +98,13 @@
}%} }%}
{% 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 %} {% for item in upload_history %}
{% set item_values = [] %} {% set item_values = [] %}
{% if institution_names[loop.index - 1] %} {% if institution_names[loop.index - 1] %}