aboutsummaryrefslogtreecommitdiff
path: root/uploader/templates
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2024-09-05 12:50:52 -0500
committerFrederick Muriuki Muriithi2024-09-05 14:19:47 -0500
commitb6a38df0eaedb9ac4bb4b602643ca1e97f889b49 (patch)
treeea7deda3ea4bd4c3388df91091060b50cc2162dc /uploader/templates
parentf5b60f2909c6683345ae0f1070e84e40c41af5ad (diff)
downloadgn-uploader-b6a38df0eaedb9ac4bb4b602643ca1e97f889b49.tar.gz
Improve error messaging for "Create Population" feature.
Diffstat (limited to 'uploader/templates')
-rw-r--r--uploader/templates/populations/create-population.html44
1 files changed, 34 insertions, 10 deletions
diff --git a/uploader/templates/populations/create-population.html b/uploader/templates/populations/create-population.html
index a27a134..6a96148 100644
--- a/uploader/templates/populations/create-population.html
+++ b/uploader/templates/populations/create-population.html
@@ -40,15 +40,24 @@
<legend>Create Population</legend>
- <div class="form-group">
+ {{flash_all_messages()}}
+
+ <div {%if errors.population_fullname%}
+ class="form-group has-error"
+ {%else%}
+ class="form-group"
+ {%endif%}>
<label for="txt-population-fullname" class="form-label">Full Name</label>
+ {%if errors.population_fullname%}
+ <small class="form-text text-danger">{{errors.population_fullname}}</small>
+ {%endif%}
<input type="text"
id="txt-population-fullname"
name="population_fullname"
required="required"
minLength="3"
maxLength="100"
- value="{{population_fullname or ''}}"
+ value="{{error_values.population_fullname or ''}}"
class="form-control" />
<small class="form-text text-muted">
<p>
@@ -58,15 +67,22 @@
</small>
</div>
- <div class="form-group">
+ <div {%if errors.population_name%}
+ class="form-group has-error"
+ {%else%}
+ class="form-group"
+ {%endif%}>
<label for="txt-population-name" class="form-label">Name</label>
+ {%if errors.population_name%}
+ <small class="form-text text-danger">{{errors.population_name}}</small>
+ {%endif%}
<input type="text"
id="txt-population-name"
name="population_name"
required="required"
minLength="3"
maxLength="30"
- value="{{population_name or ''}}"
+ value="{{error_values.population_name or ''}}"
class="form-control" />
<small class="form-text text-muted">
<p>
@@ -81,15 +97,23 @@
</small>
</div>
- <div class="form-group">
+ <div {%if errors.population_description%}
+ class="form-group has-error"
+ {%else%}
+ class="form-group"
+ {%endif%}>
<label for="txt-population-description" class="form-label">
Description
</label>
- <textarea id="txt-population-description"
- name="population_description"
- required="required"
- class="form-control"
- rows="5">{{population_description or ''}}</textarea>
+ {%if errors.population_description%}
+ <small class="form-text text-danger">{{errors.population_description}}</small>
+ {%endif%}
+ <textarea
+ id="txt-population-description"
+ name="population_description"
+ required="required"
+ class="form-control"
+ rows="5">{{error_values.population_description or ''}}</textarea>
<small class="form-text text-muted">
<p>
This is a more detailed description for your population. This is