浏览代码

added separate request and response templates

bubble
Tony Tam 11 年前
父节点
当前提交
7b9f8a2651
共有 4 个文件被更改,包括 48 次插入0 次删除
  1. +14
    -0
      src/main/coffeescript/view/ParameterContentTypeView.coffee
  2. +14
    -0
      src/main/coffeescript/view/ResponseContentTypeView.coffee
  3. +10
    -0
      src/main/template/parameter_content_type.handlebars
  4. +10
    -0
      src/main/template/response_content_type.handlebars

+ 14
- 0
src/main/coffeescript/view/ParameterContentTypeView.coffee 查看文件

@@ -0,0 +1,14 @@
class ParameterContentTypeView extends Backbone.View
initialize: ->

render: ->
template = @template()
$(@el).html(template(@model))

$('label[for=parameterContentType]', $(@el)).text('Parameter content type:')

@

template: ->
Handlebars.templates.parameter_content_type


+ 14
- 0
src/main/coffeescript/view/ResponseContentTypeView.coffee 查看文件

@@ -0,0 +1,14 @@
class ResponseContentTypeView extends Backbone.View
initialize: ->

render: ->
template = @template()

$(@el).html(template(@model))
$('label[for=responseContentType]', $(@el)).text('Response Content Type')

@

template: ->
Handlebars.templates.response_content_type

+ 10
- 0
src/main/template/parameter_content_type.handlebars 查看文件

@@ -0,0 +1,10 @@
<label for="parameterContentType"></label>
<select name="parameterContentType">
{{#if consumes}}
{{#each consumes}}
<option value="{{{this}}}">{{{this}}}</option>
{{/each}}
{{else}}
<option value="application/json">application/json</option>
{{/if}}
</select>

+ 10
- 0
src/main/template/response_content_type.handlebars 查看文件

@@ -0,0 +1,10 @@
<label for="responseContentType"></label>
<select name="responseContentType">
{{#if produces}}
{{#each produces}}
<option value="{{{this}}}">{{{this}}}</option>
{{/each}}
{{else}}
<option value="application/json">application/json</option>
{{/if}}
</select>

正在加载...
取消
保存