Commit e4b0273f by Tom Christie

Merge pull request #3063 from jpadilla/url-format-override

Document setting URL_FORMAT_OVERRIDE to None
parents 5e15edde 83ef64db
...@@ -273,6 +273,8 @@ Default: `'accept'` ...@@ -273,6 +273,8 @@ Default: `'accept'`
The name of a URL parameter that may be used to override the default `Accept` header based content negotiation. The name of a URL parameter that may be used to override the default `Accept` header based content negotiation.
If the value of this setting is `None` then URL format overloading will be disabled.
Default: `'format'` Default: `'format'`
--- ---
......
...@@ -72,8 +72,9 @@ ...@@ -72,8 +72,9 @@
{% if 'GET' in allowed_methods %} {% if 'GET' in allowed_methods %}
<form id="get-form" class="pull-right"> <form id="get-form" class="pull-right">
<fieldset> <fieldset>
{% if api_settings.URL_FORMAT_OVERRIDE %}
<div class="btn-group format-selection"> <div class="btn-group format-selection">
<a class="btn btn-primary js-tooltip" href='{{ request.get_full_path }}' rel="nofollow" title="Make a GET request on the {{ name }} resource">GET</a> <a class="btn btn-primary js-tooltip" href="{{ request.get_full_path }}" rel="nofollow" title="Make a GET request on the {{ name }} resource">GET</a>
<button class="btn btn-primary dropdown-toggle js-tooltip" data-toggle="dropdown" title="Specify a format for the GET request"> <button class="btn btn-primary dropdown-toggle js-tooltip" data-toggle="dropdown" title="Specify a format for the GET request">
<span class="caret"></span> <span class="caret"></span>
...@@ -81,11 +82,14 @@ ...@@ -81,11 +82,14 @@
<ul class="dropdown-menu"> <ul class="dropdown-menu">
{% for format in available_formats %} {% for format in available_formats %}
<li> <li>
<a class="js-tooltip format-option" href='{% add_query_param request api_settings.URL_FORMAT_OVERRIDE format %}' rel="nofollow" title="Make a GET request on the {{ name }} resource with the format set to `{{ format }}`">{{ format }}</a> <a class="js-tooltip format-option" href="{% add_query_param request api_settings.URL_FORMAT_OVERRIDE format %}" rel="nofollow" title="Make a GET request on the {{ name }} resource with the format set to `{{ format }}`">{{ format }}</a>
</li> </li>
{% endfor %} {% endfor %}
</ul> </ul>
</div> </div>
{% else %}
<a class="btn btn-primary js-tooltip" href="{{ request.get_full_path }}" rel="nofollow" title="Make a GET request on the {{ name }} resource">GET</a>
{% endif %}
</fieldset> </fieldset>
</form> </form>
{% 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