mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-02-02 20:54:42 +03:00
Added tabs between object form and generic content form on POST form
This commit is contained in:
parent
3195f72784
commit
533e472352
|
@ -125,6 +125,15 @@
|
||||||
|
|
||||||
{% if post_form %}
|
{% if post_form %}
|
||||||
<div class="well">
|
<div class="well">
|
||||||
|
<ul class="nav nav-pills" id="form-switcher">
|
||||||
|
{% if post_form %}
|
||||||
|
<li><a href="#object-form" data-toggle="pill">Object form</a></li>
|
||||||
|
{% endif %}
|
||||||
|
<li><a href="#generic-content-form" data-toggle="pill">Generic content form</a></li>
|
||||||
|
</ul>
|
||||||
|
<div class="tab-content">
|
||||||
|
{% if post_form %}
|
||||||
|
<div class="tab-pane" id="object-form">
|
||||||
{% with form=post_form %}
|
{% with form=post_form %}
|
||||||
<form action="{{ request.get_full_path }}" method="POST" {% if form.is_multipart %}enctype="multipart/form-data"{% endif %} class="form-horizontal">
|
<form action="{{ request.get_full_path }}" method="POST" {% if form.is_multipart %}enctype="multipart/form-data"{% endif %} class="form-horizontal">
|
||||||
<fieldset>
|
<fieldset>
|
||||||
|
@ -137,6 +146,21 @@
|
||||||
{% endwith %}
|
{% endwith %}
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
<div class="tab-pane" id="generic-content-form">
|
||||||
|
{% with form=generic_content_form %}
|
||||||
|
<form action="{{ request.get_full_path }}" method="POST" {% if form.is_multipart %}enctype="multipart/form-data"{% endif %} class="form-horizontal">
|
||||||
|
<fieldset>
|
||||||
|
{% include "rest_framework/form.html" %}
|
||||||
|
<div class="form-actions">
|
||||||
|
<button class="btn btn-primary" title="Make a POST request on the {{ name }} resource">POST</button>
|
||||||
|
</div>
|
||||||
|
</fieldset>
|
||||||
|
</form>
|
||||||
|
{% endwith %}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
{% if 'PUT' in allowed_methods or 'PATCH' in allowed_methods %}
|
{% if 'PUT' in allowed_methods or 'PATCH' in allowed_methods %}
|
||||||
<div class="well">
|
<div class="well">
|
||||||
|
|
Loading…
Reference in New Issue
Block a user