#2612: [patch] Fix admin formatting when help_text used with multiple fields on
the same line
------------------------------------------------+---------------------------
Reporter: Andy Dustman <[EMAIL PROTECTED]> | Owner: adrian
Type: defect | Status: new
Priority: low | Milestone:
Component: Admin interface | Version: SVN
Severity: minor | Keywords:
------------------------------------------------+---------------------------
If you have a case where you have set multiple fields to appear on the
same line in the admin interface, the current version produces a line
break when help_text is present, due to it being in a <p> element. To fix
it in a half-assed sort of way, I wrapped the entire field in a <div
style="float: left">. The diff is should below:
{{{
Index: django/contrib/admin/templates/admin/field_line.html
===================================================================
--- django/contrib/admin/templates/admin/field_line.html (revision
3669)
+++ django/contrib/admin/templates/admin/field_line.html (working
copy)
@@ -2,9 +2,11 @@
<div class="{{ class_names }}" >
{% for bound_field in bound_fields %}{{ bound_field.html_error_list }}{%
endfor %}
{% for bound_field in bound_fields %}
+ <div style="float: left;">
{% if bound_field.has_label_first %}{% field_label bound_field %}{%
endif %}
{% field_widget bound_field %}
{% if not bound_field.has_label_first %}{% field_label bound_field %}{%
endif %}
{% if bound_field.field.help_text %}<p class="help">{{
bound_field.field.help_text }}</p>{% endif %}
+ </div>
{% endfor %}
</div>
}}}
Ultimately you want a class which does this, which means changing the
admin stylesheet, so you probably don't want to use this patch exactly.
The patch does not appear to affect the default case of stacked fields, as
the the field line itself is wrapped in another <div>.
--
Ticket URL: <http://code.djangoproject.com/ticket/2612>
Django <http://code.djangoproject.org/>
The web framework for perfectionists with deadlines.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-updates
-~----------~----~----~----~------~----~------~--~---