summaryrefslogtreecommitdiff
path: root/django
diff options
context:
space:
mode:
authorCarles Pina <carles@pina.cat>2020-05-04 17:41:38 +0200
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2020-06-01 12:25:25 +0200
commite46c2326c8cfc038e015f55fd050ab5d7eb91b62 (patch)
tree717bae6135483bfeb4061fc90932f8ad52519f43 /django
parent578b3046e3b4adc43655bb5dd955054b7bf19f89 (diff)
Fixed #31536 -- Fixed rendering of disabled AdminFileWidget and ClearableFileInput.
Diffstat (limited to 'django')
-rw-r--r--django/contrib/admin/templates/admin/widgets/clearable_file_input.html2
-rw-r--r--django/forms/jinja2/django/forms/widgets/clearable_file_input.html2
-rw-r--r--django/forms/templates/django/forms/widgets/clearable_file_input.html2
3 files changed, 3 insertions, 3 deletions
diff --git a/django/contrib/admin/templates/admin/widgets/clearable_file_input.html b/django/contrib/admin/templates/admin/widgets/clearable_file_input.html
index 80699d1a50..fe71ebdb06 100644
--- a/django/contrib/admin/templates/admin/widgets/clearable_file_input.html
+++ b/django/contrib/admin/templates/admin/widgets/clearable_file_input.html
@@ -1,6 +1,6 @@
{% if widget.is_initial %}<p class="file-upload">{{ widget.initial_text }}: <a href="{{ widget.value.url }}">{{ widget.value }}</a>{% if not widget.required %}
<span class="clearable-file-input">
-<input type="checkbox" name="{{ widget.checkbox_name }}" id="{{ widget.checkbox_id }}">
+<input type="checkbox" name="{{ widget.checkbox_name }}" id="{{ widget.checkbox_id }}"{% if widget.attrs.disabled %} disabled{% endif %}>
<label for="{{ widget.checkbox_id }}">{{ widget.clear_checkbox_label }}</label></span>{% endif %}<br>
{{ widget.input_text }}:{% endif %}
<input type="{{ widget.type }}" name="{{ widget.name }}"{% include "django/forms/widgets/attrs.html" %}>{% if widget.is_initial %}</p>{% endif %}
diff --git a/django/forms/jinja2/django/forms/widgets/clearable_file_input.html b/django/forms/jinja2/django/forms/widgets/clearable_file_input.html
index 9e76435216..93812837f0 100644
--- a/django/forms/jinja2/django/forms/widgets/clearable_file_input.html
+++ b/django/forms/jinja2/django/forms/widgets/clearable_file_input.html
@@ -1,5 +1,5 @@
{% if widget.is_initial %}{{ widget.initial_text }}: <a href="{{ widget.value.url }}">{{ widget.value }}</a>{% if not widget.required %}
-<input type="checkbox" name="{{ widget.checkbox_name }}" id="{{ widget.checkbox_id }}">
+<input type="checkbox" name="{{ widget.checkbox_name }}" id="{{ widget.checkbox_id }}"{% if widget.attrs.disabled %} disabled{% endif %}>
<label for="{{ widget.checkbox_id }}">{{ widget.clear_checkbox_label }}</label>{% endif %}<br>
{{ widget.input_text }}:{% endif %}
<input type="{{ widget.type }}" name="{{ widget.name }}"{% include "django/forms/widgets/attrs.html" %}>
diff --git a/django/forms/templates/django/forms/widgets/clearable_file_input.html b/django/forms/templates/django/forms/widgets/clearable_file_input.html
index 9e76435216..93812837f0 100644
--- a/django/forms/templates/django/forms/widgets/clearable_file_input.html
+++ b/django/forms/templates/django/forms/widgets/clearable_file_input.html
@@ -1,5 +1,5 @@
{% if widget.is_initial %}{{ widget.initial_text }}: <a href="{{ widget.value.url }}">{{ widget.value }}</a>{% if not widget.required %}
-<input type="checkbox" name="{{ widget.checkbox_name }}" id="{{ widget.checkbox_id }}">
+<input type="checkbox" name="{{ widget.checkbox_name }}" id="{{ widget.checkbox_id }}"{% if widget.attrs.disabled %} disabled{% endif %}>
<label for="{{ widget.checkbox_id }}">{{ widget.clear_checkbox_label }}</label>{% endif %}<br>
{{ widget.input_text }}:{% endif %}
<input type="{{ widget.type }}" name="{{ widget.name }}"{% include "django/forms/widgets/attrs.html" %}>