├── templates └── twitter-bootstrap │ ├── uni_form.html │ ├── uni_formset.html │ ├── errors.html │ ├── errors_formset.html │ ├── includes.html │ ├── multifield.html │ ├── betterform.html │ ├── field.html │ ├── field.strict.html │ ├── whole_uni_form.html │ └── whole_uni_formset.html └── README.rst /templates/twitter-bootstrap/uni_form.html: -------------------------------------------------------------------------------- 1 | {% include "uni_form/errors.html" %} 2 | {% for field in form %} 3 | {% include "uni_form/field.html" %} 4 | {% endfor %} 5 | -------------------------------------------------------------------------------- /templates/twitter-bootstrap/uni_formset.html: -------------------------------------------------------------------------------- 1 | {% with formset.management_form as form %} 2 | {% include 'uni_form/uni_form.html' %} 3 | {% endwith %} 4 | {% for form in formset.forms %} 5 |
6 | {% include 'uni_form/uni_form.html' %} 7 |
8 | {% endfor %} 9 | -------------------------------------------------------------------------------- /templates/twitter-bootstrap/errors.html: -------------------------------------------------------------------------------- 1 | {% if form.non_field_errors %} 2 |
3 | {% if form_error_title %}

{{ form_error_title }}

{% endif %} 4 |
    5 | {{ form.non_field_errors|unordered_list }} 6 |
7 |
8 | {% endif %} 9 | -------------------------------------------------------------------------------- /templates/twitter-bootstrap/errors_formset.html: -------------------------------------------------------------------------------- 1 | {% if formset.non_form_errors %} 2 |
3 | {% if formset_error_title %}

{{ formset_error_title }}

{% endif %} 4 |
    5 | {{ formset.non_form_errors|unordered_list }} 6 |
7 |
8 | {% endif %} 9 | 10 | -------------------------------------------------------------------------------- /templates/twitter-bootstrap/includes.html: -------------------------------------------------------------------------------- 1 | {% comment %} 2 | This is used by the 'uni_form_setup' template tag to identify where to grab media files. 3 | {% endcomment %} 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /templates/twitter-bootstrap/multifield.html: -------------------------------------------------------------------------------- 1 | {% load uni_form_field %} 2 | 3 | {% if field.is_hidden %} 4 | {{ field }} 5 | {% else %} 6 | 7 | {% if field.label %} 8 | 25 | {% endif %} 26 | 27 | {% endif %} 28 | -------------------------------------------------------------------------------- /templates/twitter-bootstrap/betterform.html: -------------------------------------------------------------------------------- 1 | {% for fieldset in form.fieldsets %} 2 |
3 | {% if fieldset.legend %} 4 | {{ fieldset.legend }} 5 | {% endif %} 6 | 7 | {% if fieldset.description %} 8 |

{{ fieldset.description }}

9 | {% endif %} 10 | 11 | {% for field in fieldset %} 12 | {% if field.is_hidden %} 13 | {{ field }} 14 | {% else %} 15 | {% include "uni_form/field.html" %} 16 | {% endif %} 17 | {% endfor %} 18 | {% if not forloop.last or not fieldset_open %} 19 |
20 | {% endif %} 21 | {% endfor %} 22 | 23 | -------------------------------------------------------------------------------- /templates/twitter-bootstrap/field.html: -------------------------------------------------------------------------------- 1 | {% load uni_form_field %} 2 | 3 | {% if field.is_hidden %} 4 | {{ field }} 5 | {% else %} 6 |
7 | {% if field.label %} 8 | 11 | {% endif %} 12 | 13 |
14 | {{ field|with_class }} 15 | {% for error in field.errors %} 16 | {{ error|safe }} 17 | {% endfor %} 18 | {% if field.help_text %} 19 | {{ field.help_text|safe }} 20 | {% endif %} 21 |
22 |
23 | {% endif %} 24 | -------------------------------------------------------------------------------- /README.rst: -------------------------------------------------------------------------------- 1 | ===================================== 2 | ``django-uni-form`` Contrib Templates 3 | ===================================== 4 | 5 | What 6 | ---- 7 | 8 | Contributed templates for `Daniel Greenfeld `_ and `Miguel Araujo `_'s 9 | awesome `django-uni-form `_ library. Template sets are named for the library they 10 | relate to. 11 | 12 | How 13 | --- 14 | 15 | Clone the repo and copy the folder of templates that you want to use to your current project's template folder, renaming it to 16 | ``uni_form``.:: 17 | 18 | cp -r django-uni-form-contrib/twitter-bootstrap /templates/uni_form 19 | 20 | Oh, you probably won't want to include ``django-uni-form``'s media, either, so take it out of your templates. 21 | 22 | Who 23 | --- 24 | 25 | Current contributors are: 26 | 27 | * `Kenneth Love `_. 28 | 29 | License 30 | ------- 31 | 32 | All templates are released under the MIT license. 33 | -------------------------------------------------------------------------------- /templates/twitter-bootstrap/field.strict.html: -------------------------------------------------------------------------------- 1 | {% load uni_form_field %} 2 | 3 | {% if field.is_hidden %} 4 | {{ field }} 5 | {% else %} 6 |
7 | {% for error in field.errors %} 8 |

9 | {{ error|safe }} 10 |

11 | {% endfor %} 12 | 13 | {% if field|is_checkbox %} 14 | {{ field|with_class }} 15 | {% endif %} 16 | 17 | {% if field.label %} 18 | 21 | {% endif %} 22 | 23 | {% if not field|is_checkbox %} 24 | {{ field|with_class }} 25 | {% endif %} 26 | 27 | {% if field.help_text %} 28 |

{{ field.help_text|safe }}

29 | {% endif %} 30 |
31 | {% endif %} -------------------------------------------------------------------------------- /templates/twitter-bootstrap/whole_uni_form.html: -------------------------------------------------------------------------------- 1 | {% if form_tag %}
{% endif %} 2 | {% if form_method|lower == 'post' %} 3 | {% csrf_token %} 4 | {% endif %} 5 | 6 | {% if form.form_html %} 7 | {% include "uni_form/errors.html" %} 8 | {{ form.form_html }} 9 | {% else %} 10 | {% include "uni_form/uni_form.html" %} 11 | {% endif %} 12 | 13 | {% if inputs %} 14 |
15 | {% for input in inputs %} 16 | 24 | {% endfor %} 25 |
26 | {% endif %} 27 | {% if form_tag %}
{% endif %} 28 | -------------------------------------------------------------------------------- /templates/twitter-bootstrap/whole_uni_formset.html: -------------------------------------------------------------------------------- 1 | {% load uni_form_tags %} 2 | 3 | {% if formset_tag %} 4 |
5 | {% endif %} 6 | {% if formset_method|lower == 'post' %} 7 | {% csrf_token %} 8 | {% endif %} 9 | 10 |
11 | {{ formset.management_form|as_uni_form }} 12 |
13 | 14 | {% include "uni_form/errors_formset.html" %} 15 | 16 | {% for form in formset.forms %} 17 | {% if form.form_html %} 18 | {% include "uni_form/errors.html" %} 19 | {{ form.form_html }} 20 | {% else %} 21 | {% include "uni_form/uni_form.html" %} 22 | {% endif %} 23 | {% endfor %} 24 | 25 | {% if inputs %} 26 |
27 | {% for input in inputs %} 28 | 36 | {% endfor %} 37 |
38 | {% endif %} 39 | {% if formset_tag %}
{% endif %} 40 | --------------------------------------------------------------------------------