aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Baptiste Lievremont <jean-baptiste.lievremont@sonarsource.com>2014-05-02 15:26:33 +0200
committerJean-Baptiste Lievremont <jean-baptiste.lievremont@sonarsource.com>2014-05-02 15:26:39 +0200
commitb381d5b574194862203e9ddde9da79a374e5a334 (patch)
tree1142b234ff0b86d6fe0beed99c4bae23fd287126
parent13d7c8d2c4f3b5de9c423ba802fde9ac843e23d8 (diff)
downloadsonarqube-b381d5b574194862203e9ddde9da79a374e5a334.tar.gz
sonarqube-b381d5b574194862203e9ddde9da79a374e5a334.zip
SONAR-5250 Modify layout, add WS path to action title
-rw-r--r--sonar-server/src/main/coffee/api-documentation/collections/web-service-actions.coffee4
-rw-r--r--sonar-server/src/main/coffee/api-documentation/router.coffee2
-rw-r--r--sonar-server/src/main/hbs/api-documentation/api-documentation-action.hbs28
-rw-r--r--sonar-server/src/main/hbs/api-documentation/api-documentation-actions.hbs6
-rw-r--r--sonar-server/src/main/less/api-documentation.less20
5 files changed, 37 insertions, 23 deletions
diff --git a/sonar-server/src/main/coffee/api-documentation/collections/web-service-actions.coffee b/sonar-server/src/main/coffee/api-documentation/collections/web-service-actions.coffee
index 378c5aa2b5b..48ce69b9bbe 100644
--- a/sonar-server/src/main/coffee/api-documentation/collections/web-service-actions.coffee
+++ b/sonar-server/src/main/coffee/api-documentation/collections/web-service-actions.coffee
@@ -9,3 +9,7 @@ define [
class WebServiceActions extends Backbone.Collection
model: WebServiceAction
comparator: 'key'
+
+ initialize: (models, options) ->
+ _.each models, (model) ->
+ model.path = options.path + '/' + model.key
diff --git a/sonar-server/src/main/coffee/api-documentation/router.coffee b/sonar-server/src/main/coffee/api-documentation/router.coffee
index 007f425e329..14a0cfc8b98 100644
--- a/sonar-server/src/main/coffee/api-documentation/router.coffee
+++ b/sonar-server/src/main/coffee/api-documentation/router.coffee
@@ -23,7 +23,7 @@ define [
if webService
@app.apiDocumentationListView.highlight path
- actions = new WebServiceActions webService.get('actions')
+ actions = new WebServiceActions webService.get('actions'), path: path
actionsListView = new ApiDocumentationActionsListView
app: @app
collection: actions
diff --git a/sonar-server/src/main/hbs/api-documentation/api-documentation-action.hbs b/sonar-server/src/main/hbs/api-documentation/api-documentation-action.hbs
index e427a94d28d..2527d4cb5b7 100644
--- a/sonar-server/src/main/hbs/api-documentation/api-documentation-action.hbs
+++ b/sonar-server/src/main/hbs/api-documentation/api-documentation-action.hbs
@@ -1,25 +1,27 @@
-<code>
+<h3 class="big">
{{#if post}}POST{{else}}GET{{/if}}
- /{{key}}{{#if params}}?{{#each params}}{{#if required}}{{key}}={{exampleValue}}&amp;{{/if}}{{/each}}{{/if}}
-</code>
-<span class="subtitle">Since {{since}}</span>
+ {{path}}
+</h3>
+<span class="subtitle">
+ {{#if since}}Since {{since}}{{#if internal}} -{{/if}}{{/if}}
+ {{#if internal}}For internal use only{{/if}}
+</span>
<p>{{description}}</p>
-{{#if internal}}<p class="subtitle">For internal use only</p>{{/if}}
{{#if params}}
-<table class="data">
- <thead>
- <tr>
- <th>Key</th>
- <th>Description</th>
- </tr>
- </thead>
+<h3>Parameters</h3>
+<table>
{{#each params}}
<tr>
<td style="width:10em">
<code>{{key}}</code>
<div class="subtitle">{{#if required}}required{{else}}optional{{/if}}</div>
</td<>
- <td>{{description}}</td>
+ <td>
+ <p>{{description}}</p>
+ {{#if exampleValue}}
+ <em>Example value:</em> <code>{{exampleValue}}</code>
+ {{/if}}
+ </td>
</tr>
{{/each}}
</table>
diff --git a/sonar-server/src/main/hbs/api-documentation/api-documentation-actions.hbs b/sonar-server/src/main/hbs/api-documentation/api-documentation-actions.hbs
index 2fd36705c60..1c118d098df 100644
--- a/sonar-server/src/main/hbs/api-documentation/api-documentation-actions.hbs
+++ b/sonar-server/src/main/hbs/api-documentation/api-documentation-actions.hbs
@@ -1,3 +1,5 @@
-<h1>{{path}}</h1>
-<h2>{{description}}</h2>
+<div class="navigator-header">
+ <h1 class="navigator-header-title">{{path}}</h1>
+</div>
+<p>{{description}}</p>
<div class="api-documentation-actions-list"></div> \ No newline at end of file
diff --git a/sonar-server/src/main/less/api-documentation.less b/sonar-server/src/main/less/api-documentation.less
index c9663ddfade..e5552245e38 100644
--- a/sonar-server/src/main/less/api-documentation.less
+++ b/sonar-server/src/main/less/api-documentation.less
@@ -76,15 +76,21 @@
.api-documentation-action {
margin-top: 30px;
- & > code {
- display: block;
- padding: 10px 5px;
- border: 1px solid @navigatorBorderLightColor;
- background: @navigatorBarBackground
+ & > p, & > h3 {
+ margin-top: 5px;
}
- & > p {
- margin-top: 5px;
+ table {
+ width: 100%;
+
+ tr {
+ border-top: 1px solid @navigatorBorderLightColor;
+
+ td {
+ padding: 10px 0;
+ margin: 5px;
+ }
+ }
}
}
}