├── .bumpversion.cfg
├── .gitignore
├── LICENSE
├── MANIFEST.in
├── README.md
├── floppyforms_bootstrap3
├── __init__.py
├── admin.py
├── models.py
├── templates
│ └── floppyforms
│ │ ├── attrs.html
│ │ ├── errors.html
│ │ ├── layouts
│ │ ├── bootstrap3-horizontal.html
│ │ └── bootstrap3-inline.html
│ │ └── rows
│ │ ├── bootstrap3-horizontal.html
│ │ └── bootstrap3-inline.html
├── tests.py
└── views.py
├── setup.cfg
└── setup.py
/.bumpversion.cfg:
--------------------------------------------------------------------------------
1 | [bumpversion]
2 | current_version = 0.0.0
3 | files = setup.py
4 | commit = True
5 | tag = True
6 | message = Release version {new_version}.
7 |
8 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | build/
2 | dist/
3 | *.egg-info/
4 |
5 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2014 George Goldberg
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
--------------------------------------------------------------------------------
/MANIFEST.in:
--------------------------------------------------------------------------------
1 | include *.md LICENSE
2 | recursive-include floppyforms_bootstrap3/templates *
3 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | django-floppyforms-bootstrap3
2 | =============================
3 |
4 | Bootstrap 3 Friendly Templates for Django Floppy Forms
5 |
6 | The aim of this is to provide Django Floppy Forms templates that produce nice Bootstrap 3 HTML with
7 | minimal effort, so you can get something nice looking for your Bootstrap powered site quickly and
8 | easily, and also to give a starting point for further customisation.
9 |
10 | This project is currently incomplete. I'm only implementing bits as and when I need them. However,
11 | I am very happy to receive merge requests that get more of it finished.
12 |
13 | What Works So Far?
14 | ==================
15 |
16 | * The Bootstrap 3 Horizontal Form layout http://getbootstrap.com/css/#forms-horizontal
17 |
18 | How To Use
19 | ==========
20 |
21 | * Clone the git repo into the base directory of your Django Project, and add it to settings.py just like any other app.
22 | * Make sure this app is included in setings.py apps *before* floppy forms, as otherwise the template overriding doesn't seem to work properly.
23 | * Use floppyforms as normal.
24 | * Start with the example code below for how to use it.
25 |
26 | Example
27 | =======
28 |
29 | The example below gives a Bootstrap 3 Horizontal Form Layout.
30 |
31 |
32 |
41 |
42 |
43 | Sources
44 | =======
45 |
46 | The code in this repository was based off the Bootstrap 2 example in the FloppyForms documentation,
47 | as well as comments at https://github.com/gregmuellegger/django-floppyforms/issues/86
48 |
49 |
50 |
--------------------------------------------------------------------------------
/floppyforms_bootstrap3/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/grundleborg/django-floppyforms-bootstrap3/951814e2b9957417423150b456240c1db4d6e589/floppyforms_bootstrap3/__init__.py
--------------------------------------------------------------------------------
/floppyforms_bootstrap3/admin.py:
--------------------------------------------------------------------------------
1 | from django.contrib import admin
2 |
3 | # Register your models here.
4 |
--------------------------------------------------------------------------------
/floppyforms_bootstrap3/models.py:
--------------------------------------------------------------------------------
1 | from django.db import models
2 |
3 | # Create your models here.
4 |
--------------------------------------------------------------------------------
/floppyforms_bootstrap3/templates/floppyforms/attrs.html:
--------------------------------------------------------------------------------
1 | {% if "class" in attrs.keys %}
2 | {% for name, value in attrs.items %} {{ name }}{% if name == "class" %}="form-control {{ value }}"{% elif value != True %}="{{ value }}"{% endif %}{% endfor %}
3 | {% else %}
4 | {% for name, value in attrs.items %} {{ name }}{% if value != True %}="{{ value }}"{% endif %}{% endfor %} class="form-control"
5 | {% endif %}
6 |
--------------------------------------------------------------------------------
/floppyforms_bootstrap3/templates/floppyforms/errors.html:
--------------------------------------------------------------------------------
1 | {% if errors %}{% for error in errors %}{{ error }}{% if not forloop.last %} {% endif %}{% endfor %}{% endif %}
2 |
--------------------------------------------------------------------------------
/floppyforms_bootstrap3/templates/floppyforms/layouts/bootstrap3-horizontal.html:
--------------------------------------------------------------------------------
1 | {% load floppyforms %}{% block formconfig %}{% formconfig row using "floppyforms/rows/bootstrap3-horizontal.html" %}{% endblock %}
2 |
3 | {% block forms %}{% for form in forms %}
4 | {% block errors %}
5 | {% for error in form.non_field_errors %}
6 |