Render externalDocs when it's available
This commit is contained in:
@@ -21,7 +21,7 @@ class MainView extends Backbone.View
|
||||
else
|
||||
# Default validator
|
||||
@model.validatorUrl = "http://online.swagger.io/validator"
|
||||
|
||||
|
||||
render: ->
|
||||
if @model.securityDefinitions
|
||||
for name of @model.securityDefinitions
|
||||
@@ -61,10 +61,10 @@ class MainView extends Backbone.View
|
||||
# Render a resource and add it to resources li
|
||||
resource.id = resource.id.replace(/\s/g, '_')
|
||||
resourceView = new ResourceView({
|
||||
model: resource,
|
||||
tagName: 'li',
|
||||
id: 'resource_' + resource.id,
|
||||
className: 'resource',
|
||||
model: resource,
|
||||
tagName: 'li',
|
||||
id: 'resource_' + resource.id,
|
||||
className: 'resource',
|
||||
auths: auths,
|
||||
swaggerOptions: @options.swaggerOptions
|
||||
})
|
||||
|
||||
@@ -2,6 +2,11 @@
|
||||
{{#if info}}
|
||||
<div class="info_title">{{info.title}}</div>
|
||||
<div class="info_description markdown">{{{info.description}}}</div>
|
||||
{{#if externalDocs}}
|
||||
<h5>More documentations</h5>
|
||||
<p>{{externalDocs.description}}</p>
|
||||
<a href="{{externalDocs.url}}" target="_blank">{{externalDocs.url}}</a>
|
||||
{{/if}}
|
||||
{{#if info.termsOfServiceUrl}}<div class="info_tos"><a href="{{info.termsOfServiceUrl}}">Terms of service</a></div>{{/if}}
|
||||
{{#if info.contact.name}}<div class='info_name'>Created by {{info.contact.name}}</div>{{/if}}
|
||||
{{#if info.contact.url}}<div class='info_url'>See more at <a href="{{info.contact.url}}">{{info.contact.url}}</a></div>{{/if}}
|
||||
|
||||
Reference in New Issue
Block a user