From e8ea365c15b13185efc2ba03e57a3302f783d538 Mon Sep 17 00:00:00 2001 From: Tom Christie Date: Wed, 15 Oct 2014 15:11:01 +0100 Subject: [PATCH] Moar form styling --- rest_framework/templates/rest_framework/base.html | 4 ++-- .../rest_framework/horizontal/{fields => }/checkbox.html | 0 .../horizontal/{fields => }/checkbox_multiple.html | 0 .../rest_framework/horizontal/{fields => }/fieldset.html | 0 rest_framework/templates/rest_framework/horizontal/form.html | 4 ++-- .../rest_framework/horizontal/{fields => }/input.html | 2 +- .../rest_framework/horizontal/{fields => }/list_fieldset.html | 0 .../rest_framework/horizontal/{fields => }/radio.html | 0 .../rest_framework/horizontal/{fields => }/select.html | 0 .../horizontal/{fields => }/select_multiple.html | 0 .../rest_framework/horizontal/{fields => }/textarea.html | 0 .../rest_framework/inline/{fields => }/checkbox.html | 0 .../rest_framework/inline/{fields => }/checkbox_multiple.html | 0 .../rest_framework/inline/{fields => }/fieldset.html | 0 rest_framework/templates/rest_framework/inline/form.html | 4 ++-- .../templates/rest_framework/inline/{fields => }/input.html | 2 +- .../templates/rest_framework/inline/{fields => }/radio.html | 0 .../templates/rest_framework/inline/{fields => }/select.html | 0 .../rest_framework/inline/{fields => }/select_multiple.html | 0 .../rest_framework/inline/{fields => }/textarea.html | 0 .../rest_framework/vertical/{fields => }/checkbox.html | 0 .../vertical/{fields => }/checkbox_multiple.html | 0 .../rest_framework/vertical/{fields => }/fieldset.html | 0 rest_framework/templates/rest_framework/vertical/form.html | 4 ++-- .../templates/rest_framework/vertical/{fields => }/input.html | 2 +- .../rest_framework/vertical/{fields => }/list_fieldset.html | 0 .../templates/rest_framework/vertical/{fields => }/radio.html | 0 .../rest_framework/vertical/{fields => }/select.html | 0 .../rest_framework/vertical/{fields => }/select_multiple.html | 0 .../rest_framework/vertical/{fields => }/textarea.html | 0 30 files changed, 11 insertions(+), 11 deletions(-) rename rest_framework/templates/rest_framework/horizontal/{fields => }/checkbox.html (100%) rename rest_framework/templates/rest_framework/horizontal/{fields => }/checkbox_multiple.html (100%) rename rest_framework/templates/rest_framework/horizontal/{fields => }/fieldset.html (100%) rename rest_framework/templates/rest_framework/horizontal/{fields => }/input.html (77%) rename rest_framework/templates/rest_framework/horizontal/{fields => }/list_fieldset.html (100%) rename rest_framework/templates/rest_framework/horizontal/{fields => }/radio.html (100%) rename rest_framework/templates/rest_framework/horizontal/{fields => }/select.html (100%) rename rest_framework/templates/rest_framework/horizontal/{fields => }/select_multiple.html (100%) rename rest_framework/templates/rest_framework/horizontal/{fields => }/textarea.html (100%) rename rest_framework/templates/rest_framework/inline/{fields => }/checkbox.html (100%) rename rest_framework/templates/rest_framework/inline/{fields => }/checkbox_multiple.html (100%) rename rest_framework/templates/rest_framework/inline/{fields => }/fieldset.html (100%) rename rest_framework/templates/rest_framework/inline/{fields => }/input.html (58%) rename rest_framework/templates/rest_framework/inline/{fields => }/radio.html (100%) rename rest_framework/templates/rest_framework/inline/{fields => }/select.html (100%) rename rest_framework/templates/rest_framework/inline/{fields => }/select_multiple.html (100%) rename rest_framework/templates/rest_framework/inline/{fields => }/textarea.html (100%) rename rest_framework/templates/rest_framework/vertical/{fields => }/checkbox.html (100%) rename rest_framework/templates/rest_framework/vertical/{fields => }/checkbox_multiple.html (100%) rename rest_framework/templates/rest_framework/vertical/{fields => }/fieldset.html (100%) rename rest_framework/templates/rest_framework/vertical/{fields => }/input.html (75%) rename rest_framework/templates/rest_framework/vertical/{fields => }/list_fieldset.html (100%) rename rest_framework/templates/rest_framework/vertical/{fields => }/radio.html (100%) rename rest_framework/templates/rest_framework/vertical/{fields => }/select.html (100%) rename rest_framework/templates/rest_framework/vertical/{fields => }/select_multiple.html (100%) rename rest_framework/templates/rest_framework/vertical/{fields => }/textarea.html (100%) diff --git a/rest_framework/templates/rest_framework/base.html b/rest_framework/templates/rest_framework/base.html index 4b6c7fcfc..dcb0da2c0 100644 --- a/rest_framework/templates/rest_framework/base.html +++ b/rest_framework/templates/rest_framework/base.html @@ -153,7 +153,7 @@
{% with form=post_form %}
+ method="POST" enctype="multipart/form-data" class="form-horizontal" novalidate>
{{ post_form }}
@@ -198,7 +198,7 @@ {% if put_form %}
+ method="POST" enctype="multipart/form-data" class="form-horizontal" novalidate>
{{ put_form }}
diff --git a/rest_framework/templates/rest_framework/horizontal/fields/checkbox.html b/rest_framework/templates/rest_framework/horizontal/checkbox.html similarity index 100% rename from rest_framework/templates/rest_framework/horizontal/fields/checkbox.html rename to rest_framework/templates/rest_framework/horizontal/checkbox.html diff --git a/rest_framework/templates/rest_framework/horizontal/fields/checkbox_multiple.html b/rest_framework/templates/rest_framework/horizontal/checkbox_multiple.html similarity index 100% rename from rest_framework/templates/rest_framework/horizontal/fields/checkbox_multiple.html rename to rest_framework/templates/rest_framework/horizontal/checkbox_multiple.html diff --git a/rest_framework/templates/rest_framework/horizontal/fields/fieldset.html b/rest_framework/templates/rest_framework/horizontal/fieldset.html similarity index 100% rename from rest_framework/templates/rest_framework/horizontal/fields/fieldset.html rename to rest_framework/templates/rest_framework/horizontal/fieldset.html diff --git a/rest_framework/templates/rest_framework/horizontal/form.html b/rest_framework/templates/rest_framework/horizontal/form.html index 7560d8a26..fd15b6261 100644 --- a/rest_framework/templates/rest_framework/horizontal/form.html +++ b/rest_framework/templates/rest_framework/horizontal/form.html @@ -1,9 +1,9 @@ {% load rest_framework %} - + {% csrf_token %} {% for field in form %} {% if not field.read_only %} - {% render_field field template_pack=template_pack renderer=renderer %} + {% render_field field style=style %} {% endif %} {% endfor %} diff --git a/rest_framework/templates/rest_framework/horizontal/fields/input.html b/rest_framework/templates/rest_framework/horizontal/input.html similarity index 77% rename from rest_framework/templates/rest_framework/horizontal/fields/input.html rename to rest_framework/templates/rest_framework/horizontal/input.html index 43ab41512..df4aa40fc 100644 --- a/rest_framework/templates/rest_framework/horizontal/fields/input.html +++ b/rest_framework/templates/rest_framework/horizontal/input.html @@ -3,7 +3,7 @@ {% endif %}
- + {% if field.errors %} {% for error in field.errors %}{{ error }}{% endfor %} {% endif %} diff --git a/rest_framework/templates/rest_framework/horizontal/fields/list_fieldset.html b/rest_framework/templates/rest_framework/horizontal/list_fieldset.html similarity index 100% rename from rest_framework/templates/rest_framework/horizontal/fields/list_fieldset.html rename to rest_framework/templates/rest_framework/horizontal/list_fieldset.html diff --git a/rest_framework/templates/rest_framework/horizontal/fields/radio.html b/rest_framework/templates/rest_framework/horizontal/radio.html similarity index 100% rename from rest_framework/templates/rest_framework/horizontal/fields/radio.html rename to rest_framework/templates/rest_framework/horizontal/radio.html diff --git a/rest_framework/templates/rest_framework/horizontal/fields/select.html b/rest_framework/templates/rest_framework/horizontal/select.html similarity index 100% rename from rest_framework/templates/rest_framework/horizontal/fields/select.html rename to rest_framework/templates/rest_framework/horizontal/select.html diff --git a/rest_framework/templates/rest_framework/horizontal/fields/select_multiple.html b/rest_framework/templates/rest_framework/horizontal/select_multiple.html similarity index 100% rename from rest_framework/templates/rest_framework/horizontal/fields/select_multiple.html rename to rest_framework/templates/rest_framework/horizontal/select_multiple.html diff --git a/rest_framework/templates/rest_framework/horizontal/fields/textarea.html b/rest_framework/templates/rest_framework/horizontal/textarea.html similarity index 100% rename from rest_framework/templates/rest_framework/horizontal/fields/textarea.html rename to rest_framework/templates/rest_framework/horizontal/textarea.html diff --git a/rest_framework/templates/rest_framework/inline/fields/checkbox.html b/rest_framework/templates/rest_framework/inline/checkbox.html similarity index 100% rename from rest_framework/templates/rest_framework/inline/fields/checkbox.html rename to rest_framework/templates/rest_framework/inline/checkbox.html diff --git a/rest_framework/templates/rest_framework/inline/fields/checkbox_multiple.html b/rest_framework/templates/rest_framework/inline/checkbox_multiple.html similarity index 100% rename from rest_framework/templates/rest_framework/inline/fields/checkbox_multiple.html rename to rest_framework/templates/rest_framework/inline/checkbox_multiple.html diff --git a/rest_framework/templates/rest_framework/inline/fields/fieldset.html b/rest_framework/templates/rest_framework/inline/fieldset.html similarity index 100% rename from rest_framework/templates/rest_framework/inline/fields/fieldset.html rename to rest_framework/templates/rest_framework/inline/fieldset.html diff --git a/rest_framework/templates/rest_framework/inline/form.html b/rest_framework/templates/rest_framework/inline/form.html index b13d16614..6a0ea81d3 100644 --- a/rest_framework/templates/rest_framework/inline/form.html +++ b/rest_framework/templates/rest_framework/inline/form.html @@ -1,9 +1,9 @@ {% load rest_framework %} - + {% csrf_token %} {% for field in form %} {% if not field.read_only %} - {% render_field field template_pack=template_pack renderer=renderer %} + {% render_field field style=style %} {% endif %} {% endfor %} diff --git a/rest_framework/templates/rest_framework/inline/fields/input.html b/rest_framework/templates/rest_framework/inline/input.html similarity index 58% rename from rest_framework/templates/rest_framework/inline/fields/input.html rename to rest_framework/templates/rest_framework/inline/input.html index 0d3eb8845..f8ec4faf2 100644 --- a/rest_framework/templates/rest_framework/inline/fields/input.html +++ b/rest_framework/templates/rest_framework/inline/input.html @@ -2,5 +2,5 @@ {% if field.label %} {% endif %} - +
diff --git a/rest_framework/templates/rest_framework/inline/fields/radio.html b/rest_framework/templates/rest_framework/inline/radio.html similarity index 100% rename from rest_framework/templates/rest_framework/inline/fields/radio.html rename to rest_framework/templates/rest_framework/inline/radio.html diff --git a/rest_framework/templates/rest_framework/inline/fields/select.html b/rest_framework/templates/rest_framework/inline/select.html similarity index 100% rename from rest_framework/templates/rest_framework/inline/fields/select.html rename to rest_framework/templates/rest_framework/inline/select.html diff --git a/rest_framework/templates/rest_framework/inline/fields/select_multiple.html b/rest_framework/templates/rest_framework/inline/select_multiple.html similarity index 100% rename from rest_framework/templates/rest_framework/inline/fields/select_multiple.html rename to rest_framework/templates/rest_framework/inline/select_multiple.html diff --git a/rest_framework/templates/rest_framework/inline/fields/textarea.html b/rest_framework/templates/rest_framework/inline/textarea.html similarity index 100% rename from rest_framework/templates/rest_framework/inline/fields/textarea.html rename to rest_framework/templates/rest_framework/inline/textarea.html diff --git a/rest_framework/templates/rest_framework/vertical/fields/checkbox.html b/rest_framework/templates/rest_framework/vertical/checkbox.html similarity index 100% rename from rest_framework/templates/rest_framework/vertical/fields/checkbox.html rename to rest_framework/templates/rest_framework/vertical/checkbox.html diff --git a/rest_framework/templates/rest_framework/vertical/fields/checkbox_multiple.html b/rest_framework/templates/rest_framework/vertical/checkbox_multiple.html similarity index 100% rename from rest_framework/templates/rest_framework/vertical/fields/checkbox_multiple.html rename to rest_framework/templates/rest_framework/vertical/checkbox_multiple.html diff --git a/rest_framework/templates/rest_framework/vertical/fields/fieldset.html b/rest_framework/templates/rest_framework/vertical/fieldset.html similarity index 100% rename from rest_framework/templates/rest_framework/vertical/fields/fieldset.html rename to rest_framework/templates/rest_framework/vertical/fieldset.html diff --git a/rest_framework/templates/rest_framework/vertical/form.html b/rest_framework/templates/rest_framework/vertical/form.html index fe908af02..e68835c0e 100644 --- a/rest_framework/templates/rest_framework/vertical/form.html +++ b/rest_framework/templates/rest_framework/vertical/form.html @@ -1,9 +1,9 @@ {% load rest_framework %} - + {% csrf_token %} {% for field in form %} {% if not field.read_only %} - {% render_field field template_pack=template_pack renderer=renderer %} + {% render_field field style=style %} {% endif %} {% endfor %} diff --git a/rest_framework/templates/rest_framework/vertical/fields/input.html b/rest_framework/templates/rest_framework/vertical/input.html similarity index 75% rename from rest_framework/templates/rest_framework/vertical/fields/input.html rename to rest_framework/templates/rest_framework/vertical/input.html index 4f4cb017a..e1e21ca1f 100644 --- a/rest_framework/templates/rest_framework/vertical/fields/input.html +++ b/rest_framework/templates/rest_framework/vertical/input.html @@ -2,7 +2,7 @@ {% if field.label %} {% endif %} - + {% if field.errors %} {% for error in field.errors %}{{ error }}{% endfor %} {% endif %} diff --git a/rest_framework/templates/rest_framework/vertical/fields/list_fieldset.html b/rest_framework/templates/rest_framework/vertical/list_fieldset.html similarity index 100% rename from rest_framework/templates/rest_framework/vertical/fields/list_fieldset.html rename to rest_framework/templates/rest_framework/vertical/list_fieldset.html diff --git a/rest_framework/templates/rest_framework/vertical/fields/radio.html b/rest_framework/templates/rest_framework/vertical/radio.html similarity index 100% rename from rest_framework/templates/rest_framework/vertical/fields/radio.html rename to rest_framework/templates/rest_framework/vertical/radio.html diff --git a/rest_framework/templates/rest_framework/vertical/fields/select.html b/rest_framework/templates/rest_framework/vertical/select.html similarity index 100% rename from rest_framework/templates/rest_framework/vertical/fields/select.html rename to rest_framework/templates/rest_framework/vertical/select.html diff --git a/rest_framework/templates/rest_framework/vertical/fields/select_multiple.html b/rest_framework/templates/rest_framework/vertical/select_multiple.html similarity index 100% rename from rest_framework/templates/rest_framework/vertical/fields/select_multiple.html rename to rest_framework/templates/rest_framework/vertical/select_multiple.html diff --git a/rest_framework/templates/rest_framework/vertical/fields/textarea.html b/rest_framework/templates/rest_framework/vertical/textarea.html similarity index 100% rename from rest_framework/templates/rest_framework/vertical/fields/textarea.html rename to rest_framework/templates/rest_framework/vertical/textarea.html