From b335fab55e15424ef0c1318630d1ea7d2a4f6182 Mon Sep 17 00:00:00 2001 From: Robert Wittams Date: Mon, 10 Oct 2005 13:12:53 +0000 Subject: [PATCH] Small fixes: context for add_stage was wrong, and labels for booleans. git-svn-id: http://code.djangoproject.com/svn/django/branches/new-admin@818 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/templatetags/admin_modify.py | 6 ++++-- django/views/admin/main.py | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/django/templatetags/admin_modify.py b/django/templatetags/admin_modify.py index 2ab019b3ee..040834126a 100644 --- a/django/templatetags/admin_modify.py +++ b/django/templatetags/admin_modify.py @@ -52,16 +52,18 @@ def field_label(bound_field): class_names = [] if isinstance(bound_field.field, meta.BooleanField): class_names.append("vCheckboxLabel") + colon = "" else: if not bound_field.field.blank: class_names.append('required') if not bound_field.first: class_names.append('inline') + colon = ":" class_str = class_names and ' class="%s"' % ' '.join(class_names) or '' - return ' ' % \ + return ' ' % \ (bound_field.element_id, class_str, - capfirst(bound_field.field.verbose_name) ) + capfirst(bound_field.field.verbose_name), colon ) field_label = simple_tag(field_label) diff --git a/django/views/admin/main.py b/django/views/admin/main.py index 808055a21e..8632c2a626 100644 --- a/django/views/admin/main.py +++ b/django/views/admin/main.py @@ -711,7 +711,7 @@ def add_stage_new(request, app_label, module_name, show_delete=False, form_url=' c['object_id'] = object_id_override - fill_extra_context(opts, app_label, c, change=True) + fill_extra_context(opts, app_label, c, change=False) return render_to_response("admin_change_form", context_instance=c)