Sie sind nicht angemeldet! Bitte einloggen!
{% endif %} ++ {% endblock %}
diff --git a/fahrschule_vale981/urls.py b/fahrschule_vale981/urls.py index 40895e6..6f349e3 100644 --- a/fahrschule_vale981/urls.py +++ b/fahrschule_vale981/urls.py @@ -7,6 +7,7 @@ urlpatterns = patterns('', # Examples: (r'^quiz/', include('fs_quiz.urls')), # url(r'^blog/', include('blog.urls')), + (r'^/', 'fahrschule_vale981.views.login'), (r'^login/', 'fahrschule_vale981.views.login'), (r'^logout/', 'fahrschule_vale981.views.logout_view'), (r'^auth/', 'fahrschule_vale981.views.auth_view'), diff --git a/fahrschule_vale981/views.py b/fahrschule_vale981/views.py index dc983c9..27854aa 100644 --- a/fahrschule_vale981/views.py +++ b/fahrschule_vale981/views.py @@ -3,6 +3,11 @@ from django.http import HttpResponseRedirect from django.contrib import auth from django.core.context_processors import csrf from django.contrib.auth import logout +from django.contrib.auth.models import User +from django.contrib.auth.models import UserManager +from userprofile.models import UserQuizRel +from fs_quiz.models import Quiz + def login(request): c = {} @@ -10,11 +15,21 @@ def login(request): return render_to_response('login.html', c) def auth_view(request): - username = request.POST.get('username', '') - password = request.POST.get('password', '') + + firstname = request.POST.get('firstname', '') + lastname = request.POST.get('lastname', '') + password = 'standart' + username = firstname + lastname + User.objects.create_user(username=firstname+lastname, password='standart', first_name=firstname, last_name=lastname) + user = auth.authenticate(username=username, password=password) + if user is not None: auth.login(request, user) + uqr = UserQuizRel(user=request.user) + uqr.save() + uqr.allowed_quiz = Quiz.objects.all() + uqr.save() return HttpResponseRedirect('/quiz/all/') else: return HttpResponseRedirect('/fehler/') diff --git a/fs_quiz/views.py b/fs_quiz/views.py index 83b16be..f649d2b 100644 --- a/fs_quiz/views.py +++ b/fs_quiz/views.py @@ -92,7 +92,7 @@ def check_view(request): def auswertung_index(request): return render_to_response('auswertung.html', {'user': request.user, - 'users': User.objects.filter(groups__name = 'Schüler')}) + 'users': User.objects.all()}) def ausw_user(request, user_id=1): user = User.objects.get(id=user_id) diff --git a/static/css/quizz.css b/static/css/quizz.css index 5101ec6..c750cd7 100644 --- a/static/css/quizz.css +++ b/static/css/quizz.css @@ -8,37 +8,40 @@ max-height: 100%; } #framecontent{ -position: absolute; +position: relative; top: 0; bottom: 0; left: 0; -width: 150px; /*Width of frame div*/ -height: 100%; +width: 100%; /*Width of frame div*/ +height: 30px; overflow: hidden; /*Disable scrollbars. Set to "scroll" to enable*/ background: #0404AF; color: white; } #maincontent{ -position: fixed; +position: relative; top: 0; -left: 150px; /*Set left value to WidthOfFrameDiv*/ +overflow: hidden; + /*Set left value to WidthOfFrameDiv*/ right: 0; bottom: 0; -overflow: auto; background: #fff; } .innertube{ margin: 15px; /*Margins for inner DIV inside each DIV (to provide padding)*/ + } -.men_div:hover{ - - background-color: dodgerblue; +.men_div{ + display: inline; + position: relative; + top:3px } + * html body{ /*IE6 hack*/ padding: 0 0 0 200px; /*Set value to (0 0 0 WidthOfFrameDiv)*/ } @@ -50,9 +53,10 @@ width: 100%; #men{ font-family: Arial, sans-serif; - font-size: 24px; + font-size: 20px; color: lightgrey; margin-left: 15px; + text-align: left; } #men:link {color:white; text-decoration:none;} /* unvisited link */ #men:visited {color: #ffffff;} /* visited link */ @@ -62,6 +66,7 @@ width: 100%; color: dodgerblue; text-decoration: none; font-size: 20px; + text-align: center; } h1{ font-family: Arial, sans-serif; @@ -291,4 +296,9 @@ background-image: linear-gradient(top, #ebf3fc, #dce9f9); position:relative; top:1px; } -/* This button was generated using CSSButtonGenerator.com */ +.login{ + width: 300px; + height: 30px; + font-size: 20px; + text-align: center; +} diff --git a/templates/login.html b/templates/login.html index 9519bed..1fba59f 100644 --- a/templates/login.html +++ b/templates/login.html @@ -3,12 +3,14 @@ {% if form.errors %}
Benutzernahme oder Passwort falsch!
{% endif %} +