From 01ffc39815b2f15c8e3a6523799764372b12122a Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Wed, 17 Dec 2025 14:05:34 -0600 Subject: Move phenotypes dataset UI to its own template. --- uploader/phenotypes/views.py | 8 +- .../templates/phenotypes/sui-view-dataset.html | 215 +++++++++++++++++++++ .../templates/populations/sui-view-population.html | 156 +-------------- 3 files changed, 224 insertions(+), 155 deletions(-) create mode 100644 uploader/templates/phenotypes/sui-view-dataset.html (limited to 'uploader') diff --git a/uploader/phenotypes/views.py b/uploader/phenotypes/views.py index ead43ab..9df7d81 100644 --- a/uploader/phenotypes/views.py +++ b/uploader/phenotypes/views.py @@ -185,12 +185,6 @@ def with_dataset( def view_dataset(# pylint: disable=[unused-argument] species: dict, population: dict, dataset: dict, **kwargs): """View a specific dataset""" - if bool(request.args.get("streamlined_ui")): - # Redirect back to the "View Population" page for the time being. - return redirect(url_for("species.populations.view_population", - species_id=species["SpeciesId"], - population_id=population["Id"])) - with database_connection(app.config["SQL_URI"]) as conn: dataset = dataset_by_id( conn, species["SpeciesId"], population["Id"], dataset["Id"]) @@ -203,7 +197,7 @@ def view_dataset(# pylint: disable=[unused-argument] start_at = max(safe_int(request.args.get("start_at") or 0), 0) count = int(request.args.get("count") or 20) - return render_template("phenotypes/view-dataset.html", + return render_template(sui_template("phenotypes/view-dataset.html"), species=species, population=population, dataset=dataset, diff --git a/uploader/templates/phenotypes/sui-view-dataset.html b/uploader/templates/phenotypes/sui-view-dataset.html new file mode 100644 index 0000000..6a26004 --- /dev/null +++ b/uploader/templates/phenotypes/sui-view-dataset.html @@ -0,0 +1,215 @@ +{%extends "phenotypes/sui-base.html"%} +{%from "flash_messages.html" import flash_all_messages%} +{%from "macro-table-pagination.html" import table_pagination%} + +{%block title%}Phenotypes{%endblock%} + +{%block pagetitle%}Phenotypes{%endblock%} + +{%block lvl4_breadcrumbs%} +
The basic dataset details are:
+ +| Name | +Full Name | +Short Name | +
|---|---|---|
| {{dataset.Name}} | +{{dataset.FullName}} | +{{dataset.ShortName}} | +
Click on any of the phenotypes in the table below to view and edit that + phenotype's data.
+Use the search to filter through all the phenotypes and find specific + phenotypes of interest.
+| + | Index | +Record | +Description | +
|---|
The table below lists the phenotypes that already exist for - population "{{population.FullName}} ({{population.Name}})" of - species "{{species.FullName}} ({{species.Name}})".
+To view existing phenotype traits, or upload new ones, click the button below:
-