mirror of
https://git.ianrenton.com/ian/spothole.git
synced 2026-04-30 02:35:57 +00:00
Hide conditions page entries if data isn't available
This commit is contained in:
@@ -11,9 +11,11 @@ from core.prometheus_metrics_handler import page_requests_counter
|
||||
class PageTemplateHandler(tornado.web.RequestHandler):
|
||||
"""Handler for all HTML pages generated from templates"""
|
||||
|
||||
def initialize(self, template_name, web_server_metrics):
|
||||
def initialize(self, template_name, web_server_metrics, has_hamqsl=False, has_noaa_forecast=False):
|
||||
self._template_name = template_name
|
||||
self._web_server_metrics = web_server_metrics
|
||||
self._has_hamqsl = has_hamqsl
|
||||
self._has_noaa_forecast = has_noaa_forecast
|
||||
|
||||
def get(self):
|
||||
# Metrics
|
||||
@@ -24,4 +26,5 @@ class PageTemplateHandler(tornado.web.RequestHandler):
|
||||
|
||||
# Load named template, and provide variables used in templates
|
||||
self.render(self._template_name + ".html", software_version=SOFTWARE_VERSION, allow_spotting=ALLOW_SPOTTING,
|
||||
web_ui_options=WEB_UI_OPTIONS, baseurl = BASE_URL, current_path=self.request.path)
|
||||
web_ui_options=WEB_UI_OPTIONS, baseurl=BASE_URL, current_path=self.request.path,
|
||||
has_hamqsl=self._has_hamqsl, has_noaa_forecast=self._has_noaa_forecast)
|
||||
Reference in New Issue
Block a user