Added new widget to alert if a file is set at larger than 10 MB.

- Updated default widget to use template that adds a notification box.
- Added JS to add onchange & load events to look at the value in the input and trigger the notification & disable the form submits.
This commit is contained in:
Jason Kelly
2021-05-23 14:12:00 +08:00
parent c9617c4bd3
commit 6e655cb0e0
3 changed files with 53 additions and 0 deletions

View File

@ -0,0 +1,3 @@
{% load i18n %}
{% include "django/forms/widgets/clearable_file_input.html" %}
<span class="help file-cta is-hidden file-too-big">{% trans "File exceeds maximum size: 10MB" %}</span>