re-merged #96
This commit is contained in:
@@ -4,11 +4,18 @@ class ResourceView extends Backbone.View
|
||||
render: ->
|
||||
$(@el).html(Handlebars.templates.resource(@model))
|
||||
|
||||
@number = 0
|
||||
|
||||
# Render each operation
|
||||
@addOperation operation for operation in @model.operationsArray
|
||||
@
|
||||
|
||||
addOperation: (operation) ->
|
||||
|
||||
operation.number = @number
|
||||
|
||||
# Render an operation and add it to operations li
|
||||
operationView = new OperationView({model: operation, tagName: 'li', className: 'endpoint'})
|
||||
$('.endpoints', $(@el)).append operationView.render().el
|
||||
|
||||
@number++
|
||||
@@ -1,32 +1,34 @@
|
||||
|
||||
<ul class='operations' >
|
||||
<li class='{{httpMethod}} operation' id='{{resourceName}}_{{nickname}}_{{httpMethod}}'>
|
||||
<li class='{{httpMethod}} operation' id='{{resourceName}}_{{nickname}}_{{httpMethod}}_{{number}}'>
|
||||
<div class='heading'>
|
||||
<h3>
|
||||
<span class='http_method'>
|
||||
<a href='#!/{{resourceName}}/{{nickname}}_{{httpMethod}}' class="toggleOperation">{{httpMethod}}</a>
|
||||
<a href='#!/{{resourceName}}/{{nickname}}_{{httpMethod}}_{{number}}' class="toggleOperation">{{httpMethod}}</a>
|
||||
</span>
|
||||
<span class='path'>
|
||||
<a href='#!/{{resourceName}}/{{nickname}}_{{httpMethod}}' class="toggleOperation">{{path}}</a>
|
||||
<a href='#!/{{resourceName}}/{{nickname}}_{{httpMethod}}_{{number}}' class="toggleOperation">{{path}}</a>
|
||||
</span>
|
||||
</h3>
|
||||
<ul class='options'>
|
||||
<li>
|
||||
<a href='#!/{{resourceName}}/{{nickname}}_{{httpMethod}}' class="toggleOperation">{{{summary}}}</a>
|
||||
<a href='#!/{{resourceName}}/{{nickname}}_{{httpMethod}}_{{number}}' class="toggleOperation">{{{summary}}}</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class='content' id='{{resourceName}}_{{nickname}}_{{httpMethod}}_content' style='display:none'>
|
||||
<div class='content' id='{{resourceName}}_{{nickname}}_{{httpMethod}}_{{number}}_content' style='display:none'>
|
||||
{{#if notes}}
|
||||
<h4>Implementation Notes</h4>
|
||||
<p>{{{notes}}}</p>
|
||||
{{/if}}
|
||||
{{#if responseClass}}
|
||||
<h4>Response Model</h4>
|
||||
<span class="model-signature"></span>
|
||||
<h4>Response Class</h4>
|
||||
{{#if responseClassSignature}}
|
||||
<p><span class="model-signature">{{{responseClassSignature}}}</span></p>
|
||||
{{else}}
|
||||
<p>{{{responseClass}}}</p>
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
<br/>
|
||||
<div class="content-type" />
|
||||
<form accept-charset='UTF-8' class='sandbox'>
|
||||
<div style='margin:0;padding:0;display:inline'></div>
|
||||
<h4>Parameters</h4>
|
||||
@@ -79,4 +81,4 @@
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</ul>
|
||||
Reference in New Issue
Block a user