Commit 3195f727 by Michael Elovskikh

POST form using new form.html template

parent d3f65363
...@@ -125,25 +125,16 @@ ...@@ -125,25 +125,16 @@
{% if post_form %} {% if post_form %}
<div class="well"> <div class="well">
<form action="{{ request.get_full_path }}" method="POST" {% if post_form.is_multipart %}enctype="multipart/form-data"{% endif %} class="form-horizontal"> {% with form=post_form %}
<fieldset> <form action="{{ request.get_full_path }}" method="POST" {% if form.is_multipart %}enctype="multipart/form-data"{% endif %} class="form-horizontal">
{% csrf_token %} <fieldset>
{{ post_form.non_field_errors }} {% include "rest_framework/form.html" %}
{% for field in post_form %} <div class="form-actions">
<div class="control-group"> <!--{% if field.errors %}error{% endif %}--> <button class="btn btn-primary" title="Make a POST request on the {{ name }} resource">POST</button>
{{ field.label_tag|add_class:"control-label" }}
<div class="controls">
{{ field }}
<span class="help-inline">{{ field.help_text }}</span>
<!--{{ field.errors|add_class:"help-block" }}-->
</div>
</div> </div>
{% endfor %} </fieldset>
<div class="form-actions"> </form>
<button class="btn btn-primary" title="Make a POST request on the {{ name }} resource">POST</button> {% endwith %}
</div>
</fieldset>
</form>
</div> </div>
{% endif %} {% endif %}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment