diff options
author | Frederick Muriuki Muriithi | 2024-09-09 14:06:31 -0500 |
---|---|---|
committer | Frederick Muriuki Muriithi | 2024-09-09 16:41:46 -0500 |
commit | 9cd33ddac3d6848c5443962d66494635feadef51 (patch) | |
tree | 385a559380f4d6a961fefb38ad410ad9ca27b052 /uploader/templates/populations | |
parent | 707c715d1e336ee45bdcced031881ed603b9297a (diff) | |
download | gn-uploader-9cd33ddac3d6848c5443962d66494635feadef51.tar.gz |
Initialise samples uploads
* Move existing code to new module
* Rework the UI: create new templates
* Rework the routes: Select species and populations before attempting
an upload.
Diffstat (limited to 'uploader/templates/populations')
3 files changed, 67 insertions, 1 deletions
diff --git a/uploader/templates/populations/macro-display-population-card.html b/uploader/templates/populations/macro-display-population-card.html new file mode 100644 index 0000000..e68f8e3 --- /dev/null +++ b/uploader/templates/populations/macro-display-population-card.html @@ -0,0 +1,32 @@ +{%from "species/macro-display-species-card.html" import display_species_card%} + +{%macro display_population_card(species, population)%} +{{display_species_card(species)}} + +<div class="card"> + <div class="card-body"> + <h5 class="card-title">Population</h5> + <div class="card-text"> + <dl> + <dt>Name</dt> + <dd>{{population.Name}}</dd> + + <dt>Full Name</dt> + <dd>{{population.FullName}}</dd> + + <dt>Code</dt> + <dd>{{population.InbredSetCode}}</dd> + + <dt>Genetic Type</dt> + <dd>{{population.GeneticType}}</dd> + + <dt>Family</dt> + <dd>{{population.Family}}</dd> + + <dt>Description</dt> + <dd>{{population.Description or "-"}}</dd> + </dl> + </div> + </div> +</div> +{%endmacro%} diff --git a/uploader/templates/populations/macro-select-population.html b/uploader/templates/populations/macro-select-population.html new file mode 100644 index 0000000..af4fd3a --- /dev/null +++ b/uploader/templates/populations/macro-select-population.html @@ -0,0 +1,30 @@ +{%macro select_population_form(form_action, populations)%} +<form method="GET" action="{{form_action}}"> + <legend>Select Population</legend> + + <div class="form-group"> + <label for="select-population" class="form-label">Select Population</label> + <select id="select-population" + name="population_id" + class="form-control" + required="required"> + <option value="">Select Population</option> + {%for family in populations%} + <optgroup {%if family[0][1] is not none%} + label="{{family[0][1]}}" + {%else%} + label="Undefined" + {%endif%}> + {%for population in family[1]%} + <option value="{{population.Id}}">{{population.FullName}}</option> + {%endfor%} + </optgroup> + {%endfor%} + </select> + </div> + + <div class="form-group"> + <input type="submit" value="Select" class="btn btn-primary" /> + </div> +</form> +{%endmacro%} diff --git a/uploader/templates/populations/view-population.html b/uploader/templates/populations/view-population.html index 52dadc4..31db54f 100644 --- a/uploader/templates/populations/view-population.html +++ b/uploader/templates/populations/view-population.html @@ -59,7 +59,11 @@ <nav class="nav"> <ul> <li> - <a href="#" title="Upload samples">upload samples</a> + <a href="{{url_for('species.populations.samples.list_samples', + species_id=species.SpeciesId, + population_id=population.Id)}}" + title="Manage samples: Add new or delete existing."> + manage samples</a> </li> <li> <a href="#" title="Upload expression data">upload expression data</a> |