From f5ed04d64899730eecf832d61f4873614a00282f Mon Sep 17 00:00:00 2001 From: Matt Austin Date: Wed, 14 Sep 2011 11:39:44 +0800 Subject: [PATCH 1/4] 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 1cbfab00d3bc4dd29199a3d771f9f874a45cf1bf Mon Sep 17 00:00:00 2001 From: tzangms Date: Wed, 14 Sep 2011 11:59:07 +0800 Subject: [PATCH 2/4] add LICENSE --- LICENSE | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 LICENSE diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..9b5f11a --- /dev/null +++ b/LICENSE @@ -0,0 +1,27 @@ +Copyright (c) Ming Hsien Tzang and individual contributors. +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + 3. Neither the name of django-bootstrap-form nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. From 1349484b840f864fd3e9bf376e287bbb1b5b9c46 Mon Sep 17 00:00:00 2001 From: Matt Austin Date: Wed, 14 Sep 2011 13:46:55 +0800 Subject: [PATCH 3/4] 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 4/4] 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,