aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--uploader/species/views.py10
-rw-r--r--uploader/templates/species/base.html1
-rw-r--r--uploader/templates/species/create-species.html4
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%}