comparator: 'key'
initialize: (models, options) ->
- _.each models, (model) ->
- model.path = options.path + '/' + model.key
+ _.each models, (model) ->
+ model.path = options.path + '/' + model.key
class WebServiceActionResponse extends Backbone.Model
- url: ->
+ url: ->
"#{baseUrl}/api/webservices/response_example?controller=#{@get('controller')}&action=#{@get('action')}"
fetchExampleResponse: (event) ->
exampleResponse = new WebServiceActionResponse
- controller: @model.get('path').substring(0, @model.get('path').length - @model.get('key').length - 1)
- action: @model.get('key')
+ controller: @model.get('path').substring(0, @model.get('path').length - @model.get('key').length - 1)
+ action: @model.get('key')
@listenTo(exampleResponse, 'change', @appendExampleView)
exampleResponse.fetch()
<h3 class="big">
- {{#if post}}POST{{else}}GET{{/if}}
- {{path}}
+ {{#if post}}POST{{else}}GET{{/if}}
+ {{path}}
</h3>
<span class="subtitle">
- {{#if since}}Since {{since}}{{#if internal}} -{{/if}}{{/if}}
- {{#if internal}}<span class="internal">For internal use only</span>{{/if}}
+ {{#if since}}Since {{since}}{{#if internal}} -{{/if}}{{/if}}
+ {{#if internal}}<span class="internal">For internal use only</span>{{/if}}
</span>
<p>{{{description}}}</p>
{{#if params}}
<table>
{{#each params}}
<tr>
- <td style="width:10em">
- <code>{{key}}</code>
- <div class="subtitle">{{#if required}}required{{else}}optional{{/if}}</div>
- </td<>
- <td>
- <p>{{{description}}}</p>
- {{#if possibleValues}}
- <p>
- <em>Possible values:</em>
- <ul class="possible-values">
- {{#each possibleValues}}
- <li><code>{{this}}</code></li>
- {{/each}}
- </ul>
- </p>
- {{/if}}
- {{#if exampleValue}}
- <p>
- <em>Example value:</em> <code>{{exampleValue}}</code>
- </p>
- {{/if}}
- </td>
+ <td style="width:10em">
+ <code>{{key}}</code>
+ <div class="subtitle">{{#if required}}required{{else}}optional{{/if}}</div>
+ </td<>
+ <td>
+ <p>{{{description}}}</p>
+ {{#if possibleValues}}
+ <p>
+ <em>Possible values:</em>
+ <ul class="possible-values">
+ {{#each possibleValues}}
+ <li><code>{{this}}</code></li>
+ {{/each}}
+ </ul>
+ </p>
+ {{/if}}
+ {{#if exampleValue}}
+ <p>
+ <em>Example value:</em> <code>{{exampleValue}}</code>
+ </p>
+ {{/if}}
+ </td>
</tr>
{{/each}}
</table>
<div class="navigator-header">
- <h1 class="navigator-header-title">{{path}}</h1>
+ <h1 class="navigator-header-title">{{path}}</h1>
</div>
<p>{{description}}</p>
<div class="api-documentation-actions-list"></div>
\ No newline at end of file
<div class="navigator-content">
<div class="navigator-side">
<div class="navigator-actions">
- <h1 class="navigator-header-title">API Documentation</h1>
+ <h1 class="navigator-header-title">API Documentation</h1>
</div>
<div class="api-documentation-show-internals subtitle">
- <label for="api-documentation-show-internals">Show internal services</label>
- <input type="checkbox" id="api-documentation-show-internals"/>
+ <label for="api-documentation-show-internals">Show internal services</label>
+ <input type="checkbox" id="api-documentation-show-internals"/>
</div>
<div class="navigator-results api-documentation-nav"></div>
</div>
<div class="line line-small">
- <h1>{{path}}</h1>
- <span class="subtitle">{{{description}}}</span>
- {{#if internal}}<span class="subtitle internal">internal</span>{{/if}}
+ <h1>{{path}}</h1>
+ <span class="subtitle">{{{description}}}</span>
+ {{#if internal}}<span class="subtitle internal">internal</span>{{/if}}
</div>
margin-top: 10px;
margin-left: 5px;
- .api-documentation-action {
- margin-top: 30px;
+ .api-documentation-action {
+ margin-top: 30px;
- & > p, & > h3 {
- margin-top: 5px;
- }
+ & > p, & > h3 {
+ margin-top: 5px;
+ }
- table {
- width: 100%;
+ table {
+ width: 100%;
- tr {
- border-top: 1px solid @navigatorBorderLightColor;
+ tr {
+ border-top: 1px solid @navigatorBorderLightColor;
- td {
- padding: 10px 0;
- margin: 5px;
- vertical-align: top;
+ td {
+ padding: 10px 0;
+ margin: 5px;
+ vertical-align: top;
ul {
li {
}
}
- ul.possible-values {
- display: inline;
+ ul.possible-values {
+ display: inline;
- li {
- display: inline;
+ li {
+ display: inline;
margin: 0;
- &:before {
- content: ', '
- }
+ &:before {
+ content: ', '
+ }
- &:first-child:before {
- content: ''
- }
- }
- }
- }
- }
- }
+ &:first-child:before {
+ content: ''
+ }
+ }
+ }
+ }
+ }
+ }
- .example-response {
- text-decoration: underline;
- }
+ .example-response {
+ text-decoration: underline;
+ }
.example-response-content {
margin: 10px 0;
white-space: pre-wrap;
}
}
- }
+ }
}