From b381d5b574194862203e9ddde9da79a374e5a334 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Lievremont Date: Fri, 2 May 2014 15:26:33 +0200 Subject: SONAR-5250 Modify layout, add WS path to action title --- .../collections/web-service-actions.coffee | 4 ++++ .../main/coffee/api-documentation/router.coffee | 2 +- .../api-documentation/api-documentation-action.hbs | 28 ++++++++++++---------- .../api-documentation-actions.hbs | 6 +++-- sonar-server/src/main/less/api-documentation.less | 20 ++++++++++------ 5 files changed, 37 insertions(+), 23 deletions(-) (limited to 'sonar-server/src/main') 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 @@ - +

{{#if post}}POST{{else}}GET{{/if}} - /{{key}}{{#if params}}?{{#each params}}{{#if required}}{{key}}={{exampleValue}}&{{/if}}{{/each}}{{/if}} - -Since {{since}} + {{path}} +

+ + {{#if since}}Since {{since}}{{#if internal}} -{{/if}}{{/if}} + {{#if internal}}For internal use only{{/if}} +

{{description}}

-{{#if internal}}

For internal use only

{{/if}} {{#if params}} - - - - - - - +

Parameters

+
KeyDescription
{{#each params}} + {{/each}}
{{key}}
{{#if required}}required{{else}}optional{{/if}}
-
{{description}} +

{{description}}

+ {{#if exampleValue}} + Example value: {{exampleValue}} + {{/if}} +
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 @@ -

{{path}}

-

{{description}}

+ +

{{description}}

\ 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; + } + } } } } -- cgit v1.2.3