From a61ac4b0fb931154e73f8e0125026af7fc8169a4 Mon Sep 17 00:00:00 2001 From: Athou Date: Fri, 19 Apr 2013 16:52:16 +0200 Subject: [PATCH] swagger ui styling --- src/main/webapp/api/css/custom.css | 21 +++++++++++++++++++++ src/main/webapp/api/index.html | 1 + src/main/webapp/api/lib/swagger.js | 26 ++++++++++++++------------ 3 files changed, 36 insertions(+), 12 deletions(-) create mode 100644 src/main/webapp/api/css/custom.css diff --git a/src/main/webapp/api/css/custom.css b/src/main/webapp/api/css/custom.css new file mode 100644 index 00000000..615f4698 --- /dev/null +++ b/src/main/webapp/api/css/custom.css @@ -0,0 +1,21 @@ +.signature-container .description span { + margin-left: 5px; +} + +.signature-container .description .model-desc { + font-weight: bold; + color: #000; + font-size: 1.1em; +} + +.signature-container .description .class-desc { + font-weight: bold; + color: #000; + font-size: 1.0em; + margin-left: 0px; +} + +.signature-container .description ul { + margin-left: 20px; + list-style: disc; +} \ No newline at end of file diff --git a/src/main/webapp/api/index.html b/src/main/webapp/api/index.html index 8959896b..acbbcc60 100644 --- a/src/main/webapp/api/index.html +++ b/src/main/webapp/api/index.html @@ -5,6 +5,7 @@ + diff --git a/src/main/webapp/api/lib/swagger.js b/src/main/webapp/api/lib/swagger.js index b1f3abff..59065c93 100644 --- a/src/main/webapp/api/lib/swagger.js +++ b/src/main/webapp/api/lib/swagger.js @@ -332,15 +332,15 @@ prop = _ref[_i]; propertiesStr.push(prop.toString()); } - strong = ''; - stronger = ''; - strongClose = ''; - classOpen = strong + 'class ' + this.name + '(' + strongClose; - classClose = strong + ')' + strongClose; - returnVal = classOpen + '' + propertiesStr.join(', ') + '' + classClose; - if (prefix != null) { - returnVal = stronger + prefix + strongClose + '
' + returnVal; - } + strong = '
'; + stronger = '
'; + strongClose = '
'; + classOpen = strong + 'class ' + this.name + strongClose; + classClose = ''; + returnVal = classOpen + '
  • ' + propertiesStr.join('
  • ') + '
' + classClose; +// if (prefix != null) { +// returnVal = stronger + prefix + strongClose + returnVal; +// } if (!modelsToIgnore) { modelsToIgnore = []; } @@ -415,12 +415,14 @@ SwaggerModelProperty.prototype.toString = function() { var str; - str = this.name + ': ' + this.dataTypeWithRef; + str = this.name; if (this.values != null) { - str += " = ['" + this.values.join("' or '") + "']"; + str += " ('" + this.values.join("' or '") + "')"; + } else { + str += ' (' + this.dataTypeWithRef + ')'; } if (this.descr != null) { - str += ' {' + this.descr + '}'; + str += ' - ' + this.descr; } return str; };