From 64790126035e2ee1a10693aad9bd4045fd575727 Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Tue, 3 Sep 2024 11:30:07 -0500 Subject: Enable third level of breadcrumbs. --- uploader/species/views.py | 10 ++++++++-- uploader/templates/species/base.html | 1 + uploader/templates/species/create-species.html | 4 ++-- 3 files changed, 11 insertions(+), 4 deletions(-) (limited to 'uploader') diff --git a/uploader/species/views.py b/uploader/species/views.py index 4372504..f2d7545 100644 --- a/uploader/species/views.py +++ b/uploader/species/views.py @@ -18,7 +18,12 @@ speciesbp = Blueprint("species", __name__) def render_template(template, **kwargs): """Render template for species.""" - return flask_render_template(template, **kwargs, activelink="species") + return flask_render_template( + template, + **{ + **kwargs, + "activelink": kwargs.get("activelink", "species") + }) @speciesbp.route("/", methods=["GET"]) @@ -43,7 +48,8 @@ def create_species(): # https://rest.uniprot.org/taxonomy/ e.g. # https://rest.uniprot.org/taxonomy/6239 if request.method == "GET": - return render_template("species/create-species.html") + return render_template("species/create-species.html", + activelink="create-species") with (database_connection(app.config["SQL_URI"]) as conn, conn.cursor() as cursor): diff --git a/uploader/templates/species/base.html b/uploader/templates/species/base.html index b77cc8b..8fb697d 100644 --- a/uploader/templates/species/base.html +++ b/uploader/templates/species/base.html @@ -8,4 +8,5 @@ {%endif%}> Species +{%block lvl3_breadcrumbs%}{%endblock%} {%endblock%} diff --git a/uploader/templates/species/create-species.html b/uploader/templates/species/create-species.html index b96e2d3..678b010 100644 --- a/uploader/templates/species/create-species.html +++ b/uploader/templates/species/create-species.html @@ -5,13 +5,13 @@ {%block pagetitle%}Create Species{%endblock%} -{%block breadcrumbs%} +{%block lvl3_breadcrumbs%} {%endblock%} -- cgit v1.2.3