]> git.ipfire.org Git - people/ms/westferry.git/commitdiff
UI: graphs: Add option to hide graph title
authorMichael Tremer <michael.tremer@ipfire.org>
Sat, 4 Dec 2021 16:27:09 +0000 (16:27 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Sat, 4 Dec 2021 16:27:09 +0000 (16:27 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/templates/modules/graphs/box.html
src/templates/modules/tabs.html
src/westferry/ui/graphs.py

index 9127fd14475a5e519957669f745bf659fd0d7e1c..b507d3366d972a9199dca51d55e497faa021d5ca 100644 (file)
@@ -6,7 +6,9 @@
        "year"  : _("Year")
 } %}
 
-<h3>{{ graph.title }}</h3>
+{% if show_title %}
+       <h3>{{ graph.title }}</h3>
+{% end %}
 
 <ul class="tabs" data-tabs id="graph-tabs">
        {% for i, interval in enumerate(intervals) %}
index 4fb6e4e62c8a9bd9057c6e34b428b6c7695b8e9f..038d5d842fa450ba0ecd0a3fdc0927721effca76 100644 (file)
@@ -28,7 +28,7 @@
                <div class="tabs-panel {% if selected %}is-active{% end %}" id="{{ tab.id }}">
                        {% for item in tab.items %}
                                {% if isinstance(item, westferry.ui.graphs.Graph) %}
-                                       {% module GraphBox(item) %}
+                                       {% module GraphBox(item, show_title=False) %}
                                {% else %}
                                        {% module WarningBox(_("Unknown UI Element"),
                                                _("A UI element which was supposed to be at this place could not be rendered: %r") % item) %}
index acc2a165fe2b422628d20dfc4583b5965ef43f8d..cfc0070b1d2eb5947371e108a59925fa752310f8 100644 (file)
@@ -140,5 +140,6 @@ class Graph(object):
 
 
 class GraphBoxModule(base.BaseUIModule):
-       def render(self, graph):
-               return self.render_string("modules/graphs/box.html", graph=graph)
+       def render(self, graph, show_title=True):
+               return self.render_string("modules/graphs/box.html", graph=graph,
+                       show_title=show_title)