From 64d584fb46839a5655a339a7e98f242467d8b222 Mon Sep 17 00:00:00 2001 From: Graham Hayes Date: Thu, 19 May 2016 15:18:31 +0100 Subject: [PATCH] Colour Code HTTP Methods Most API Docs seem to colour code the HTTP methods to make for easier reading. This sets: GET / HEAD - Blue POST - Green PATCH/PUT - Yellow DELETE - Red By reuseing some of the bootstrap label-* css. Change-Id: Ic58edeb672ced1e66849c561133f272982abcb4e --- os_api_ref/__init__.py | 2 +- os_api_ref/assets/api-site.css | 37 +++++++++++++++++++++++++++++++++- 2 files changed, 37 insertions(+), 2 deletions(-) diff --git a/os_api_ref/__init__.py b/os_api_ref/__init__.py index f651ff6..8cc2273 100644 --- a/os_api_ref/__init__.py +++ b/os_api_ref/__init__.py @@ -407,7 +407,7 @@ def rest_method_html(self, node):
- %(method)s + %(method)s
%(url)s
%(desc)s
diff --git a/os_api_ref/assets/api-site.css b/os_api_ref/assets/api-site.css index d491df0..da7e714 100644 --- a/os_api_ref/assets/api-site.css +++ b/os_api_ref/assets/api-site.css @@ -82,4 +82,39 @@ a.operation-anchor { .versionmodified { font-weight: bold; -} \ No newline at end of file +} + +.label-POST { + background-color: #5cb85c; +} +.label-POST[href]:hover, +.label-POST[href]:focus { + background-color: #449d44; +} +.label-GET, +.label-HEAD { + background-color: #5bc0de; +} +.label-GET[href]:hover, +.label-GET[href]:focus, +.label-HEAD[href]:hover, +.label-HEAD[href]:focus { + background-color: #31b0d5; +} +.label-PUT, +.label-PATCH { + background-color: #f0ad4e; +} +.label-PUT[href]:hover, +.label-PUT[href]:focus, +.label-PATCH[href]:hover, +.label-PATCH[href]:focus { + background-color: #ec971f; +} +.label-DELETE { + background-color: #d9534f; +} +.label-DELETE[href]:hover, +.label-DELETE[href]:focus { + background-color: #c9302c; +}