Ticket #31536: 31536-clearable_file_input_disabled.patch

File 31536-clearable_file_input_disabled.patch, 2.9 KB (added by Carles Pina Estany, 4 years ago)

Possible patch for the described problem

  • django/contrib/admin/templates/admin/widgets/clearable_file_input.html

    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..c6770ceca3 100644
    a b  
    11{% if widget.is_initial %}<p class="file-upload">{{ widget.initial_text }}: <a href="{{ widget.value.url }}">{{ widget.value }}</a>{% if not widget.required %}
    22<span class="clearable-file-input">
    3 <input type="checkbox" name="{{ widget.checkbox_name }}" id="{{ widget.checkbox_id }}">
     3<input type="checkbox" name="{{ widget.checkbox_name }}" id="{{ widget.checkbox_id }}" {% if widget.attrs.disabled %}disabled{% endif %}>
    44<label for="{{ widget.checkbox_id }}">{{ widget.clear_checkbox_label }}</label></span>{% endif %}<br>
    55{{ widget.input_text }}:{% endif %}
    66<input type="{{ widget.type }}" name="{{ widget.name }}"{% include "django/forms/widgets/attrs.html" %}>{% if widget.is_initial %}</p>{% endif %}
  • django/forms/jinja2/django/forms/widgets/clearable_file_input.html

    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..ef34f23a32 100644
    a b  
    11{% if widget.is_initial %}{{ widget.initial_text }}: <a href="{{ widget.value.url }}">{{ widget.value }}</a>{% if not widget.required %}
    2 <input type="checkbox" name="{{ widget.checkbox_name }}" id="{{ widget.checkbox_id }}">
     2<input type="checkbox" name="{{ widget.checkbox_name }}" id="{{ widget.checkbox_id }}" {% if widget.attrs.disabled %}disabled{% endif %}>
    33<label for="{{ widget.checkbox_id }}">{{ widget.clear_checkbox_label }}</label>{% endif %}<br>
    44{{ widget.input_text }}:{% endif %}
    55<input type="{{ widget.type }}" name="{{ widget.name }}"{% include "django/forms/widgets/attrs.html" %}>
  • django/forms/templates/django/forms/widgets/clearable_file_input.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..ef34f23a32 100644
    a b  
    11{% if widget.is_initial %}{{ widget.initial_text }}: <a href="{{ widget.value.url }}">{{ widget.value }}</a>{% if not widget.required %}
    2 <input type="checkbox" name="{{ widget.checkbox_name }}" id="{{ widget.checkbox_id }}">
     2<input type="checkbox" name="{{ widget.checkbox_name }}" id="{{ widget.checkbox_id }}" {% if widget.attrs.disabled %}disabled{% endif %}>
    33<label for="{{ widget.checkbox_id }}">{{ widget.clear_checkbox_label }}</label>{% endif %}<br>
    44{{ widget.input_text }}:{% endif %}
    55<input type="{{ widget.type }}" name="{{ widget.name }}"{% include "django/forms/widgets/attrs.html" %}>
Back to Top