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

Added help texts to model form page

parent 485f6ae7
Branches
No related tags found
No related merge requests found
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
{% comment %} {% comment %}
# #
# Copyright (c) 2018 NIBIO <http://www.nibio.no/>. # Copyright (c) 2020 NIBIO <http://www.nibio.no/>.
# #
# This file is part of VIPSWeb. # This file is part of VIPSWeb.
# VIPSWeb is free software: you can redistribute it and/or modify # VIPSWeb is free software: you can redistribute it and/or modify
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
{% block content %} {% block content %}
<div class="singleBlockContainer"> <div class="singleBlockContainer">
<h1>{% trans "Septoria humidity model" %}</h1> <h1>{% trans "Septoria humidity model" %}</h1>
<p>{% trans "Fuktmodellen er et beslutningsstøtteverktøy, utviklet av <a href='https://www.seges.dk/'>SEGES</a>, Danmark, for å kunne vurdere risiko for angrep av hvetebladprikk i høsthvete under danske forhold. <a href='/forecasts/models/SEPTORIAHU/' target='new'>Les mer</a>" %}</p>
<form role="form" id="{{ form_id }}"> <form role="form" id="{{ form_id }}">
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">
...@@ -45,7 +46,6 @@ ...@@ -45,7 +46,6 @@
<label for="weatherStationId">{% trans "Weather station" %}</label> <label for="weatherStationId">{% trans "Weather station" %}</label>
<select name="weatherStationId" id="weatherStationId" class="form-control"> <select name="weatherStationId" id="weatherStationId" class="form-control">
<option value="">{% trans "Please select" %}</option> <option value="">{% trans "Please select" %}</option>
<option value="test">TEST</option>
</select> </select>
<span class="help-block" id="{{ form_id }}_weatherStationId_validation"></span> <span class="help-block" id="{{ form_id }}_weatherStationId_validation"></span>
</div> </div>
...@@ -159,6 +159,9 @@ ...@@ -159,6 +159,9 @@
<div class="col-md-12" id="chartContainer" style="height:400px; display: none;"> <div class="col-md-12" id="chartContainer" style="height:400px; display: none;">
</div> </div>
</div> </div>
<div class="alert alert-info" role="alert" id="warningStatusInterpretation" style="display: none;">
{{model.warning_status_interpretation|safe| linebreaks}}
</div>
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">
<div class="table-responsive"> <div class="table-responsive">
...@@ -225,6 +228,7 @@ ...@@ -225,6 +228,7 @@
}); });
var initDanishPostCodesUTM = function(callback){ var initDanishPostCodesUTM = function(callback){
$.ajax({ $.ajax({
type:"GET", type:"GET",
...@@ -351,6 +355,7 @@ ...@@ -351,6 +355,7 @@
var runModel = function(){ var runModel = function(){
document.getElementById("chartContainer").style.display="none"; // Hide chart document.getElementById("chartContainer").style.display="none"; // Hide chart
document.getElementById("warningStatusInterpretation").style.display="none";
// Insert please wait message // Insert please wait message
document.getElementById("resultsTable").innerHTML='<div class="alert alert-info" role="alert">{% trans "The model is running, please wait" %}</div>'; document.getElementById("resultsTable").innerHTML='<div class="alert alert-info" role="alert">{% trans "The model is running, please wait" %}</div>';
var formStr = $("#{{ form_id }}").serialize(); var formStr = $("#{{ form_id }}").serialize();
...@@ -426,6 +431,7 @@ ...@@ -426,6 +431,7 @@
// Then: The chart // Then: The chart
// We must sort data ascending again // We must sort data ascending again
document.getElementById("chartContainer").style.display="block"; document.getElementById("chartContainer").style.display="block";
document.getElementById("warningStatusInterpretation").style.display="block";
data.reverse(); data.reverse();
var warningStatusPlotBandData = getWarningStatusPlotBandData(data); var warningStatusPlotBandData = getWarningStatusPlotBandData(data);
var data = getHighChartsSeries( var data = getHighChartsSeries(
......
...@@ -3,6 +3,8 @@ from django.conf import settings ...@@ -3,6 +3,8 @@ from django.conf import settings
from datetime import datetime from datetime import datetime
from dateutil.relativedelta import relativedelta from dateutil.relativedelta import relativedelta
from forecasts.models import Model
# Create your views here. # Create your views here.
...@@ -48,7 +50,9 @@ def wheatleafblotchform(request): ...@@ -48,7 +50,9 @@ def wheatleafblotchform(request):
return render(request, 'cerealblotchmodels/wheatleafblotchform.html', context) return render(request, 'cerealblotchmodels/wheatleafblotchform.html', context)
def septoriahumidityform(request): def septoriahumidityform(request):
model = Model.get_model("SEPTORIAHU")
context = { context = {
"form_id" : "septoriaHumidityForm" "form_id" : "septoriaHumidityForm",
"model": model
} }
return render(request, 'cerealblotchmodels/septoriahumiditymodelform.html', context) return render(request, 'cerealblotchmodels/septoriahumiditymodelform.html', context)
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment