Skip to content

Commit

Permalink
Disable form on error
Browse files Browse the repository at this point in the history
  • Loading branch information
magnified103 committed Oct 14, 2024
1 parent fbce267 commit 8e50d2e
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions templates/problem/import.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,18 @@
<div>Remaining uses: {{ remaining_uses }}</div>
{% endif %}
</div>
<div>
<form method="post" class="form-area" style="display: flex; justify-content: center; flex-direction: column;">
{% if form.non_field_errors() %}
<div class="form-errors">
{{ form.non_field_errors() }}
</div>
{% endif %}
{% csrf_token %}
<table class="django-as-table">{{ form.as_table() }}</table>
<p><input type="submit" value="Import"></p>
</form>
</div>
{% if status and remaining_uses > 0 %}
<div>
<form method="post" class="form-area" style="display: flex; justify-content: center; flex-direction: column;">
{% if form.non_field_errors() %}
<div class="form-errors">
{{ form.non_field_errors() }}
</div>
{% endif %}
{% csrf_token %}
<table class="django-as-table">{{ form.as_table() }}</table>
<p><input type="submit" value="Import"></p>
</form>
</div>
{% endif %}
{% endblock %}

0 comments on commit 8e50d2e

Please sign in to comment.