added resource description

This commit is contained in:
Tony Tam
2013-09-09 08:15:59 -07:00
parent bc93240199
commit cd4fa99cc4
4 changed files with 20 additions and 4 deletions

19
dist/swagger-ui.js vendored
View File

@@ -1033,8 +1033,13 @@ function program4(depth0,data) {
templates['resource'] = template(function (Handlebars,depth0,helpers,partials,data) {
this.compilerInfo = [4,'>= 1.0.0'];
helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
var buffer = "", stack1, functionType="function", escapeExpression=this.escapeExpression;
var buffer = "", stack1, options, functionType="function", escapeExpression=this.escapeExpression, self=this, blockHelperMissing=helpers.blockHelperMissing;
function program1(depth0,data) {
return " : ";
}
buffer += "<div class='heading'>\n <h2>\n <a href='#!/";
if (stack1 = helpers.name) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
@@ -1048,7 +1053,16 @@ helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
if (stack1 = helpers.name) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
else { stack1 = depth0.name; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
buffer += escapeExpression(stack1)
+ "</a>\n </h2>\n <ul class='options'>\n <li>\n <a href='#!/";
+ "</a> ";
options = {hash:{},inverse:self.noop,fn:self.program(1, program1, data),data:data};
if (stack1 = helpers.description) { stack1 = stack1.call(depth0, options); }
else { stack1 = depth0.description; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
if (!helpers.description) { stack1 = blockHelperMissing.call(depth0, stack1, options); }
if(stack1 || stack1 === 0) { buffer += stack1; }
if (stack1 = helpers.description) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
else { stack1 = depth0.description; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
if(stack1 || stack1 === 0) { buffer += stack1; }
buffer += "\n </h2>\n <ul class='options'>\n <li>\n <a href='#!/";
if (stack1 = helpers.name) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
else { stack1 = depth0.name; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
buffer += escapeExpression(stack1)
@@ -1421,6 +1435,7 @@ helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
ResourceView.prototype.render = function() {
var operation, _i, _len, _ref;
console.log(this.model.description);
$(this.el).html(Handlebars.templates.resource(this.model));
this.number = 0;
_ref = this.model.operationsArray;

File diff suppressed because one or more lines are too long

View File

@@ -2,6 +2,7 @@ class ResourceView extends Backbone.View
initialize: ->
render: ->
console.log @model.description
$(@el).html(Handlebars.templates.resource(@model))
@number = 0

View File

@@ -1,6 +1,6 @@
<div class='heading'>
<h2>
<a href='#!/{{name}}' onclick="Docs.toggleEndpointListForResource('{{name}}');">{{name}}</a>
<a href='#!/{{name}}' onclick="Docs.toggleEndpointListForResource('{{name}}');">{{name}}</a> {{#description}} : {{/description}}{{{description}}}
</h2>
<ul class='options'>
<li>