aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2025-02-18 09:41:31 -0600
committerFrederick Muriuki Muriithi2025-02-18 10:56:28 -0600
commita0e5fcab8a10068b48c546776796ae7211cd5660 (patch)
treed1d4c52e9cb709be122e8c2d0118d627ecf89285
parent90f935c4ed64306822727082b5699e0fe844f0ee (diff)
downloadgn-uploader-a0e5fcab8a10068b48c546776796ae7211cd5660.tar.gz
Handle "empty-database" case for species.
While not a concern for the current instance of GeneNetwork (which already has a number of species already entered in the database), this commit handles the case where there are no species in the database e.g. in a pristine installation of a new instance.
-rw-r--r--uploader/templates/species/macro-select-species.html15
1 files changed, 13 insertions, 2 deletions
diff --git a/uploader/templates/species/macro-select-species.html b/uploader/templates/species/macro-select-species.html
index 21a5631..c0a1357 100644
--- a/uploader/templates/species/macro-select-species.html
+++ b/uploader/templates/species/macro-select-species.html
@@ -1,7 +1,9 @@
{%macro select_species_form(form_action, species)%}
<form method="GET" action="{{form_action}}" class="form-horizontal">
- <label class="control-label">What species do you want to work with?</label>
+
{%if species | length != 0%}
+
+ <label class="control-label">What species do you want to work with?</label>
<table id="tbl-select-species" class="table compact stripe"
data-species-list='{{species | tojson}}'>
<div class="">
@@ -14,7 +16,6 @@
<tbody></tbody>
</table>
- {%endif%}
<div class="form-group">
<label class="control-label" for="rdo-cant-find-species">
@@ -22,6 +23,16 @@
I cannot find the species I want &mdash; create it!</label>
</div>
+ {%else%}
+
+ <div class="form-group">
+ <label class="control-label" for="rdo-cant-find-species">
+ <input id="rdo-cant-find-species" type="radio" name="species_id" value="CREATE-SPECIES" />
+ There are no species to select from. Create the first one.</label>
+ </div>
+
+ {%endif%}
+
<div class="form-group">
<input type="submit"
class="btn btn-primary col-sm-offset-1"