From 4f994b79ecee851ea1cd0fa0699ee822c8884bc4 Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Thu, 10 Oct 2024 16:18:52 -0500 Subject: Build UI to add new phenotypes. Build the UI and set up styling. This is not working currently. --- uploader/phenotypes/views.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'uploader/phenotypes/views.py') diff --git a/uploader/phenotypes/views.py b/uploader/phenotypes/views.py index ddf6908..eb0b460 100644 --- a/uploader/phenotypes/views.py +++ b/uploader/phenotypes/views.py @@ -286,3 +286,25 @@ def create_dataset(species: dict, population: dict, **kwargs):# pylint: disable= return redirect(url_for("species.populations.phenotypes.list_datasets", species_id=species["SpeciesId"], population_id=population["Id"])) + + +@phenotypesbp.route( + "/populations//phenotypes/datasets" + "//add-phenotypes", + methods=["GET", "POST"]) +@require_login +@with_dataset( + species_redirect_uri="species.populations.phenotypes.index", + population_redirect_uri="species.populations.phenotypes.select_population", + redirect_uri="species.populations.phenotypes.list_datasets") +def add_phenotypes(species: dict, population: dict, dataset: dict, **kwargs): + """Add one or more phenotypes to the dataset.""" + with (database_connection(app.config["SQL_URI"]) as conn, + conn.cursor(cursorclass=DictCursor) as cursor): + if request.method == "GET": + return render_template("phenotypes/add-phenotypes.html", + species=species, + population=population, + dataset=dataset, + activelink="add-phenotypes") + raise NotImplementedError("Please implement this...") -- cgit v1.2.3