Skip to content

Commit

Permalink
dynamic-html: refactor parameters view
Browse files Browse the repository at this point in the history
  • Loading branch information
ponelat committed May 15, 2015
1 parent 0248d6f commit 3bc319d
Show file tree
Hide file tree
Showing 6 changed files with 257 additions and 148 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -151,15 +151,31 @@
padding-top: 20px;
}

.param {
li.parameter {
list-style: none;
display: block;
float: left;
width: 220px;
clear: left;
padding-left: 1em;
}

.param{
display: block;
}

.param-name {
margin-left: 1em;
}

.param-in {
font-weight: bold;
font-size: 1.1em;
}
.param-type {
margin-left: 1em;
font-style: italic;
}

.param-description {
float: left;
display: block;
font-family: 'Helvetica Neue', Arial, 'Liberation Sans', FreeSans, sans-serif;
}

Expand Down Expand Up @@ -289,4 +305,4 @@

.top-bar ul#nav:hover li {
border-color: #222222;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,36 +17,19 @@
<h3 class="section">Parameters</h3>
<ul>
{{#allParams}}
<div class="parameter">
{{#isContainer}}
{{#complexType}}
<!-- container / complex -->
{{/complexType}}
{{#simpleType}}
<!-- container / simple -->
<div class="param">{{paramName}}&nbsp;:&nbsp;{{dataType}}&nbsp;({{type}})</div>
<span>{{#optional}}optional{{/optional}}</span>
</div>
{{/simpleType}}
{{/isContainer}}
{{#isNotContainer}}
{{#simpleType}}
<!-- not container / simple -->
<div class="param">{{paramName}}&nbsp;:&nbsp;{{dataType}}&nbsp;({{type}})</div>
<span>{{#optional}}optional{{/optional}}</span>
</div>
{{/simpleType}}
{{/isNotContainer}}

{{#foo}}
<div class="param">{{paramName}}&nbsp;:&nbsp;{{#complexType}}&nbsp;<div class="model" id="{{complexType}}"><a href="#">{{dataType}}</a>{{/complexType}}{{#simpleType}}{{dataType}}{{/simpleType}}&nbsp;({{type}})</div>
<span>{{#optional}}optional{{/optional}}</span>
</div>
{{/foo}}
<p class="param-description">{{description}}</p>
</div>
<li class="parameter">
{{#isFormParam}}<span class="param-in">Form: </span>{{/isFormParam}}
{{#isQueryParam}}<span class="param-in">Query: </span>{{/isQueryParam}}
{{#isPathParam}}<span class="param-in">Path: </span>{{/isPathParam}}
{{#isHeaderParam}}<span class="param-in">Header: </span>{{/isHeaderParam}}
{{#isBodyParam}}<span class="param-in">Body: </span>{{/isBodyParam}}
<span class="param-name">{{paramName}}</span>
<span class="param-type">{{dataType}}{{#baseType}}({{baseType}}){{/baseType}}</span>
{{#optional}}<span class="param-optional-flag">(optional)</span>{{/optional}}
<p class="param-description">{{description}}</p>
</li>
{{/allParams}}
</ul>
{{/operation}}
{{/operations}}
</div>
</div>
28 changes: 22 additions & 6 deletions samples/dynamic-html/docs/assets/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -151,15 +151,31 @@
padding-top: 20px;
}

.param {
li.parameter {
list-style: none;
display: block;
float: left;
width: 220px;
clear: left;
padding-left: 1em;
}

.param{
display: block;
}

.param-name {
margin-left: 1em;
}

.param-in {
font-weight: bold;
font-size: 1.1em;
}
.param-type {
margin-left: 1em;
font-style: italic;
}

.param-description {
float: left;
display: block;
font-family: 'Helvetica Neue', Arial, 'Liberation Sans', FreeSans, sans-serif;
}

Expand Down Expand Up @@ -289,4 +305,4 @@

.top-bar ul#nav:hover li {
border-color: #222222;
}
}
158 changes: 105 additions & 53 deletions samples/dynamic-html/docs/operations/PetApi.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,17 @@ <h3 class="section">Response Type</h3>
<h3 class="section">Parameters</h3>
<ul>

<div class="parameter">
<li class="parameter">




<p class="param-description">Pet object that needs to be added to the store</p>
</div>

<span class="param-in">Body: </span>
<span class="param-name">body</span>
<span class="param-type">Pet</span>

<p class="param-description">Pet object that needs to be added to the store</p>
</li>

</ul>

Expand All @@ -40,13 +44,17 @@ <h3 class="section">Response Type</h3>
<h3 class="section">Parameters</h3>
<ul>

<div class="parameter">
<li class="parameter">





<p class="param-description">Pet object that needs to be added to the store</p>
</div>
<span class="param-in">Body: </span>
<span class="param-name">body</span>
<span class="param-type">Pet</span>

<p class="param-description">Pet object that needs to be added to the store</p>
</li>

</ul>

Expand All @@ -63,13 +71,17 @@ <h3 class="section">Response Type</h3>
<h3 class="section">Parameters</h3>
<ul>

<div class="parameter">
<li class="parameter">

<span class="param-in">Query: </span>




<p class="param-description">Status values that need to be considered for filter</p>
</div>
<span class="param-name">status</span>
<span class="param-type">List(String)</span>

<p class="param-description">Status values that need to be considered for filter</p>
</li>

</ul>

Expand All @@ -86,13 +98,17 @@ <h3 class="section">Response Type</h3>
<h3 class="section">Parameters</h3>
<ul>

<div class="parameter">
<li class="parameter">

<span class="param-in">Query: </span>



<p class="param-description">Tags to filter by</p>
</div>

<span class="param-name">tags</span>
<span class="param-type">List(String)</span>

<p class="param-description">Tags to filter by</p>
</li>

</ul>

Expand All @@ -109,13 +125,17 @@ <h3 class="section">Response Type</h3>
<h3 class="section">Parameters</h3>
<ul>

<div class="parameter">
<li class="parameter">



<span class="param-in">Path: </span>


<span class="param-name">petId</span>
<span class="param-type">Long</span>

<p class="param-description">ID of pet that needs to be fetched</p>
</div>
<p class="param-description">ID of pet that needs to be fetched</p>
</li>

</ul>

Expand All @@ -132,29 +152,41 @@ <h3 class="section">Response Type</h3>
<h3 class="section">Parameters</h3>
<ul>

<div class="parameter">
<li class="parameter">



<span class="param-in">Path: </span>


<span class="param-name">petId</span>
<span class="param-type">String</span>

<p class="param-description">ID of pet that needs to be updated</p>
</div>
<p class="param-description">ID of pet that needs to be updated</p>
</li>

<div class="parameter">
<li class="parameter">
<span class="param-in">Form: </span>





<p class="param-description">Updated name of the pet</p>
</div>
<span class="param-name">name</span>
<span class="param-type">String</span>

<p class="param-description">Updated name of the pet</p>
</li>

<div class="parameter">
<li class="parameter">
<span class="param-in">Form: </span>





<p class="param-description">Updated status of the pet</p>
</div>
<span class="param-name">status</span>
<span class="param-type">String</span>

<p class="param-description">Updated status of the pet</p>
</li>

</ul>

Expand All @@ -171,21 +203,29 @@ <h3 class="section">Response Type</h3>
<h3 class="section">Parameters</h3>
<ul>

<div class="parameter">
<li class="parameter">




<p class="param-description"></p>
</div>
<span class="param-in">Header: </span>

<span class="param-name">api_key</span>
<span class="param-type">String</span>

<p class="param-description"></p>
</li>

<div class="parameter">
<li class="parameter">



<span class="param-in">Path: </span>


<span class="param-name">petId</span>
<span class="param-type">Long</span>

<p class="param-description">Pet id to delete</p>
</div>
<p class="param-description">Pet id to delete</p>
</li>

</ul>

Expand All @@ -202,31 +242,43 @@ <h3 class="section">Response Type</h3>
<h3 class="section">Parameters</h3>
<ul>

<div class="parameter">
<li class="parameter">



<span class="param-in">Path: </span>


<span class="param-name">petId</span>
<span class="param-type">Long</span>

<p class="param-description">ID of pet to update</p>
</div>
<p class="param-description">ID of pet to update</p>
</li>

<div class="parameter">
<li class="parameter">
<span class="param-in">Form: </span>





<p class="param-description">Additional data to pass to server</p>
</div>
<span class="param-name">additionalMetadata</span>
<span class="param-type">String</span>

<p class="param-description">Additional data to pass to server</p>
</li>

<div class="parameter">
<li class="parameter">
<span class="param-in">Form: </span>




<p class="param-description">file to upload</p>
</div>

<span class="param-name">file</span>
<span class="param-type">file</span>

<p class="param-description">file to upload</p>
</li>

</ul>


</div>
</div>
Loading

0 comments on commit 3bc319d

Please sign in to comment.