From dd492fa63c6716cedd8e78993d0e1f6bcd3387d0 Mon Sep 17 00:00:00 2001 From: Jakob Ketterl Date: Sat, 25 Apr 2020 20:52:41 +0200 Subject: [PATCH] hide "settings" link if features is disabled --- htdocs/include/header.include.html | 2 +- owrx/controllers/template.py | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/htdocs/include/header.include.html b/htdocs/include/header.include.html index ac48bc1..c86977c 100644 --- a/htdocs/include/header.include.html +++ b/htdocs/include/header.include.html @@ -17,7 +17,7 @@

Log

Receiver

Map
-
Settings
+ ${settingslink}
diff --git a/owrx/controllers/template.py b/owrx/controllers/template.py index 6746012..4adbe8c 100644 --- a/owrx/controllers/template.py +++ b/owrx/controllers/template.py @@ -1,6 +1,7 @@ from . import Controller import pkg_resources from string import Template +from owrx.config import Config class TemplateController(Controller): @@ -19,7 +20,11 @@ class TemplateController(Controller): class WebpageController(TemplateController): def template_variables(self): - header = self.render_template("include/header.include.html") + settingslink = "" + pm = Config.get() + if "webadmin_enabled" in pm and pm["webadmin_enabled"]: + settingslink = """
Settings
""" + header = self.render_template("include/header.include.html", settingslink=settingslink) return {"header": header}