From ff437c9b006f0b1cf62f173f1c70e9ba2642e738 Mon Sep 17 00:00:00 2001 From: Roman Gotsiy Date: Sat, 10 Oct 2015 15:34:46 +0300 Subject: [PATCH] Added some styling --- demo/index.html | 1 + demo/main.css | 6 +++ lib/components/ApiInfo/api-info.html | 2 +- lib/components/Method/method.css | 44 ++++++++++++++++++++++ lib/components/Method/method.html | 15 ++++---- lib/components/Method/method.js | 3 +- lib/components/MethodsList/methods-list.js | 1 + 7 files changed, 63 insertions(+), 9 deletions(-) create mode 100644 demo/main.css create mode 100644 lib/components/Method/method.css diff --git a/demo/index.html b/demo/index.html index 3cd89bef..d24a8659 100644 --- a/demo/index.html +++ b/demo/index.html @@ -2,6 +2,7 @@ ReDoc prototype + diff --git a/demo/main.css b/demo/main.css new file mode 100644 index 00000000..bd7110a3 --- /dev/null +++ b/demo/main.css @@ -0,0 +1,6 @@ +body { + font-family: Verdana, Geneva, sans-serif; + font-size: 14px; + padding: 10px 20px; + color: #333; +} diff --git a/lib/components/ApiInfo/api-info.html b/lib/components/ApiInfo/api-info.html index 7c3e72ea..e596009e 100644 --- a/lib/components/ApiInfo/api-info.html +++ b/lib/components/ApiInfo/api-info.html @@ -2,7 +2,7 @@

{{data.description}}

- Contatct: + Contact: {{data.contact.name || data.contact.url}} diff --git a/lib/components/Method/method.css b/lib/components/Method/method.css new file mode 100644 index 00000000..32e768e2 --- /dev/null +++ b/lib/components/Method/method.css @@ -0,0 +1,44 @@ +h2 { + font-size: 32px; + font-weight: 200; +} + +h3 { + margin: 0; + font-weight: 200; +} + +h3 > span { + padding: 5px 10px; + vertical-align: middle; +} + +.http-method { + font-size: 13px; + color: white; + background-color: #1976D3; +} + +.http-method.delete { + background-color: red; +} + +.http-method.post { + background-color: green; +} + +.http-method.patch { + background-color: orange; +} + +.http-method.put { + background-color: crimson; +} + +.http-method.options { + background-color: black; +} + +.http-method.head { + background-color: darkkhaki; +} diff --git a/lib/components/Method/method.html b/lib/components/Method/method.html index ea00a532..79e42085 100644 --- a/lib/components/Method/method.html +++ b/lib/components/Method/method.html @@ -1,7 +1,8 @@ -

-

{{data.methodInfo.summary}}

-

{{data.method}} {{data.path}}

-

- {{data.methodInfo.description}} -

-
+

{{data.methodInfo.summary}}

+

+ {{data.method}} + {{data.path}} +

+

+ {{data.methodInfo.description}} +

diff --git a/lib/components/Method/method.js b/lib/components/Method/method.js index a2565db5..780a9b81 100644 --- a/lib/components/Method/method.js +++ b/lib/components/Method/method.js @@ -5,7 +5,8 @@ import {RedocComponent, BaseComponent} from '../base'; @RedocComponent({ selector: 'method', - templateUrl: './lib/components/Method/method.html' + templateUrl: './lib/components/Method/method.html', + styleUrls: ['./lib/components/Method/method.css'] }) export class Method extends BaseComponent { constructor(schemaMgr) { diff --git a/lib/components/MethodsList/methods-list.js b/lib/components/MethodsList/methods-list.js index e0e7c4f0..151058b1 100644 --- a/lib/components/MethodsList/methods-list.js +++ b/lib/components/MethodsList/methods-list.js @@ -20,5 +20,6 @@ export class MethodsList extends BaseComponent { let pathInfo = this.componentSchema; this.data.methods = Object.keys(pathInfo).filter((k) => swaggerMethods.has(k)); + // TODO: check $ref field } }