From 71615cf89dc2e1f10880154510f84bab6e78eac9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20H=C3=B6ning?= Date: Thu, 16 Sep 2021 17:10:15 +0200 Subject: [PATCH 1/2] add ability to specify a menu logo (top left corner) via a config setting --- documentation/changelog.rst | 2 ++ documentation/configuration.rst | 9 +++++++++ flexmeasures/ui/static/css/flexmeasures.css | 5 +++++ flexmeasures/ui/templates/base.html | 10 +++++++++- flexmeasures/ui/utils/view_utils.py | 2 ++ setup.py | 2 +- 6 files changed, 28 insertions(+), 2 deletions(-) diff --git a/documentation/changelog.rst b/documentation/changelog.rst index e5a7054de..92adc830a 100644 --- a/documentation/changelog.rst +++ b/documentation/changelog.rst @@ -9,6 +9,8 @@ v0.7.0 | October XX, 2021 New features ----------- +* Set a logo for the top left corner with the new FLEXMEASURES_MENU_LOGO_PATH setting [see `PR #1XX `_] + Bugfixes ----------- diff --git a/documentation/configuration.rst b/documentation/configuration.rst index c68ca3d15..ed68682e2 100644 --- a/documentation/configuration.rst +++ b/documentation/configuration.rst @@ -106,6 +106,15 @@ For example, ``("MyMDCApp", ["MDC"]), "MyApp"]`` would show the name "MyMDCApp" Default: ``"FlexMeasures"`` +FLEXMEASURES_MENU_LOGO_PATH +^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +A URL path to identify an image being used as logo in the upper left corner (replacing some generic text made from platform name and the page title). +The path can be a complete URL or a relative from the app root. + +Default: "" + + FLEXMEASURES_ROOT_VIEW ^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/flexmeasures/ui/static/css/flexmeasures.css b/flexmeasures/ui/static/css/flexmeasures.css index 1f8677512..faab9cf98 100644 --- a/flexmeasures/ui/static/css/flexmeasures.css +++ b/flexmeasures/ui/static/css/flexmeasures.css @@ -2,6 +2,11 @@ body { padding-top: 100px; /* This default is overridden by flexmeasures.js to support a fluid navbar */ } +#menu-logo { + height: 50px; + position: fixed; top: 0; left: 0; +} + #alerts { position: absolute; right: 10px; diff --git a/flexmeasures/ui/templates/base.html b/flexmeasures/ui/templates/base.html index bc714d0da..6b184ae9c 100644 --- a/flexmeasures/ui/templates/base.html +++ b/flexmeasures/ui/templates/base.html @@ -63,7 +63,15 @@ - {{ FLEXMEASURES_PLATFORM_NAME }} {% if not "Error" in self.title() %} - {{ self.title() }} {% endif %} + + + {% if menu_logo %} + + {% else %} + {{ FLEXMEASURES_PLATFORM_NAME }} {% if not "Error" in self.title() %} - {{ self.title() }} {% endif %} + {% endif %} + +