diff --git a/cerealblotchmodels/templates/cerealblotchmodels/septoriahumiditymodelform.html b/cerealblotchmodels/templates/cerealblotchmodels/septoriahumiditymodelform.html index 47731093e6edbe9405cf5cf4619606da6aa479b0..9306d862ffd56a4e5d8aa31764270bece3e22062 100644 --- a/cerealblotchmodels/templates/cerealblotchmodels/septoriahumiditymodelform.html +++ b/cerealblotchmodels/templates/cerealblotchmodels/septoriahumiditymodelform.html @@ -3,7 +3,7 @@ {% comment %} # -# Copyright (c) 2018 NIBIO <http://www.nibio.no/>. +# Copyright (c) 2020 NIBIO <http://www.nibio.no/>. # # This file is part of VIPSWeb. # VIPSWeb is free software: you can redistribute it and/or modify @@ -26,6 +26,7 @@ {% block content %} <div class="singleBlockContainer"> <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 }}"> <div class="row"> <div class="col-md-12"> @@ -45,7 +46,6 @@ <label for="weatherStationId">{% trans "Weather station" %}</label> <select name="weatherStationId" id="weatherStationId" class="form-control"> <option value="">{% trans "Please select" %}</option> - <option value="test">TEST</option> </select> <span class="help-block" id="{{ form_id }}_weatherStationId_validation"></span> </div> @@ -159,6 +159,9 @@ <div class="col-md-12" id="chartContainer" style="height:400px; display: none;"> </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="col-md-12"> <div class="table-responsive"> @@ -225,6 +228,7 @@ }); + var initDanishPostCodesUTM = function(callback){ $.ajax({ type:"GET", @@ -351,6 +355,7 @@ var runModel = function(){ document.getElementById("chartContainer").style.display="none"; // Hide chart + document.getElementById("warningStatusInterpretation").style.display="none"; // Insert please wait message document.getElementById("resultsTable").innerHTML='<div class="alert alert-info" role="alert">{% trans "The model is running, please wait" %}</div>'; var formStr = $("#{{ form_id }}").serialize(); @@ -426,6 +431,7 @@ // Then: The chart // We must sort data ascending again document.getElementById("chartContainer").style.display="block"; + document.getElementById("warningStatusInterpretation").style.display="block"; data.reverse(); var warningStatusPlotBandData = getWarningStatusPlotBandData(data); var data = getHighChartsSeries( diff --git a/cerealblotchmodels/views.py b/cerealblotchmodels/views.py index f7fc75b051abb39a185adb014d945ee4ddac0682..c5617766bb24485b1e69ac067ad0caa6681f6d5f 100755 --- a/cerealblotchmodels/views.py +++ b/cerealblotchmodels/views.py @@ -3,6 +3,8 @@ from django.conf import settings from datetime import datetime from dateutil.relativedelta import relativedelta +from forecasts.models import Model + # Create your views here. @@ -48,7 +50,9 @@ def wheatleafblotchform(request): return render(request, 'cerealblotchmodels/wheatleafblotchform.html', context) def septoriahumidityform(request): + model = Model.get_model("SEPTORIAHU") context = { - "form_id" : "septoriaHumidityForm" + "form_id" : "septoriaHumidityForm", + "model": model } return render(request, 'cerealblotchmodels/septoriahumiditymodelform.html', context) \ No newline at end of file