diff --git a/cof/settings_dev.py b/cof/settings_dev.py index 717e36a0..86513843 100644 --- a/cof/settings_dev.py +++ b/cof/settings_dev.py @@ -83,6 +83,7 @@ TEMPLATES = [ 'django.core.context_processors.media', 'django.core.context_processors.static', 'gestioncof.shared.context_processor', + 'kfet.context_processors.auth', ], }, }, diff --git a/kfet/backends.py b/kfet/backends.py index 6ba9063a..4eea72b5 100644 --- a/kfet/backends.py +++ b/kfet/backends.py @@ -6,7 +6,8 @@ from kfet.models import Account, GenericTeamToken class KFetBackend(object): def authenticate(self, request): - password = request.META.get('HTTP_KFETPASSWORD') + password = request.POST.get('KFETPASSWORD', '') + password = request.META.get('HTTP_KFETPASSWORD', password) if not password: return None diff --git a/kfet/context_processors.py b/kfet/context_processors.py new file mode 100644 index 00000000..1bd8052c --- /dev/null +++ b/kfet/context_processors.py @@ -0,0 +1,9 @@ +from django.contrib.auth.context_processors import PermWrapper + +def auth(request): + if hasattr(request, 'real_user'): + return { + 'user': request.real_user, + 'perms': PermWrapper(request.real_user), + } + return {} diff --git a/kfet/middleware.py b/kfet/middleware.py index 13c01293..c6faf6c5 100644 --- a/kfet/middleware.py +++ b/kfet/middleware.py @@ -5,4 +5,5 @@ class KFetAuthenticationMiddleware(object): kfet_backend = KFetBackend() temp_request_user = kfet_backend.authenticate(request) if temp_request_user: + request.real_user = request.user request.user = temp_request_user diff --git a/kfet/static/kfet/css/nav.css b/kfet/static/kfet/css/nav.css index d89384b4..701f31e2 100644 --- a/kfet/static/kfet/css/nav.css +++ b/kfet/static/kfet/css/nav.css @@ -4,6 +4,11 @@ nav { font-family:Oswald; } +.navbar-nav > li > .dropdown-menu { + border:0; + border-radius:0; +} + .navbar-fixed-top { border:0; } diff --git a/kfet/static/kfet/js/kfet.js b/kfet/static/kfet/js/kfet.js new file mode 100644 index 00000000..f9a4b040 --- /dev/null +++ b/kfet/static/kfet/js/kfet.js @@ -0,0 +1,12 @@ +$(document).ready(function() { + $(window).scroll(function() { + console.log($(this).scrollTop()); + if ($(window).width() >= 768 && $(this).scrollTop() > 72.6) { + $('.col-content-left').css({'position':'fixed', 'top':'50px'}); + $('.col-content-right').addClass('col-sm-offset-4 col-md-offset-3'); + } else { + $('.col-content-left').css({'position':'relative', 'top':'0'}); + $('.col-content-right').removeClass('col-sm-offset-4 col-md-offset-3'); + } + }); +}); diff --git a/kfet/templates/kfet/account_read.html b/kfet/templates/kfet/account_read.html index df2fd0ce..8cf405a2 100644 --- a/kfet/templates/kfet/account_read.html +++ b/kfet/templates/kfet/account_read.html @@ -22,49 +22,7 @@
Informations mises à jour
-{% elif post and not success %} -Echec de la mise à jour des informations
-{% endif %} - +