From f5ed04d64899730eecf832d61f4873614a00282f Mon Sep 17 00:00:00 2001 From: Matt Austin Date: Wed, 14 Sep 2011 11:39:44 +0800 Subject: [PATCH 1/3] Added handling of visible/hidden fields (fixes issue where labels/wrapping elements of hidden fields were being rendered). Also added form.non_field_errors to form template. --- bootstrapform/templates/bootstrapform/form.html | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/bootstrapform/templates/bootstrapform/form.html b/bootstrapform/templates/bootstrapform/form.html index 173b5a5..e22d708 100644 --- a/bootstrapform/templates/bootstrapform/form.html +++ b/bootstrapform/templates/bootstrapform/form.html @@ -1,7 +1,13 @@ {% load bootstrap %} -{% for field in form %} -
+{{ form.non_field_errors }} + +{% for field in form.hidden_fields %} + {{ field }} +{% endfor %} + +{% for field in form.visible_fields %} +
{% if field|is_checkbox %}
  • @@ -25,3 +31,4 @@ {% endif %}
{% endfor %} + From 1349484b840f864fd3e9bf376e287bbb1b5b9c46 Mon Sep 17 00:00:00 2001 From: Matt Austin Date: Wed, 14 Sep 2011 13:46:55 +0800 Subject: [PATCH 2/3] Added note about INSTALLED_APPS to README. --- README | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README b/README index b8a624e..21bd086 100644 --- a/README +++ b/README @@ -2,8 +2,10 @@ Generate twitter-bootstrap form output for django form A django template tag to work with twitter bootstrap ( http://twitter.github.com/bootstrap/ ) -usage: +Installation: +Add 'bootstrapform' to INSTALLED_APPS. +Template usage: {% load bootstrap %} {{ form|bootstrap }} From 429b6d07ce9be19152258429cd780dcc44c64d4c Mon Sep 17 00:00:00 2001 From: Matt Austin Date: Wed, 14 Sep 2011 13:49:05 +0800 Subject: [PATCH 3/3] Updated author information (setup.py changes have now been pulled back in to original project). --- setup.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 9aaa8e0..074ae3e 100644 --- a/setup.py +++ b/setup.py @@ -3,8 +3,8 @@ from bootstrapform.meta import VERSION setup(name='django-bootstrap-form', - author='Matt Austin', author_email='mail@mattaustin.me.uk', - url='https://github.com/MattAustin/django-bootstrap-form', + author='tzangms', author_email='tzangms@gmail.com', + url='https://github.com/tzangms/django-bootstrap-form', version=str(VERSION), packages=find_packages(), include_package_data=True,