From bac13619995768f5dcb6eb05f4920cc01972a35c Mon Sep 17 00:00:00 2001 From: Emmanouil Konstantinidis Date: Mon, 27 Feb 2017 16:46:45 +0000 Subject: [PATCH] Basic Authentication & Favicon --- rest_framework/schemas.py | 4 +- .../static/rest_framework/docs/css/base.css | 34 +++++++++------- .../rest_framework/docs/img/favicon.ico | Bin 1150 -> 5430 bytes .../rest_framework/docs/auth/basic.html | 38 ++++++++++++++++++ .../templates/rest_framework/docs/index.html | 28 +++++++++++++ .../rest_framework/docs/sidebar.html | 11 ++--- 6 files changed, 93 insertions(+), 22 deletions(-) create mode 100644 rest_framework/templates/rest_framework/docs/auth/basic.html diff --git a/rest_framework/schemas.py b/rest_framework/schemas.py index 1b3df23af..844bcc5da 100644 --- a/rest_framework/schemas.py +++ b/rest_framework/schemas.py @@ -57,13 +57,13 @@ def field_to_schema(field): return coreschema.String(title=title, description=description) elif isinstance(field, serializers.MultipleChoiceField): return coreschema.Array( - items=coreschema.Enum(enum=list(field.choices.values())), + items=coreschema.Enum(enum=list(field.choices.keys())), title=title, description=description ) elif isinstance(field, serializers.ChoiceField): return coreschema.Enum( - enum=list(field.choices.values()), + enum=list(field.choices.keys()), title=title, description=description ) diff --git a/rest_framework/static/rest_framework/docs/css/base.css b/rest_framework/static/rest_framework/docs/css/base.css index a63ab4719..aa9550287 100644 --- a/rest_framework/static/rest_framework/docs/css/base.css +++ b/rest_framework/static/rest_framework/docs/css/base.css @@ -30,30 +30,28 @@ margin-bottom: 0; } +.sidebar .brand a { + color: #FFF; +} + +.sidebar .brand a:hover, +.sidebar .brand a:active, +.sidebar .brand a:focus { + text-decoration: none; +} + .sidebar .toggle-btn { display: none; } .sidebar .menu-list ul, .sidebar .menu-list li { + background: #2e353d; list-style: none; padding: 0px; margin: 0px; line-height: 35px; cursor: pointer; - /* - .collapsed{ - .arrow:before{ - font-family: FontAwesome; - content: "\f053"; - display: inline-block; - padding-left:10px; - padding-right: 10px; - vertical-align: middle; - float:right; - } - } -*/ } .sidebar .menu-list ul :not(collapsed) .arrow:before, @@ -97,8 +95,14 @@ background-color: #020203; } -.sidebar .menu-list ul .sub-menu li:before, -.sidebar .menu-list li .sub-menu li:before { + +.sidebar .menu-list ul .sub-menu li a, +.sidebar .menu-list li .sub-menu li a { + display: block; +} + +.sidebar .menu-list ul .sub-menu li a:before, +.sidebar .menu-list li .sub-menu li a:before { font-family: FontAwesome; content: "\f105"; display: inline-block; diff --git a/rest_framework/static/rest_framework/docs/img/favicon.ico b/rest_framework/static/rest_framework/docs/img/favicon.ico index e85006a3ce1c6fd81faa6d5a13095519c4a6fc96..17b2c5d983c9b13b29af3fa0f30bc0c6dc1ae44c 100644 GIT binary patch literal 5430 zcmeHK+fBnj5L_b)NC%i7L>b{Tq7gda6KH@s=z@SX*1r( z%x>(<>0;K|g>5#5tG9m?rU#!s^?;(86k(5=-l>lN%BcKy?g z$nRl8h3#F}c`5ypTuDt#pS%$Lo)*r=7*TUE{jesMcdf97+Qd_GG5wGq%df4!&WQPZ z{rUTduD@XZ)cX5C%^l3qb=1c7r+t_7eF;o4-)DN*7RG(%dEA>22(Bf+)4A7r_w?F# zgQfK1R?DBlL*GXjf4ff;wRX@t1bWn+3%%ElGcVkm-{}zaA7k`Ok9p$4c~Zze%&X71 zqSobn<}$z wPoFpZ+Oywy{-xfD7@oiGD`q&JyTSE2c&;nKZ|Bd_b#t!!TmRv(W`6bh1hJ*gHvj+t literal 1150 zcmd6lF-yZh9L1kl>(HSEK`2y^4yB6->f+$wD)=oNY!UheIt03Q=;qj=;8*Bap_4*& za8yAl;wmmx5Yyi^7dXN-WYdJ-{qNqpcez|5t#Fr0qTSYcPTG`I2PBk8r$~4kg^0zN zCJe(rhix3do!L$bZ+IuZ{i08x=JR3=e+M4pv0KsKA??{u_*EFfo|`p&t`Vf=jn{)F z1fKk9hWsmYwqWAP^JO*5u*R;*L&dX3H$%S7oB$f0{ISh{QVXuncnzN67WQH2`lip7 zhX+VI$6x$1+$8gMjh4+1l0N#8_0Fh=N#EwpKk{SeE!)SHFB@xQFX3y+8sF#_@!bDW eIdI-IC`$c%>bk?KbPeN9RHtL<1^)v~#xMt8oB^@` diff --git a/rest_framework/templates/rest_framework/docs/auth/basic.html b/rest_framework/templates/rest_framework/docs/auth/basic.html new file mode 100644 index 000000000..16fc67244 --- /dev/null +++ b/rest_framework/templates/rest_framework/docs/auth/basic.html @@ -0,0 +1,38 @@ +{% load rest_framework %} + + + diff --git a/rest_framework/templates/rest_framework/docs/index.html b/rest_framework/templates/rest_framework/docs/index.html index 7da04e424..ecd340a29 100644 --- a/rest_framework/templates/rest_framework/docs/index.html +++ b/rest_framework/templates/rest_framework/docs/index.html @@ -13,6 +13,9 @@ + + +