From 7d26a65c825acbe9922b332ef5543e92222e7076 Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Tue, 3 Sep 2024 11:31:01 -0500 Subject: Provide UI for viewing species details. --- uploader/species/views.py | 9 ++- uploader/templates/species/view-species.html | 103 +++++++++++++++++++++++++++ 2 files changed, 111 insertions(+), 1 deletion(-) create mode 100644 uploader/templates/species/view-species.html (limited to 'uploader') diff --git a/uploader/species/views.py b/uploader/species/views.py index f2d7545..6009f03 100644 --- a/uploader/species/views.py +++ b/uploader/species/views.py @@ -38,7 +38,14 @@ def list_species(): def view_species(species_id: int): """View details of a particular species and menus to act upon it.""" with database_connection(app.config["SQL_URI"]) as conn: - return species_by_id(conn, species_id) + species = species_by_id(conn, species_id) + if bool(species): + return render_template("species/view-species.html", + species=species, + activelink="view-species") + flash("Could not find a species with the given identifier.", + "alert-danger") + return redirect(url_for("species.view_species")) @speciesbp.route("/create", methods=["GET", "POST"]) @require_login diff --git a/uploader/templates/species/view-species.html b/uploader/templates/species/view-species.html new file mode 100644 index 0000000..a0eb54b --- /dev/null +++ b/uploader/templates/species/view-species.html @@ -0,0 +1,103 @@ +{%extends "species/base.html"%} +{%from "flash_messages.html" import flash_all_messages%} + +{%block title%}View Species{%endblock%} + +{%block pagetitle%}View Species{%endblock%} + +{%block css%} + +{%endblock%} + +{%block lvl3_breadcrumbs%} +
+ You can proceed to perform any of the following actions for species + {{species.FullName}} +
+ +Some extra internal-use details (mostly for UI concerns on GeneNetwork)
++ + If you do not understand what the following are about, simply ignore them + — + They have no bearing whatsoever on your data, or its analysis. + +
+