Skip to content
Snippets Groups Projects
Commit 65ffb757 authored by Tor-Einar Skog's avatar Tor-Einar Skog
Browse files

Bugfix/updates

parent 21ceebff
No related branches found
No related tags found
No related merge requests found
......@@ -206,7 +206,7 @@
var headingLine = "<tr><td style=\"font-weight: bold;\">{% trans "Time" %}</td>";
if(data.length > 0)
{
var allKeys = data[0].keys;
var allKeys = JSON.parse(data[0]["keys"]);
for(var i in allKeys)
{
headingLine +="<td style=\"font-weight: bold;\">" + paramDict[allKeys[i]] + "</td>";
......@@ -217,14 +217,16 @@
var table = ["<table border=\"1\">",headingLine];
for(var row in data)
{
if(data[row]["validTimeStart"] == null)
var aResult = data[i];
var allValues = JSON.parse(aResult["allValues"]);
if(aResult["validTimeStart"] == null)
{
continue;
}
var resultLine = "<tr><td>" + moment(data[row]["validTimeStart"]).format() + "</td>";
var resultLine = "<tr><td>" + moment(aResult["validTimeStart"]).format() + "</td>";
for(var i in allKeys)
{
var value = data[row].allValues[allKeys[i]];
var value = allValues[allKeys[i]];
if(value != null && $.isNumeric(value))
{
value = parseFloat(value).toFixed(2);
......@@ -232,7 +234,7 @@
resultLine +="<td>" + value + "</td>";
}
resultLine +="<td style=\"background-color:";
var st = data[row]["warningStatus"];
var st = aResult["warningStatus"];
resultLine += st===0 ? "gray" : st===1 ? "blue" : st===2 ? "green" : st===3 ? "yellow" : "red";
resultLine +=";\">" + st + "</td>";
resultLine += "</tr>";
......@@ -357,6 +359,10 @@
};
$(document).ready(function() {
if(settings.userIsIE)
{
alert("{% trans "WARNING: We suspect you are using Internet Explorer to view this site. VIPS is not designed to work with Internet Explorer, you may experience errors and missing features. Please use a different browser, like Microsoft Edge or Google Chrome." %}");
}
initWeatherStations();
initCrops();
initPreparations();
......
......@@ -201,7 +201,10 @@
var specialFormFields = ["organizationId_countryCode","weatherStationId"]; // Must be initialized after a few events
$(document).ready(function() {
if(settings.userIsIE)
{
alert("{% trans "WARNING: We suspect you are using Internet Explorer to view this site. VIPS is not designed to work with Internet Explorer, you may experience errors and missing features. Please use a different browser, like Microsoft Edge or Google Chrome." %}");
}
//initWeatherStations();
// Init form validation
loadFormDefinition("{{ form_id }}","/static/cerealblotchmodels/formdefinitions/");
......
......@@ -32,10 +32,6 @@
{% block content %}
<div class="singleBlockContainer">
<h1>{% trans "Wheat leaf blotch" %}</h1>
<div class="alert alert-danger" role="alert" id="oldIEWarning" style="display:none;">
Du bruker en gammel versjon av Internet Explorer. Den nye bladflekksjukdomsmodellen fungerer med
de fleste moderne nettlesere, som Chrome, Firefox og Internet Explorer versjon 10 og nyere.
</div>
<form role="form" id="{{ form_id }}">
<input type="hidden" name="wheatType" id="wheatType" value="-1"/>
<div class="row">
......@@ -282,7 +278,7 @@
var table = ["<table border=\"1\">",headingLine];
for(var i in data)
{
console.info(data[i]);
//console.info(data[i]);
var aResult = data[i];
var allValues = JSON.parse(aResult["allValues"]);
if(aResult["validTimeStart"] == null)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment