fix for #606, renamed resource to in the template

This commit is contained in:
Tony Tam
2014-09-23 10:00:03 -07:00
parent 2eabeb667a
commit af6eed4eb4
4 changed files with 12 additions and 7 deletions

13
dist/swagger-ui.js vendored
View File

@@ -1087,12 +1087,12 @@ function program1(depth0,data) {
buffer += escapeExpression(stack1) buffer += escapeExpression(stack1)
+ "</a> "; + "</a> ";
options = {hash:{},inverse:self.noop,fn:self.program(1, program1, data),data:data}; options = {hash:{},inverse:self.noop,fn:self.program(1, program1, data),data:data};
if (stack1 = helpers.description) { stack1 = stack1.call(depth0, options); } if (stack1 = helpers.summary) { stack1 = stack1.call(depth0, options); }
else { stack1 = depth0.description; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; } else { stack1 = depth0.summary; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
if (!helpers.description) { stack1 = blockHelperMissing.call(depth0, stack1, options); } if (!helpers.summary) { stack1 = blockHelperMissing.call(depth0, stack1, options); }
if(stack1 || stack1 === 0) { buffer += stack1; } if(stack1 || stack1 === 0) { buffer += stack1; }
if (stack1 = helpers.description) { stack1 = stack1.call(depth0, {hash:{},data:data}); } if (stack1 = helpers.summary) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
else { stack1 = depth0.description; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; } else { stack1 = depth0.summary; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
if(stack1 || stack1 === 0) { buffer += stack1; } if(stack1 || stack1 === 0) { buffer += stack1; }
buffer += "\n </h2>\n <ul class='options'>\n <li>\n <a href='#!/"; buffer += "\n </h2>\n <ul class='options'>\n <li>\n <a href='#!/";
if (stack1 = helpers.id) { stack1 = stack1.call(depth0, {hash:{},data:data}); } if (stack1 = helpers.id) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
@@ -1539,6 +1539,9 @@ helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
var counter, id, methods, operation, _i, _len, _ref4; var counter, id, methods, operation, _i, _len, _ref4;
$(this.el).html(Handlebars.templates.resource(this.model)); $(this.el).html(Handlebars.templates.resource(this.model));
methods = {}; methods = {};
if (this.model.description) {
this.model.summary = this.model.description;
}
_ref4 = this.model.operationsArray; _ref4 = this.model.operationsArray;
for (_i = 0, _len = _ref4.length; _i < _len; _i++) { for (_i = 0, _len = _ref4.length; _i < _len; _i++) {
operation = _ref4[_i]; operation = _ref4[_i];

File diff suppressed because one or more lines are too long

View File

@@ -8,6 +8,8 @@ class ResourceView extends Backbone.View
methods = {} methods = {}
if @model.description
@model.summary = @model.description
# Render each operation # Render each operation
for operation in @model.operationsArray for operation in @model.operationsArray
counter = 0 counter = 0

View File

@@ -1,6 +1,6 @@
<div class='heading'> <div class='heading'>
<h2> <h2>
<a href='#!/{{id}}' class="toggleEndpointList" data-id="{{id}}">{{name}}</a> {{#description}} : {{/description}}{{{description}}} <a href='#!/{{id}}' class="toggleEndpointList" data-id="{{id}}">{{name}}</a> {{#summary}} : {{/summary}}{{{summary}}}
</h2> </h2>
<ul class='options'> <ul class='options'>
<li> <li>