Ticket #13068: 13068.inline-prepopulated-fields.diff

File 13068.inline-prepopulated-fields.diff, 2.3 KB (added by Julien Phalip, 13 years ago)
  • django/contrib/admin/templates/admin/includes/fieldset.html

    diff --git a/django/contrib/admin/templates/admin/includes/fieldset.html b/django/contrib/admin/templates/admin/includes/fieldset.html
    index 0b71d50..ae2a3d1 100644
    a b  
    44        <div class="description">{{ fieldset.description|safe }}</div>
    55    {% endif %}
    66    {% for line in fieldset %}
    7         <div class="form-row{% if line.fields|length_is:'1' and line.errors %} errors{% endif %}{% for field in line %}{% if field.field.name %} field-{{ field.field.name }}{% endif %}{% endfor %}">
     7        <div class="form-row{% if line.fields|length_is:'1' and line.errors %} errors{% endif %}">
    88            {% if line.fields|length_is:'1' %}{{ line.errors }}{% endif %}
    99            {% for field in line %}
    10                 <div{% if not line.fields|length_is:'1' %} class="field-box{% if not field.is_readonly and field.errors %} errors{% endif %}"{% endif %}>
     10                <div{% if not line.fields|length_is:'1' %} class="field-box{% if field.field.name %} field-{{ field.field.name }}{% endif %}{% if not field.is_readonly and field.errors %} errors{% endif %}"{% endif %}>
    1111                    {% if not line.fields|length_is:'1' and not field.is_readonly %}{{ field.errors }}{% endif %}
    1212                    {% if field.is_checkbox %}
    1313                        {{ field.field }}{{ field.label_tag }}
  • django/contrib/admin/templates/admin/prepopulated_fields_js.html

    diff --git a/django/contrib/admin/templates/admin/prepopulated_fields_js.html b/django/contrib/admin/templates/admin/prepopulated_fields_js.html
    index 7300bea..fee51e2 100644
    a b  
    1313
    1414    {% for dependency in field.dependencies %}
    1515    field['dependency_ids'].push('#{{ dependency.auto_id }}');
    16     field['dependency_list'].push('.{{ dependency.name }}');
     16    field['dependency_list'].push('.field-{{ dependency.name }}');
    1717    {% endfor %}
    1818
    19     $('.empty-form .{{ field.field.name }}').addClass('prepopulated_field');
     19    $('.empty-form .field-{{ field.field.name }}').addClass('prepopulated_field');
    2020    $(field.id).data('dependency_list', field['dependency_list'])
    2121               .prepopulate(field['dependency_ids'], field.maxLength);
    2222{% endfor %}
Back to Top