Moar form styling

This commit is contained in:
Tom Christie 2014-10-15 15:11:01 +01:00
parent 22b27cbdc4
commit e8ea365c15
30 changed files with 11 additions and 11 deletions

View File

@ -153,7 +153,7 @@
<div class="tab-pane" id="object-form">
{% with form=post_form %}
<form action="{{ request.get_full_path }}"
method="POST" enctype="multipart/form-data" class="form-horizontal">
method="POST" enctype="multipart/form-data" class="form-horizontal" novalidate>
<fieldset>
{{ post_form }}
<div class="form-actions">
@ -198,7 +198,7 @@
{% if put_form %}
<div class="tab-pane" id="object-form">
<form action="{{ request.get_full_path }}"
method="POST" enctype="multipart/form-data" class="form-horizontal">
method="POST" enctype="multipart/form-data" class="form-horizontal" novalidate>
<fieldset>
{{ put_form }}
<div class="form-actions">

View File

@ -1,9 +1,9 @@
{% load rest_framework %}
<form class="form-horizontal" role="form" action="." method="POST">
<form class="form-horizontal" role="form" action="." method="POST" novalidate>
{% 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 %}
<!-- form.non_field_errors -->

View File

@ -3,7 +3,7 @@
<label class="col-sm-2 control-label {% if style.hide_label %}sr-only{% endif %}">{{ field.label }}</label>
{% endif %}
<div class="col-sm-10">
<input name="{{ field.name }}" class="form-control" type="{{ style.input_type }}" novalidate {% if style.placeholder %}placeholder="{{ style.placeholder }}"{% endif %} {% if field.value %}value="{{ field.value }}"{% endif %}>
<input name="{{ field.name }}" class="form-control" type="{{ style.input_type }}" {% if style.placeholder %}placeholder="{{ style.placeholder }}"{% endif %} {% if field.value %}value="{{ field.value }}"{% endif %}>
{% if field.errors %}
{% for error in field.errors %}<span class="help-block">{{ error }}</span>{% endfor %}
{% endif %}

View File

@ -1,9 +1,9 @@
{% load rest_framework %}
<form class="form-inline" role="form" action="." method="POST">
<form class="form-inline" role="form" action="." method="POST" novalidate>
{% 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 %}
<!-- form.non_field_errors -->

View File

@ -2,5 +2,5 @@
{% if field.label %}
<label class="sr-only">{{ field.label }}</label>
{% endif %}
<input name="{{ field.name }}" class="form-control" type="{{ style.input_type }}" novalidate {% if style.placeholder %}placeholder="{{ style.placeholder }}"{% endif %} {% if field.value %}value="{{ field.value }}"{% endif %}>
<input name="{{ field.name }}" class="form-control" type="{{ style.input_type }}" {% if style.placeholder %}placeholder="{{ style.placeholder }}"{% endif %} {% if field.value %}value="{{ field.value }}"{% endif %}>
</div>

View File

@ -1,9 +1,9 @@
{% load rest_framework %}
<form role="form" action="." method="POST">
<form role="form" action="." method="POST" novalidate>
{% 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 %}
<!-- form.non_field_errors -->

View File

@ -2,7 +2,7 @@
{% if field.label %}
<label {% if style.hide_label %}class="sr-only"{% endif %}>{{ field.label }}</label>
{% endif %}
<input name="{{ field.name }}" class="form-control" type="{{ style.input_type }}" novalidate {% if style.placeholder %}placeholder="{{ style.placeholder }}"{% endif %} {% if field.value %}value="{{ field.value }}"{% endif %}>
<input name="{{ field.name }}" class="form-control" type="{{ style.input_type }}" {% if style.placeholder %}placeholder="{{ style.placeholder }}"{% endif %} {% if field.value %}value="{{ field.value }}"{% endif %}>
{% if field.errors %}
{% for error in field.errors %}<span class="help-block">{{ error }}</span>{% endfor %}
{% endif %}