diff options
author | Frederick Muriuki Muriithi | 2024-09-03 11:30:07 -0500 |
---|---|---|
committer | Frederick Muriuki Muriithi | 2024-09-03 13:51:31 -0500 |
commit | 64790126035e2ee1a10693aad9bd4045fd575727 (patch) | |
tree | 6a921f22470d974b91ff5d81742c52dda6b9a1ff | |
parent | ea7944b5f5e536c3ad0829dff674f91ba25b548e (diff) | |
download | gn-uploader-64790126035e2ee1a10693aad9bd4045fd575727.tar.gz |
Enable third level of breadcrumbs.
-rw-r--r-- | uploader/species/views.py | 10 | ||||
-rw-r--r-- | uploader/templates/species/base.html | 1 | ||||
-rw-r--r-- | uploader/templates/species/create-species.html | 4 |
3 files changed, 11 insertions, 4 deletions
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/<taxonID> 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%}> <a href="{{url_for('species.list_species')}}">Species</a> </li> +{%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%} <li {%if activelink=="create-species"%} class="breadcrumb-item active" {%else%} class="breadcrumb-item" {%endif%}> - <a href="{{url_for('species.create_species')}}">Species</a> + <a href="{{url_for('species.create_species')}}">Create</a> </li> {%endblock%} |