From 36fc8996fa830078866e17aab7d9c177c74c835b Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Fri, 13 Sep 2024 09:18:18 -0500 Subject: Initialise genotypes' UI --- uploader/genotypes/__init__.py | 1 + uploader/genotypes/views.py | 12 ++++++++++++ uploader/population/views.py | 4 +++- uploader/templates/base.html | 4 ++-- uploader/templates/genotypes/base.html | 12 ++++++++++++ uploader/templates/genotypes/index.html | 24 ++++++++++++++++++++++++ 6 files changed, 54 insertions(+), 3 deletions(-) create mode 100644 uploader/genotypes/__init__.py create mode 100644 uploader/genotypes/views.py create mode 100644 uploader/templates/genotypes/base.html create mode 100644 uploader/templates/genotypes/index.html diff --git a/uploader/genotypes/__init__.py b/uploader/genotypes/__init__.py new file mode 100644 index 0000000..d0025d6 --- /dev/null +++ b/uploader/genotypes/__init__.py @@ -0,0 +1 @@ +"""The Genotypes module.""" diff --git a/uploader/genotypes/views.py b/uploader/genotypes/views.py new file mode 100644 index 0000000..2b4ed10 --- /dev/null +++ b/uploader/genotypes/views.py @@ -0,0 +1,12 @@ +"""Views for the genotypes.""" +from flask import Blueprint, render_template + +from uploader.authorisation import require_login + +genotypesbp = Blueprint("genotypes", __name__) + +@genotypesbp.route("/genotypes") +@require_login +def index(): + """Direct entry-point for genotypes.""" + return render_template("genotypes/index.html") diff --git a/uploader/population/views.py b/uploader/population/views.py index 003787a..e870c85 100644 --- a/uploader/population/views.py +++ b/uploader/population/views.py @@ -10,10 +10,11 @@ from flask import (flash, Blueprint, current_app as app) +from uploader.samples.views import samplesbp from uploader.ui import make_template_renderer from uploader.authorisation import require_login from uploader.db_utils import database_connection -from uploader.samples.views import samplesbp +from uploader.genotypes.views import genotypesbp from uploader.species.models import (all_species, species_by_id, order_species_by_family) @@ -27,6 +28,7 @@ from .models import (save_population, __active_link__ = "populations" popbp = Blueprint("populations", __name__) popbp.register_blueprint(samplesbp, url_prefix="/") +popbp.register_blueprint(genotypesbp, url_prefix="/") render_template = make_template_renderer("populations") diff --git a/uploader/templates/base.html b/uploader/templates/base.html index d68c6c0..cc37c3e 100644 --- a/uploader/templates/base.html +++ b/uploader/templates/base.html @@ -46,10 +46,10 @@
  • Home
  • Species
  • -
  • Genotype Data
  • Populations
  • +
  • Genotype Data
  • Samples
  • + Genotypes +
  • +{%block lvl4_breadcrumbs%}{%endblock%} +{%endblock%} diff --git a/uploader/templates/genotypes/index.html b/uploader/templates/genotypes/index.html new file mode 100644 index 0000000..4f5c3a8 --- /dev/null +++ b/uploader/templates/genotypes/index.html @@ -0,0 +1,24 @@ +{%extends "genotypes/base.html"%} +{%from "flash_messages.html" import flash_all_messages%} +{%from "species/macro-select-species.html" import select_species_form%} + +{%block title%}Genotypes{%endblock%} + +{%block pagetitle%}Genotypes{%endblock%} + + +{%block contents%} +{{flash_all_messages()}} + +
    +

    We have not implemented this part yet!

    +
    + +
    +

    Some Important Concepts to Consider/Remember

    + +
    +{%endblock%} -- cgit v1.2.3