From d30c5e255e5f3892a1a18e26d1de208773b1d2b9 Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Tue, 16 Dec 2025 14:21:05 -0600 Subject: Streamlined UI for samples. --- uploader/samples/views.py | 4 +- uploader/templates/samples/sui-base.html | 19 +++++ uploader/templates/samples/sui-list-samples.html | 98 ++++++++++++++++++++++++ 3 files changed, 120 insertions(+), 1 deletion(-) create mode 100644 uploader/templates/samples/sui-base.html create mode 100644 uploader/templates/samples/sui-list-samples.html diff --git a/uploader/samples/views.py b/uploader/samples/views.py index f8baf7e..fcb895d 100644 --- a/uploader/samples/views.py +++ b/uploader/samples/views.py @@ -11,6 +11,8 @@ from flask import (flash, Blueprint, current_app as app) +from uploader.sui import sui_template + from uploader import jobs from uploader.files import save_file from uploader.flask_extensions import url_for @@ -86,7 +88,7 @@ def list_samples(species: dict, population: dict, **kwargs):# pylint: disable=[u total_samples = len(all_samples) offset = max(safe_int(request.args.get("from") or 0), 0) count = int(request.args.get("count") or 20) - return render_template("samples/list-samples.html", + return render_template(sui_template("samples/list-samples.html"), species=species, population=population, samples=all_samples[offset:offset+count], diff --git a/uploader/templates/samples/sui-base.html b/uploader/templates/samples/sui-base.html new file mode 100644 index 0000000..ee08e2e --- /dev/null +++ b/uploader/templates/samples/sui-base.html @@ -0,0 +1,19 @@ +{%extends "populations/sui-base.html"%} +{%from "populations/macro-display-population-card.html" import display_sui_population_card%} + +{%block breadcrumbs%} +{{super()}} +
+ Population "{{population.FullName}} ({{population.Name}})" already has + {{total_samples}} samples/individuals entered. You can + explore the list of samples in the table below. +
+| + | Name | +Auxilliary Name | +Symbol | +Alias | +
|---|---|---|---|---|
| {{sample.sequence_number}} | +{{sample.Name}} | +{{sample.Name2}} | +{{sample.Symbol or "-"}} | +{{sample.Alias or "-"}} | +
There are no samples entered for this population. Click the "Add Samples" + button above, to add some new samples.
+