Skip to content

Commit cd55635

Browse files
committed
Add service navigation to the header
Enable navigation between the visualisation graph and tabular view pages. Doesn't include the visualisation list page for now, since that's not a main page.
1 parent f87c7b3 commit cd55635

2 files changed

Lines changed: 38 additions & 1 deletion

File tree

app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def graph_page():
6161
case _:
6262
error = f"Graph for '{run_path_param}' failed to generate."
6363

64-
return render_template("graph-unavailable.html", message=error)
64+
return render_template("graph-unavailable.html", message=error, run_path=run_path_param)
6565

6666
@app.route("/visualisations", methods=["GET"])
6767
def visualisations_page():

templates/base.html

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,43 @@
3939
</div>
4040
</div>
4141
</div>
42+
<section aria-label="Service information" class="govuk-service-navigation"
43+
data-module="govuk-service-navigation">
44+
<div class="govuk-width-container">
45+
<div class="govuk-service-navigation__container">
46+
<nav aria-label="Menu" class="govuk-service-navigation__wrapper">
47+
<ul class="govuk-service-navigation__list" id="navigation">
48+
{% if request.path == url_for('graph_page') %}
49+
<li class="govuk-service-navigation__item govuk-service-navigation__item--active">
50+
<a class="govuk-service-navigation__link" href="{{ url_for('graph_page', run_path=run_path) }}" aria-current="true">
51+
<strong class="govuk-service-navigation__active-fallback">Graph</strong>
52+
</a>
53+
</li>
54+
{% else %}
55+
<li class="govuk-service-navigation__item">
56+
<a class="govuk-service-navigation__link" href="{{ url_for('graph_page', run_path=run_path) }}">
57+
Graph
58+
</a>
59+
</li>
60+
{% endif %}
61+
{% if request.path == url_for('metrics_page') %}
62+
<li class="govuk-service-navigation__item govuk-service-navigation__item--active">
63+
<a class="govuk-service-navigation__link" href="{{ url_for('metrics_page', run_path=run_path) }}" aria-current="true">
64+
<strong class="govuk-service-navigation__active-fallback">Metrics</strong>
65+
</a>
66+
</li>
67+
{% else %}
68+
<li class="govuk-service-navigation__item">
69+
<a class="govuk-service-navigation__link" href="{{ url_for('metrics_page', run_path=run_path) }}">
70+
Metrics
71+
</a>
72+
</li>
73+
{% endif %}
74+
</ul>
75+
</nav>
76+
</div>
77+
</div>
78+
</section>
4279
</header>
4380

4481
<main>

0 commit comments

Comments
 (0)