Skip to content

Commit

Permalink
fix for #606, renamed resource to in the template
Browse files Browse the repository at this point in the history
  • Loading branch information
fehguy committed Sep 23, 2014
1 parent 2eabeb6 commit af6eed4
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
13 changes: 8 additions & 5 deletions dist/swagger-ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -1087,12 +1087,12 @@ function program1(depth0,data) {
buffer += escapeExpression(stack1)
+ "</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 = helpers.summary) { stack1 = stack1.call(depth0, options); }
else { stack1 = depth0.summary; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
if (!helpers.summary) { 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 = helpers.summary) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
else { stack1 = depth0.summary; 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.id) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
Expand Down Expand Up @@ -1539,6 +1539,9 @@ helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
var counter, id, methods, operation, _i, _len, _ref4;
$(this.el).html(Handlebars.templates.resource(this.model));
methods = {};
if (this.model.description) {
this.model.summary = this.model.description;
}
_ref4 = this.model.operationsArray;
for (_i = 0, _len = _ref4.length; _i < _len; _i++) {
operation = _ref4[_i];
Expand Down
2 changes: 1 addition & 1 deletion dist/swagger-ui.min.js

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions src/main/coffeescript/view/ResourceView.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ class ResourceView extends Backbone.View

methods = {}

if @model.description
@model.summary = @model.description
# Render each operation
for operation in @model.operationsArray
counter = 0
Expand Down
2 changes: 1 addition & 1 deletion src/main/template/resource.handlebars
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div class='heading'>
<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>
<ul class='options'>
<li>
Expand Down

0 comments on commit af6eed4

Please sign in to comment.