diff options
| author | Michael Elovskikh | 2013-02-15 18:25:36 +0600 | 
|---|---|---|
| committer | Michael Elovskikh | 2013-02-15 18:25:36 +0600 | 
| commit | 533e47235210d735dbe68d96fb55460eca19be9b (patch) | |
| tree | 7415155ce08536bdb0dcf6f86f2449af290f2669 /rest_framework | |
| parent | 3195f72784a2d55d10f3d7a58acdfee694e89e4b (diff) | |
| download | django-rest-framework-533e47235210d735dbe68d96fb55460eca19be9b.tar.bz2 | |
Added tabs between object form and generic content form on POST form
Diffstat (limited to 'rest_framework')
| -rw-r--r-- | rest_framework/templates/rest_framework/base.html | 44 | 
1 files changed, 34 insertions, 10 deletions
diff --git a/rest_framework/templates/rest_framework/base.html b/rest_framework/templates/rest_framework/base.html index fb541e94..9d47a2ed 100644 --- a/rest_framework/templates/rest_framework/base.html +++ b/rest_framework/templates/rest_framework/base.html @@ -125,16 +125,40 @@                  {% if post_form %}                  <div class="well"> -                    {% with form=post_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 %} +                    <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 %} +                                <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> +                        {% 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 %}  | 
