Ticket #16371: css_prefix.diff
File css_prefix.diff, 1.8 KB (added by , 13 years ago) |
---|
-
django/contrib/admin/options.py
71 71 formfield_overrides = {} 72 72 readonly_fields = () 73 73 ordering = None 74 css_prefix = None 74 75 75 76 def __init__(self): 76 77 overrides = FORMFIELD_FOR_DBFIELD_DEFAULTS.copy() … … 734 735 'content_type_id': ContentType.objects.get_for_model(self.model).id, 735 736 'save_as': self.save_as, 736 737 'save_on_top': self.save_on_top, 738 'css_prefix': context['adminform'].model_admin.css_prefix or None, 737 739 }) 738 740 if add and self.add_form_template is not None: 739 741 form_template = self.add_form_template -
django/contrib/admin/templates/admin/includes/fieldset.html
4 4 <div class="description">{{ fieldset.description|safe }}</div> 5 5 {% endif %} 6 6 {% for line in fieldset %} 7 <div class="form-row{% if line.fields|length_is:'1' and line.errors %} errors{% endif %}{% for field in line %} {{ field.field.name }}{% endfor %}">7 <div class="form-row{% if line.fields|length_is:'1' and line.errors %} errors{% endif %}{% for field in line %} {{ css_prefix }}{{ field.field.name }}{% endfor %}"> 8 8 {% if line.fields|length_is:'1' %}{{ line.errors }}{% endif %} 9 9 {% for field in line %} 10 10 <div{% if not line.fields|length_is:'1' %} class="field-box{% if not field.is_readonly and field.errors %} errors{% endif %}"{% endif %}>