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

Added last_days form input to forecast detail view

parent 4d815bcb
Branches
No related tags found
No related merge requests found
No preview for this file type
...@@ -19,7 +19,7 @@ msgid "" ...@@ -19,7 +19,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: VIPS BG\n" "Project-Id-Version: VIPS BG\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2014-04-29 13:14+0200\n" "POT-Creation-Date: 2014-11-11 15:08+0100\n"
"PO-Revision-Date: 2014-05-14 09:37+0200\n" "PO-Revision-Date: 2014-05-14 09:37+0200\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
...@@ -30,59 +30,75 @@ msgstr "" ...@@ -30,59 +30,75 @@ msgstr ""
"Plural-Forms: nplurals=2; plural=(n != 1);\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Poedit 1.6.5\n" "X-Generator: Poedit 1.6.5\n"
#: templates/forecasts/detail.html:22 templates/forecasts/detail.html.py:24 #: templates/forecasts/detail.html:25 templates/forecasts/detail.html.py:27
msgid "Details" msgid "Details"
msgstr "Подробности" msgstr "Подробности"
#: templates/forecasts/detail.html:36 #: templates/forecasts/detail.html:39
msgid "Model" msgid "Model"
msgstr "Модел" msgstr "Модел"
#: templates/forecasts/detail.html:37 templates/forecasts/index.html:30 #: templates/forecasts/detail.html:40 templates/forecasts/index.html:33
msgid "Location" msgid "Location"
msgstr "Място" msgstr "Място"
#: templates/forecasts/detail.html:38 #: templates/forecasts/detail.html:41
msgid "Weather station" msgid "Weather station"
msgstr "Климатична станция" msgstr "Климатична станция"
#: templates/forecasts/detail.html:38 #: templates/forecasts/detail.html:41
msgid "Distance to location" msgid "Distance to location"
msgstr "Разстояние до мястото" msgstr "Разстояние до мястото"
#: templates/forecasts/detail.html:39 #: templates/forecasts/detail.html:42
msgid "Period" msgid "Period"
msgstr "Период" msgstr "Период"
#: templates/forecasts/detail.html:46
msgid "Showing latest"
msgstr ""
#: templates/forecasts/detail.html:48
msgid "Days"
msgstr ""
#: templates/forecasts/detail.html:49 #: templates/forecasts/detail.html:49
msgid "Change"
msgstr ""
#: templates/forecasts/detail.html:61
msgid "Timestamp" msgid "Timestamp"
msgstr "Единица за време" msgstr "Единица за време"
#: templates/forecasts/detail.html:50 #: templates/forecasts/detail.html:62
msgid "Warning status" msgid "Warning status"
msgstr "Вид предупреждение" msgstr "Вид предупреждение"
#: templates/forecasts/detail.html:70 #: templates/forecasts/detail.html:82
msgid "No results for this forecast" msgid "No results for this forecast"
msgstr "Няма резултати за тази прогноза" msgstr "Няма резултати за тази прогноза"
#: templates/forecasts/index.html:22 templates/forecasts/index.html.py:24 #: templates/forecasts/index.html:24 templates/forecasts/index.html.py:26
msgid "Forecasts" msgid "Forecasts"
msgstr "Прогнози" msgstr "Прогнози"
#: templates/forecasts/index.html:29 #: templates/forecasts/index.html:31
msgid "Model name" msgid "Model name"
msgstr "Име на модела" msgstr "Име на модела"
#: templates/forecasts/index.html:31 #: templates/forecasts/index.html:32
msgid "Crop"
msgstr ""
#: templates/forecasts/index.html:34
msgid "Date start" msgid "Date start"
msgstr "Начална дата" msgstr "Начална дата"
#: templates/forecasts/index.html:32 #: templates/forecasts/index.html:35
msgid "Date end" msgid "Date end"
msgstr "Крайна дата" msgstr "Крайна дата"
#: templates/forecasts/index.html:43 #: templates/forecasts/index.html:47
msgid "Results" msgid "Results"
msgstr "Резултати" msgstr "Резултати"
......
No preview for this file type
...@@ -7,7 +7,7 @@ msgid "" ...@@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: VIPS\n" "Project-Id-Version: VIPS\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2014-10-08 18:26+0200\n" "POT-Creation-Date: 2014-11-11 15:08+0100\n"
"PO-Revision-Date: 2014-10-10 13:04+0100\n" "PO-Revision-Date: 2014-10-10 13:04+0100\n"
"Last-Translator: Vjekoslav vujica <wvjeko@gmail.com>\n" "Last-Translator: Vjekoslav vujica <wvjeko@gmail.com>\n"
"Language-Team: LANGUAGE <wvjeko@gmail.com>\n" "Language-Team: LANGUAGE <wvjeko@gmail.com>\n"
...@@ -20,63 +20,75 @@ msgstr "" ...@@ -20,63 +20,75 @@ msgstr ""
"X-Generator: Poedit 1.6.9\n" "X-Generator: Poedit 1.6.9\n"
"X-Poedit-SourceCharset: UTF-8\n" "X-Poedit-SourceCharset: UTF-8\n"
#: templates/forecasts/detail.html:22 templates/forecasts/detail.html.py:24 #: templates/forecasts/detail.html:25 templates/forecasts/detail.html.py:27
msgid "Details" msgid "Details"
msgstr "Detalji" msgstr "Detalji"
#: templates/forecasts/detail.html:36 #: templates/forecasts/detail.html:39
msgid "Model" msgid "Model"
msgstr "Model" msgstr "Model"
#: templates/forecasts/detail.html:37 templates/forecasts/index.html:31 #: templates/forecasts/detail.html:40 templates/forecasts/index.html:33
msgid "Location" msgid "Location"
msgstr "Lokacija" msgstr "Lokacija"
#: templates/forecasts/detail.html:38 #: templates/forecasts/detail.html:41
msgid "Weather station" msgid "Weather station"
msgstr "Meteo stanica" msgstr "Meteo stanica"
#: templates/forecasts/detail.html:38 #: templates/forecasts/detail.html:41
msgid "Distance to location" msgid "Distance to location"
msgstr "Udaljenost od lokacija" msgstr "Udaljenost od lokacija"
#: templates/forecasts/detail.html:39 #: templates/forecasts/detail.html:42
msgid "Period" msgid "Period"
msgstr "Razdoblje " msgstr "Razdoblje "
#: templates/forecasts/detail.html:46
msgid "Showing latest"
msgstr ""
#: templates/forecasts/detail.html:48
msgid "Days"
msgstr ""
#: templates/forecasts/detail.html:49 #: templates/forecasts/detail.html:49
msgid "Change"
msgstr ""
#: templates/forecasts/detail.html:61
msgid "Timestamp" msgid "Timestamp"
msgstr "Točno vrijeme " msgstr "Točno vrijeme "
#: templates/forecasts/detail.html:50 #: templates/forecasts/detail.html:62
msgid "Warning status" msgid "Warning status"
msgstr "Status upozorenja" msgstr "Status upozorenja"
#: templates/forecasts/detail.html:70 #: templates/forecasts/detail.html:82
msgid "No results for this forecast" msgid "No results for this forecast"
msgstr "Nema rezultata za ovu prognozu" msgstr "Nema rezultata za ovu prognozu"
#: templates/forecasts/index.html:22 templates/forecasts/index.html.py:24 #: templates/forecasts/index.html:24 templates/forecasts/index.html.py:26
msgid "Forecasts" msgid "Forecasts"
msgstr "Prognoze" msgstr "Prognoze"
#: templates/forecasts/index.html:29 #: templates/forecasts/index.html:31
msgid "Model name" msgid "Model name"
msgstr "Ime modela " msgstr "Ime modela "
#: templates/forecasts/index.html:30 #: templates/forecasts/index.html:32
msgid "Crop" msgid "Crop"
msgstr "Usjev" msgstr "Usjev"
#: templates/forecasts/index.html:32 #: templates/forecasts/index.html:34
msgid "Date start" msgid "Date start"
msgstr "Datum početka" msgstr "Datum početka"
#: templates/forecasts/index.html:33 #: templates/forecasts/index.html:35
msgid "Date end" msgid "Date end"
msgstr "Datum završetka " msgstr "Datum završetka "
#: templates/forecasts/index.html:45 #: templates/forecasts/index.html:47
msgid "Results" msgid "Results"
msgstr "Rezultati " msgstr "Rezultati "
......
No preview for this file type
...@@ -7,7 +7,7 @@ msgid "" ...@@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: VIPS\n" "Project-Id-Version: VIPS\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2014-10-08 18:26+0200\n" "POT-Creation-Date: 2014-11-11 15:08+0100\n"
"PO-Revision-Date: 2014-10-10 13:04+0100\n" "PO-Revision-Date: 2014-10-10 13:04+0100\n"
"Last-Translator: Vjekoslav vujica <wvjeko@gmail.com>\n" "Last-Translator: Vjekoslav vujica <wvjeko@gmail.com>\n"
"Language-Team: LANGUAGE <wvjeko@gmail.com>\n" "Language-Team: LANGUAGE <wvjeko@gmail.com>\n"
...@@ -20,63 +20,75 @@ msgstr "" ...@@ -20,63 +20,75 @@ msgstr ""
"X-Generator: Poedit 1.6.9\n" "X-Generator: Poedit 1.6.9\n"
"X-Poedit-SourceCharset: UTF-8\n" "X-Poedit-SourceCharset: UTF-8\n"
#: templates/forecasts/detail.html:22 templates/forecasts/detail.html.py:24 #: templates/forecasts/detail.html:25 templates/forecasts/detail.html.py:27
msgid "Details" msgid "Details"
msgstr "Detalji" msgstr "Detalji"
#: templates/forecasts/detail.html:36 #: templates/forecasts/detail.html:39
msgid "Model" msgid "Model"
msgstr "Model" msgstr "Model"
#: templates/forecasts/detail.html:37 templates/forecasts/index.html:31 #: templates/forecasts/detail.html:40 templates/forecasts/index.html:33
msgid "Location" msgid "Location"
msgstr "Lokacija" msgstr "Lokacija"
#: templates/forecasts/detail.html:38 #: templates/forecasts/detail.html:41
msgid "Weather station" msgid "Weather station"
msgstr "Meteo stanica" msgstr "Meteo stanica"
#: templates/forecasts/detail.html:38 #: templates/forecasts/detail.html:41
msgid "Distance to location" msgid "Distance to location"
msgstr "Udaljenost od lokacija" msgstr "Udaljenost od lokacija"
#: templates/forecasts/detail.html:39 #: templates/forecasts/detail.html:42
msgid "Period" msgid "Period"
msgstr "Razdoblje " msgstr "Razdoblje "
#: templates/forecasts/detail.html:46
msgid "Showing latest"
msgstr ""
#: templates/forecasts/detail.html:48
msgid "Days"
msgstr ""
#: templates/forecasts/detail.html:49 #: templates/forecasts/detail.html:49
msgid "Change"
msgstr ""
#: templates/forecasts/detail.html:61
msgid "Timestamp" msgid "Timestamp"
msgstr "Točno vrijeme " msgstr "Točno vrijeme "
#: templates/forecasts/detail.html:50 #: templates/forecasts/detail.html:62
msgid "Warning status" msgid "Warning status"
msgstr "Status upozorenja" msgstr "Status upozorenja"
#: templates/forecasts/detail.html:70 #: templates/forecasts/detail.html:82
msgid "No results for this forecast" msgid "No results for this forecast"
msgstr "Nema rezultata za ovu prognozu" msgstr "Nema rezultata za ovu prognozu"
#: templates/forecasts/index.html:22 templates/forecasts/index.html.py:24 #: templates/forecasts/index.html:24 templates/forecasts/index.html.py:26
msgid "Forecasts" msgid "Forecasts"
msgstr "Prognoze" msgstr "Prognoze"
#: templates/forecasts/index.html:29 #: templates/forecasts/index.html:31
msgid "Model name" msgid "Model name"
msgstr "Ime modela " msgstr "Ime modela "
#: templates/forecasts/index.html:30 #: templates/forecasts/index.html:32
msgid "Crop" msgid "Crop"
msgstr "Usjev" msgstr "Usjev"
#: templates/forecasts/index.html:32 #: templates/forecasts/index.html:34
msgid "Date start" msgid "Date start"
msgstr "Datum početka" msgstr "Datum početka"
#: templates/forecasts/index.html:33 #: templates/forecasts/index.html:35
msgid "Date end" msgid "Date end"
msgstr "Datum završetka " msgstr "Datum završetka "
#: templates/forecasts/index.html:45 #: templates/forecasts/index.html:47
msgid "Results" msgid "Results"
msgstr "Rezultati " msgstr "Rezultati "
......
No preview for this file type
...@@ -14,7 +14,6 @@ ...@@ -14,7 +14,6 @@
# #
# You should have received a copy of the GNU Affero General Public License # You should have received a copy of the GNU Affero General Public License
# along with VIPSWeb. If not, see <http://www.gnu.org/licenses/>. # along with VIPSWeb. If not, see <http://www.gnu.org/licenses/>.
# Tor-Einar Skog <tor-einar.skog@bioforsk.no>, 2013. # Tor-Einar Skog <tor-einar.skog@bioforsk.no>, 2013.
# #
#, fuzzy #, fuzzy
...@@ -22,7 +21,7 @@ msgid "" ...@@ -22,7 +21,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2014-01-20 14:15+0100\n" "POT-Creation-Date: 2014-11-11 15:08+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
...@@ -32,82 +31,93 @@ msgstr "" ...@@ -32,82 +31,93 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: templates/forecasts/detail.html:3 #: templates/forecasts/detail.html:25 templates/forecasts/detail.html.py:27
#: templates/forecasts/detail.html.py:5
msgid "Details" msgid "Details"
msgstr "Detaljer" msgstr "Detaljer"
#: templates/forecasts/detail.html:17 #: templates/forecasts/detail.html:39
#, fuzzy #, fuzzy
msgid "Model" msgid "Model"
msgstr "Modeller" msgstr "Modeller"
#: templates/forecasts/detail.html:18 #: templates/forecasts/detail.html:40 templates/forecasts/index.html:33
#: templates/forecasts/index.html:11
msgid "Location" msgid "Location"
msgstr "Plassering" msgstr "Plassering"
#: templates/forecasts/detail.html:19 #: templates/forecasts/detail.html:41
msgid "Weather station" msgid "Weather station"
msgstr "Målestasjon" msgstr "Målestasjon"
#: templates/forecasts/detail.html:19 #: templates/forecasts/detail.html:41
msgid "Distance to location" msgid "Distance to location"
msgstr "Avstand til plassering" msgstr "Avstand til plassering"
#: templates/forecasts/detail.html:20 #: templates/forecasts/detail.html:42
msgid "Period" msgid "Period"
msgstr "Periode" msgstr "Periode"
#: templates/forecasts/detail.html:30 #: templates/forecasts/detail.html:46
msgid "Showing latest"
msgstr "Viser siste"
#: templates/forecasts/detail.html:48
msgid "Days"
msgstr "Dager"
#: templates/forecasts/detail.html:49
msgid "Change"
msgstr "Endre"
#: templates/forecasts/detail.html:61
msgid "Timestamp" msgid "Timestamp"
msgstr "Tidspunkt" msgstr "Tidspunkt"
#: templates/forecasts/detail.html:31 #: templates/forecasts/detail.html:62
msgid "Warning status" msgid "Warning status"
msgstr "Varselstatus" msgstr "Varselstatus"
#: templates/forecasts/detail.html:51 #: templates/forecasts/detail.html:82
msgid "No results for this forecast" msgid "No results for this forecast"
msgstr "Ingen resultater for dette varselet" msgstr "Ingen resultater for dette varselet"
#: templates/forecasts/index.html:3 #: templates/forecasts/index.html:24 templates/forecasts/index.html.py:26
#: templates/forecasts/index.html.py:5
msgid "Forecasts" msgid "Forecasts"
msgstr "Varsler" msgstr "Varsler"
#: templates/forecasts/index.html:10 #: templates/forecasts/index.html:31
#, fuzzy #, fuzzy
msgid "Model name" msgid "Model name"
msgstr "Modeller" msgstr "Modeller"
#: templates/forecasts/index.html:12 #: templates/forecasts/index.html:32
msgid "Crop"
msgstr ""
#: templates/forecasts/index.html:34
msgid "Date start" msgid "Date start"
msgstr "Startdato" msgstr "Startdato"
#: templates/forecasts/index.html:13 #: templates/forecasts/index.html:35
msgid "Date end" msgid "Date end"
msgstr "Sluttdato" msgstr "Sluttdato"
#: templates/forecasts/index.html:24 #: templates/forecasts/index.html:47
msgid "Results" msgid "Results"
msgstr "Resultater" msgstr "Resultater"
#: templates/models/detail.html:3 #: templates/models/detail.html:22 templates/models/index.html:22
#: templates/models/index.html:3 #: templates/models/index.html.py:24
#: templates/models/index.html.py:5
msgid "Models" msgid "Models"
msgstr "Modeller" msgstr "Modeller"
#: templates/models/detail.html:7 #: templates/models/detail.html:26
msgid "Description" msgid "Description"
msgstr "Beskrivelse" msgstr "Beskrivelse"
#: templates/models/detail.html:8 #: templates/models/detail.html:27
msgid "Usage" msgid "Usage"
msgstr "Bruksanvisning" msgstr "Bruksanvisning"
#: templates/models/detail.html:9 #: templates/models/detail.html:28
msgid "Sample configuration" msgid "Sample configuration"
msgstr "Eksempelkonfigurasjon" msgstr "Eksempelkonfigurasjon"
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
# You should have received a copy of the Bioforsk Open Source License # You should have received a copy of the Bioforsk Open Source License
# along with VIPSWeb. If not, see <http://www.bioforsk.no/licenses/>. # along with VIPSWeb. If not, see <http://www.bioforsk.no/licenses/>.
# #
# @author: Tor-Einar Skog <tor-einar.skog@bioforsk.no> # @author: Tor-Einar Skog
{% endcomment %} {% endcomment %}
{% load i18n l10n staticfiles forecast_extras %} {% load i18n l10n staticfiles forecast_extras %}
...@@ -40,6 +40,15 @@ ...@@ -40,6 +40,15 @@
<li>{% trans "Location" %}: {{forecast_configuration.location_point_of_interest.name}}</li> <li>{% trans "Location" %}: {{forecast_configuration.location_point_of_interest.name}}</li>
<li>{% trans "Weather station" %}: {{forecast_configuration.weather_station_point_of_interest.name}} ({% trans "Distance to location" %}: {{ forecast_configuration.weather_station_point_of_interest | distanceto:forecast_configuration.location_point_of_interest}} km)</li> <li>{% trans "Weather station" %}: {{forecast_configuration.weather_station_point_of_interest.name}} ({% trans "Distance to location" %}: {{ forecast_configuration.weather_station_point_of_interest | distanceto:forecast_configuration.location_point_of_interest}} km)</li>
<li>{% trans "Period" %}: {{forecast_configuration.date_start}} - {{forecast_configuration.date_end}}</li> <li>{% trans "Period" %}: {{forecast_configuration.date_start}} - {{forecast_configuration.date_end}}</li>
<li>
<form class="form-inline" onsubmit="changeLatestDays(this); return false;">
<input type="hidden" name="forecastConfigurationId" value="{{forecast_configuration.forecast_configuration_id}}"/>
{% trans "Showing latest" %}
<input class="form-control" style="width: auto;" type="number" min="1" max="365" name="latestDays" size="2" value="{{latest_days}}"/>
{% filter lower %}{% trans "Days" %}{% endfilter %}
<button class="btn btn-default" type="submit">{% trans "Change" %}</button>
</form>
</li>
</ul> </ul>
</div> </div>
</div> </div>
...@@ -74,8 +83,7 @@ ...@@ -74,8 +83,7 @@
{% endif %} {% endif %}
{% endblock %} {% endblock %}
{% block customJS %} {% block customJS %}
<script src="{% static "js/3rdparty/highcharts.js" %}"></script> <script type="text/javascript" src="{% static "js/3rdparty/highcharts.js" %}"></script>
<script type="text/javascript"> <script type="text/javascript">
$(document).ready(function() { $(document).ready(function() {
{% if forecast_results|length > 0 %} {% if forecast_results|length > 0 %}
...@@ -146,5 +154,12 @@ function createYAxisConf(axisInfo, isFirst) ...@@ -146,5 +154,12 @@ function createYAxisConf(axisInfo, isFirst)
} }
}; };
} }
/**
*
*/
function changeLatestDays(theForm){
window.location.href="/forecasts/" + theForm.forecastConfigurationId.value + "/" + theForm.latestDays.value;
}
</script> </script>
{% endblock %} {% endblock %}
\ No newline at end of file
...@@ -43,6 +43,7 @@ def detail_latest_days(request, forecast_id, latest_days): ...@@ -43,6 +43,7 @@ def detail_latest_days(request, forecast_id, latest_days):
context = { context = {
'forecast_configuration': forecast_configuration, 'forecast_configuration': forecast_configuration,
'latest_days': latest_days,
'result_parameters' : result_parameters, 'result_parameters' : result_parameters,
'forecast_results': forecast_results, 'forecast_results': forecast_results,
'forecast_result_highcharts' : forecast_result_highcharts, 'forecast_result_highcharts' : forecast_result_highcharts,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment