Ticket #7054: 7054.patch
File 7054.patch, 3.4 KB (added by , 16 years ago) |
---|
-
django/contrib/admin/options.py
87 87 else: 88 88 self.fields = field 89 89 90 def __len__(self): 91 try: 92 return len(self.fields) 93 except TypeError: 94 return 1 95 90 96 def __iter__(self): 91 97 for i, field in enumerate(self.fields): 92 98 yield AdminField(self.form, field, is_first=(i == 0)) -
django/contrib/admin/templates/admin/includes/fieldset.html
4 4 {% for line in fieldset %} 5 5 <div class="form-row{% if line.errors %} errors{% endif %} {% for field in line %}{{ field.field.name }} {% endfor %} "> 6 6 {{ line.errors }} 7 {% with line|length as length %} 7 8 {% for field in line %} 9 {% ifnotequal length 1 %}<div class="inline-fieldset">{% endifnotequal %} 8 10 {% if field.is_checkbox %} 9 11 {{ field.field }}{{ field.label_tag }} 10 12 {% else %} … … 11 13 {{ field.label_tag }}{{ field.field }} 12 14 {% endif %} 13 15 {% if field.field.field.help_text %}<p class="help">{{ field.field.field.help_text|safe }}</p>{% endif %} 16 {% ifnotequal length 1 %}</div>{% endifnotequal %} 14 17 {% endfor %} 18 {% endwith %} 15 19 </div> 16 20 {% endfor %} 17 21 </fieldset> -
django/contrib/admin/templates/admin/edit_inline/tabular.html
42 42 <td class="{{ field.field.name }}"> 43 43 {{ field.field.errors.as_ul }} 44 44 {{ field.field }} 45 {% if field.field.field.help_text %}<p class="help">{{ field.field.field.help_text|safe }}</p>{% endif %} 45 46 </td> 46 47 {% endfor %} 47 48 {% endfor %} -
django/contrib/admin/media/css/forms.css
21 21 /* ALIGNED FIELDSETS */ 22 22 .aligned label { display:block; padding:0 1em 3px 0; float:left; width:8em; } 23 23 .aligned label.inline { display:inline; float:none; } 24 .inline-fieldset {float:left;} 25 .inline-fieldset p.help { max-width:20em; } 24 26 .colMS .aligned .vLargeTextField, .colMS .aligned .vXMLLargeTextField { width:350px; } 25 27 form .aligned p, form .aligned ul { margin-left:7em; padding-left:30px; } 26 28 form .aligned table p { margin-left:0; padding-left:0; } … … 72 74 .inline-related fieldset {margin: 0; background:#fff; border: none; } 73 75 .inline-related fieldset.module h3 { margin:0; padding:2px 5px 3px 5px; font-size:11px; text-align:left; font-weight:bold; background:#bcd; color:#fff; } 74 76 .inline-related.tabular fieldset.module table {width:100%;} 77 .inline-related.tabular p.help {max-width:20em;} 75 78 .last-related fieldset {border: none;} 76 79 77 80 .inline-group .tabular tr.has_original td {padding-top:2em;}