From c7ac3bee7af5f072ac09eaab55e61926b0419153 Mon Sep 17 00:00:00 2001 From: Valentin Samir Date: Mon, 20 Jun 2016 13:31:59 +0200 Subject: [PATCH] Add a h1 to default templates and a logo --- README.rst | 3 + cas_server/default_settings.py | 3 + cas_server/static/cas_server/login.css | 7 ++ cas_server/static/cas_server/logo.png | Bin 0 -> 11818 bytes cas_server/static/cas_server/logo.svg | 114 ++++++++++++++++++++++ cas_server/templates/cas_server/base.html | 9 ++ cas_server/utils.py | 5 + cas_server/views.py | 14 ++- 8 files changed, 150 insertions(+), 5 deletions(-) create mode 100644 cas_server/static/cas_server/logo.png create mode 100644 cas_server/static/cas_server/logo.svg diff --git a/README.rst b/README.rst index 8d037af..78eaae1 100644 --- a/README.rst +++ b/README.rst @@ -104,6 +104,9 @@ All settings are optional. Add them to ``settings.py`` to customize ``django-cas Template settings: +* ``CAS_LOGO_URL``: Url to the logo showed in the up left corner on the default + templates. Set it to ``False`` to disable it. + * ``CAS_LOGIN_TEMPLATE``: Path to the template showed on ``/login`` then the user is not autenticated. The default is ``"cas_server/login.html"``. * ``CAS_WARN_TEMPLATE``: Path to the template showed on ``/login?service=...`` then diff --git a/cas_server/default_settings.py b/cas_server/default_settings.py index 139569d..9ad6f53 100644 --- a/cas_server/default_settings.py +++ b/cas_server/default_settings.py @@ -10,6 +10,7 @@ # (c) 2015 Valentin Samir """Default values for the app's settings""" from django.conf import settings +from django.contrib.staticfiles.templatetags.staticfiles import static def setting_default(name, default_value): @@ -17,6 +18,8 @@ def setting_default(name, default_value): value = getattr(settings, name, default_value) setattr(settings, name, value) +setting_default('CAS_LOGO_URL', static("cas_server/logo.png")) + setting_default('CAS_LOGIN_TEMPLATE', 'cas_server/login.html') setting_default('CAS_WARN_TEMPLATE', 'cas_server/warn.html') setting_default('CAS_LOGGED_TEMPLATE', 'cas_server/logged.html') diff --git a/cas_server/static/cas_server/login.css b/cas_server/static/cas_server/login.css index 865312a..cd81500 100644 --- a/cas_server/static/cas_server/login.css +++ b/cas_server/static/cas_server/login.css @@ -40,3 +40,10 @@ body { border-top-right-radius: 0; } +#app-name { + text-align: center; +} +#app-name img { + width:110px; +} + diff --git a/cas_server/static/cas_server/logo.png b/cas_server/static/cas_server/logo.png new file mode 100644 index 0000000000000000000000000000000000000000..0bbae0292b6ee285319e037168a6747bacf4dd0a GIT binary patch literal 11818 zcmWk!1ymbL6b)8NaV_rd?i33W+=_dE;O-PD?i6<@!HX4lD+P)-P^37exVx3`^K;J2 zWV5>?Z{FN@@0^L#(on*FL;eN;0APcZfjWqC8DSBxUm?Da3ef%{3REvSklt&==fi88 zSj07kyRwlN0DwmLzabe*jB6tPB=c4<^wxE=^Y*jyv<3M2`EfhAI(dPu+-pYEdT_R)$=bnDGc~PvD11NIwMdz)!j3aTqs2sR3L@-+62R7NkzVd2~SSY(=-1z zI_oWW?}?Jz#QM5iK5~{bYi~)0Fb^K|GqXSE0BtuS%&te?I`=r;x2#O9XgEE2mQDZMiWOz!n z>^Z>4AK{~7do;uHMU0>p-eaP=rlw1I0L_R=G9&2vQ-L@$;%P==E>IdBZM8ip4GRgR zpqgg$`lmCNQM28Ys8Lonfi_!MBQRr}^a|-5`JP~a+9=DSrnXj6%z1WA8-H=2ehDwB3q`=zNUG1y9ADDZJT=4HL&GwI!@Y+GSErB zoK6OI8*lnxp`bAQ6s$?Q(|hJFy1+kjsxRu(Ke`>D@)PN$$tT2xwNMhq?+`dQ3=p6BZ+&unCmWk__K(1N}N{8HNgc!cr zBx$!{T3IFF-;aIscrRBb`tEOR`Ri?rAmcX!7@Pd`P5i=^{iV?u13L7^#=5%Am9@3b z>Hz@{qcCCLH`4)Kvu+5VKKq#<2AxX#ni%Mvi}Qd6*r0=AQsKmOx3=D}Ra z#~C13AZ(7^#|4C(x{JCtR8=ii`Ih`4cey#7*HvSl^WE2Ng0H^b9BOK6O66G5DQvHLr%PKy;}bm;`Pwzl9&yQ_Y{Kjg-jXG~J?%aOPEOPlp@yk0q`hOS`c zoLH(C{M|Kni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>&~qvVF5X8G&SGG0WY*)Y2;`ONI_d^bt^NJ@f$>E@TC z%<9A~7C=kp0qD{V8|7A83qF*Lo_&(i&S^|49KV3s*y-2%E??RF+ki@J`fhv*C|Wx4 sC(ik{T9)*Z?@M`im~v|@LBb2}^EvS=cW2)?#JO$&NI?TwFJ~G4A26N<(*OVf literal 0 HcmV?d00001 diff --git a/cas_server/static/cas_server/logo.svg b/cas_server/static/cas_server/logo.svg new file mode 100644 index 0000000..b9c3cdd --- /dev/null +++ b/cas_server/static/cas_server/logo.svg @@ -0,0 +1,114 @@ + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + CAS + + diff --git a/cas_server/templates/cas_server/base.html b/cas_server/templates/cas_server/base.html index 9a51014..cb3a93e 100644 --- a/cas_server/templates/cas_server/base.html +++ b/cas_server/templates/cas_server/base.html @@ -12,6 +12,15 @@ {% block bootstrap3_content %}
+
+
+
+

