Skip to content

Commit

Permalink
Merge pull request #381 from mvdbos/master
Browse files Browse the repository at this point in the history
Only render sandbox config if  the sandbox is enabled
  • Loading branch information
willdurand committed May 15, 2014
2 parents 493963f + 86d9c31 commit a88e7d8
Showing 1 changed file with 23 additions and 21 deletions.
44 changes: 23 additions & 21 deletions Resources/views/layout.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -15,27 +15,29 @@
<body>
<div id="header">
<a href="{{ path('nelmio_api_doc_index') }}"><h1>{{ apiName }}</h1></a>
<div id="sandbox_configuration">
body format:
<select id="body_format">
<option value="x-www-form-urlencoded"{{ bodyFormat == 'form' ? ' selected' : '' }}>Form Data</option>
<option value="json"{{ bodyFormat == 'json' ? ' selected' : '' }}>JSON</option>
</select>
request format:
<select id="request_format">
<option value="json"{{ defaultRequestFormat == 'json' ? ' selected' : '' }}>JSON</option>
<option value="xml"{{ defaultRequestFormat == 'xml' ? ' selected' : '' }}>XML</option>
</select>
{% if authentication and authentication.delivery in ['query', 'http_basic', 'header'] %}
api key: <input type="text" id="api_key" value=""/>
{% endif %}
{% if authentication and authentication.delivery in ['http_basic'] %}
api pass: <input type="text" id="api_pass" value=""/>
{% endif %}
{% if authentication and authentication.custom_endpoint %}
api endpoint: <input type="text" id="api_endpoint" value=""/>
{% endif %}
</div>
{% if enableSandbox %}
<div id="sandbox_configuration">
body format:
<select id="body_format">
<option value="x-www-form-urlencoded"{{ bodyFormat == 'form' ? ' selected' : '' }}>Form Data</option>
<option value="json"{{ bodyFormat == 'json' ? ' selected' : '' }}>JSON</option>
</select>
request format:
<select id="request_format">
<option value="json"{{ defaultRequestFormat == 'json' ? ' selected' : '' }}>JSON</option>
<option value="xml"{{ defaultRequestFormat == 'xml' ? ' selected' : '' }}>XML</option>
</select>
{% if authentication and authentication.delivery in ['query', 'http_basic', 'header'] %}
api key: <input type="text" id="api_key" value=""/>
{% endif %}
{% if authentication and authentication.delivery in ['http_basic'] %}
api pass: <input type="text" id="api_pass" value=""/>
{% endif %}
{% if authentication and authentication.custom_endpoint %}
api endpoint: <input type="text" id="api_endpoint" value=""/>
{% endif %}
</div>
{% endif %}
<br style="clear: both;" />
</div>
{% include motdTemplate %}
Expand Down

0 comments on commit a88e7d8

Please sign in to comment.