From 8119650b2fc88158d91fec70587b971922199fe3 Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Fri, 23 Jan 2026 17:36:10 -0600 Subject: Add initial placeholder UI to confirm deletion. --- uploader/phenotypes/views.py | 14 +- .../phenotypes/confirm-delete-phenotypes.html | 148 +++++++++++++++++++++ 2 files changed, 159 insertions(+), 3 deletions(-) create mode 100644 uploader/templates/phenotypes/confirm-delete-phenotypes.html diff --git a/uploader/phenotypes/views.py b/uploader/phenotypes/views.py index aaccf18..f7d8e55 100644 --- a/uploader/phenotypes/views.py +++ b/uploader/phenotypes/views.py @@ -1173,7 +1173,15 @@ def delete_phenotypes(# pylint: disable=[unused-argument] **kwargs ): """Delete the specified phenotype data.""" - if request.method == "GET": - return "Would confirm deletion." + if request.form.get("confirm", "").lower() == "confirm": + return f"Would delete! {request.form}" - return "Would delete!" + with database_connection(app.config["SQL_URI"]) as conn: + xref_ids = tuple( + int(item) for item in set(request.form.getlist("xref_ids"))) + return render_template( + "phenotypes/confirm-delete-phenotypes.html", + species=species, + population=population, + dataset=dataset, + phenotypes=xref_ids) diff --git a/uploader/templates/phenotypes/confirm-delete-phenotypes.html b/uploader/templates/phenotypes/confirm-delete-phenotypes.html new file mode 100644 index 0000000..36cab2c --- /dev/null +++ b/uploader/templates/phenotypes/confirm-delete-phenotypes.html @@ -0,0 +1,148 @@ +{%extends "phenotypes/base.html"%} +{%from "flash_messages.html" import flash_all_messages%} + +{%block title%}Phenotypes{%endblock%} + +{%block pagetitle%}Delete Phenotypes{%endblock%} + +{%block lvl4_breadcrumbs%} +
You have requested to delete the following phenotypes:
+| # | +Record ID | +Description | +
|---|---|---|
| + + | +{{phenotype}} | +{{phenotype}} — Description | +