+ {% if settings.CAS_LOGO_URL %} {% endif %} + {% trans "Central Authentication Service" %}

+
+
+
diff --git a/cas_server/utils.py b/cas_server/utils.py index c3b2c32..fdb8f46 100644 --- a/cas_server/utils.py +++ b/cas_server/utils.py @@ -28,6 +28,11 @@ except ImportError: from urllib.parse import urlparse, urlunparse, parse_qsl, urlencode +def context(params): + params["settings"] = settings + return params + + def JsonResponse(request, data): data["messages"] = [] for msg in messages.get_messages(request): diff --git a/cas_server/views.py b/cas_server/views.py index 4e27ead..e431499 100644 --- a/cas_server/views.py +++ b/cas_server/views.py @@ -164,7 +164,7 @@ class LogoutView(View, LogoutMixin): return render( request, settings.CAS_LOGOUT_TEMPLATE, - {'logout_msg': logout_msg} + utils.context({'logout_msg': logout_msg}) ) @@ -348,7 +348,7 @@ class LoginView(View, LogoutMixin): return render( self.request, settings.CAS_WARN_TEMPLATE, - {'form': warn_form} + utils.context({'form': warn_form}) ) else: # redirect, using method ? @@ -402,7 +402,7 @@ class LoginView(View, LogoutMixin): return render( self.request, settings.CAS_LOGGED_TEMPLATE, - {'session': self.request.session} + utils.context({'session': self.request.session}) ) else: data = {"status": "error", "detail": "auth", "code": error} @@ -443,7 +443,7 @@ class LoginView(View, LogoutMixin): return render( self.request, settings.CAS_LOGGED_TEMPLATE, - {'session': self.request.session} + utils.context({'session': self.request.session}) ) def not_authenticated(self): @@ -483,7 +483,11 @@ class LoginView(View, LogoutMixin): } return JsonResponse(self.request, data) else: - return render(self.request, settings.CAS_LOGIN_TEMPLATE, {'form': self.form}) + return render( + self.request, + settings.CAS_LOGIN_TEMPLATE, + utils.context({'form': self.form}) + ) def common(self): """Part execute uppon GET and POST request"""