Skip to content

Commit

Permalink
changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Incompleteusern committed Aug 24, 2023
1 parent f30ec26 commit a8e4efa
Showing 1 changed file with 25 additions and 28 deletions.
53 changes: 25 additions & 28 deletions otisweb/templates/generic_form.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,32 +6,29 @@
{% csrf_token %}
{% if form.non_field_errors %}
<div class="alert alert-danger" role="alert">
<strong>{{ "Error"|title }}</strong>
<strong>Errors</strong>
<ul>
{% for error in form.non_field_errors %}
<li>
{{ error }}
{% endfor %}
</ul>
</div>
{% elif form.errors %}
<div class="alert alert-danger" role="alert">
{% for err,val in form.errors.items %}
{% if err == "content" and "This field is required." in val %}
<strong>File upload</strong>
<ul>
<li>
There was an error with your file upload.
Please make sure that you file submission and is no larger than 10 MB.
</li>
</ul>
{% else %}
<strong>{{ err|title }}</strong> {{ val }}
{% endif %}
{% endfor %}
</div>
{% endif %}
{% for hidden in form.hidden_fields %}{{ hidden }}{% endfor %}
{% for field in form.visible_fields %}{{ field|as_crispy_field }}{% endfor %}
<button type="submit" class="btn {{ btn_class|default:"btn-success" }}">{{ submit_name|default:"Submit" }}</button>
</form>
{% for err in form.non_field_errors %}<li>{{ err }}</li>{% endfor %}
</ul>
</div>
{% elif form.errors %}
<div class="alert alert-danger" role="alert">
{% for err,val in form.errors.items %}
{% if err == "content" and "This field is required." in val %}
<strong>File upload</strong>
<ul>
<li>
There was an error with your file upload.
Please make sure that you file submission and is no larger than 10 MB.
</li>
</ul>
{% else %}
<strong>{{ err|title }}</strong> {{ val }}
{% endif %}
{% endfor %}
</div>
{% endif %}
{% for hidden in form.hidden_fields %}{{ hidden }}{% endfor %}
{% for field in form.visible_fields %}{{ field|as_crispy_field }}{% endfor %}
<button type="submit" class="btn {{ btn_class|default:"btn-success" }}">{{ submit_name|default:"Submit" }}</button>
</form>

0 comments on commit a8e4efa

Please sign in to comment.