From d911e811139711c2176891131bb3961a33343f65 Mon Sep 17 00:00:00 2001 From: Emmanouil Konstantinidis Date: Mon, 27 Feb 2017 15:54:32 +0000 Subject: [PATCH] Default to session authentication if logged in --- rest_framework/static/rest_framework/docs/css/base.css | 3 ++- rest_framework/templates/rest_framework/docs/index.html | 9 +++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/rest_framework/static/rest_framework/docs/css/base.css b/rest_framework/static/rest_framework/docs/css/base.css index c1acaadc7..a63ab4719 100644 --- a/rest_framework/static/rest_framework/docs/css/base.css +++ b/rest_framework/static/rest_framework/docs/css/base.css @@ -273,8 +273,9 @@ body { } .api-modal .modal-body .request-awaiting { - text-align: center; padding: 35px 10px; + color: #7F8177; + text-align: center; } .api-modal .modal-body .meta { diff --git a/rest_framework/templates/rest_framework/docs/index.html b/rest_framework/templates/rest_framework/docs/index.html index 8b58aad64..7da04e424 100644 --- a/rest_framework/templates/rest_framework/docs/index.html +++ b/rest_framework/templates/rest_framework/docs/index.html @@ -76,6 +76,15 @@ const schema = {{ schema }} const doc = codec.decode(schema) + {% if user.is_authenticated %} + window.auth = { + 'type': 'session', + }; + $('#selected-authentication').text('session'); + $('#auth-control').children().removeClass('active'); + $('#auth-control').find("[data-auth='session']").addClass('active'); + {% endif %} + // Language Control $('#language-control li').click(function (event) { event.preventDefault();