From be174ad4dde098cd48c4ec12fe2ed6ea6abdcb7a Mon Sep 17 00:00:00 2001 From: Alfredos-Panagiotis Damkalis Date: Thu, 28 Nov 2019 16:46:13 +0200 Subject: [PATCH] Reduce SQL queries station page Signed-off-by: Alfredos-Panagiotis Damkalis --- network/templates/base/station_view.html | 30 +++++++++++++----------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/network/templates/base/station_view.html b/network/templates/base/station_view.html index 457bd81..eb4dbfc 100644 --- a/network/templates/base/station_view.html +++ b/network/templates/base/station_view.html @@ -117,20 +117,22 @@ {% endif %} - {% if station.observations_count %} -
- Observations - {{ station.observations_count }} - - -
- {% endif %} + {% with total_obs=station.observations_count %} + {% if total_obs %} +
+ Observations + {{ total_obs }} + + +
+ {% endif %} + {% endwith %}
Creation Date