From 55f72749a29e303c3a1049349b82baf258079e29 Mon Sep 17 00:00:00 2001 From: Tibor Frank Date: Wed, 21 Jun 2023 14:03:36 +0000 Subject: C-Dash: Add documentation and other items to the navbar Change-Id: Ic6ec5e74d62ac115a30973cf8204fe6001ff7d33 Signed-off-by: Tibor Frank --- csit.infra.dash/app/cdash/coverage/layout.py | 50 +++++++++++++++++++++++----- 1 file changed, 42 insertions(+), 8 deletions(-) (limited to 'csit.infra.dash/app/cdash/coverage') diff --git a/csit.infra.dash/app/cdash/coverage/layout.py b/csit.infra.dash/app/cdash/coverage/layout.py index a5e095f0c0..8c11523368 100644 --- a/csit.infra.dash/app/cdash/coverage/layout.py +++ b/csit.infra.dash/app/cdash/coverage/layout.py @@ -175,6 +175,18 @@ class Layout: self._add_ctrl_col(), self._add_plotting_col() ] + ), + dbc.Offcanvas( + class_name="w-75", + id="offcanvas-documentation", + title="Documentation", + placement="end", + is_open=False, + children=html.Iframe( + src=C.URL_DOC_REL_NOTES, + width="100%", + height="100%" + ) ) ] ) @@ -200,14 +212,26 @@ class Layout: return dbc.NavbarSimple( id="navbarsimple-main", children=[ - dbc.NavItem( - dbc.NavLink( - C.COVERAGE_TITLE, - disabled=True, - external_link=True, - href="#" - ) - ) + dbc.NavItem(dbc.NavLink( + C.REPORT_TITLE, + external_link=True, + href="/report" + )), + dbc.NavItem(dbc.NavLink( + "Comparisons", + external_link=True, + href="/comparisons" + )), + dbc.NavItem(dbc.NavLink( + "Coverage Data", + active=True, + external_link=True, + href="/coverage" + )), + dbc.NavItem(dbc.NavLink( + "Documentation", + id="btn-documentation", + )) ], brand=C.BRAND, brand_href="/", @@ -712,3 +736,13 @@ class Layout: ) return dcc.send_data_frame(df.to_csv, C.COVERAGE_DOWNLOAD_FILE_NAME) + + @app.callback( + Output("offcanvas-documentation", "is_open"), + Input("btn-documentation", "n_clicks"), + State("offcanvas-documentation", "is_open") + ) + def toggle_offcanvas_documentation(n_clicks, is_open): + if n_clicks: + return not is_open + return is_open -- cgit 1.2.3-korg