From cebb41d8a13fd507272a91bb13e28bfa60a60996 Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Fri, 13 Dec 2024 15:09:48 -0600 Subject: Use new templates: --- uploader/phenotypes/views.py | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/uploader/phenotypes/views.py b/uploader/phenotypes/views.py index 8a8ca42..c4aa67a 100644 --- a/uploader/phenotypes/views.py +++ b/uploader/phenotypes/views.py @@ -2,6 +2,7 @@ import sys import uuid import json +import datetime from pathlib import Path from functools import wraps from logging import INFO, ERROR, DEBUG, FATAL, CRITICAL, WARNING @@ -329,11 +330,24 @@ def add_phenotypes(species: dict, population: dict, dataset: dict, **kwargs):# p # 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") + today = datetime.date.today() + return render_template( + ("phenotypes/add-phenotypes-with-rqtl2-bundle.html" + if request.args.get("use_bundle", "").lower() == "true" + else "phenotypes/add-phenotypes-raw-files.html"), + species=species, + population=population, + dataset=dataset, + monthnames=( + "January", "February", "March", "April", + "May", "June", "July", "August", + "September", "October", "November", + "December"), + current_month=today.strftime("%B"), + current_year=int(today.strftime("%Y")), + families_with_se_and_n=( + "Reference Populations (replicate average, SE, N)",), + activelink="add-phenotypes") try: ## Handle huge files here... -- cgit v1.2.3