diff options
-rw-r--r-- | allotter/urls.py | 3 | ||||
-rw-r--r-- | allotter/views.py | 10 | ||||
-rw-r--r-- | template/allotter/apply.html | 7 |
3 files changed, 12 insertions, 8 deletions
diff --git a/allotter/urls.py b/allotter/urls.py index 53f7c40..55641ac 100644 --- a/allotter/urls.py +++ b/allotter/urls.py @@ -1,8 +1,9 @@ from django.conf.urls.defaults import patterns, url urlpatterns = patterns('allotter.views', - url(r'^$', 'hello'), + url(r'^$', 'apply'), url(r'^login/$', 'user_login'), + url(r'^logout/$', 'user_logout'), url(r'^register/$', 'user_register'), url(r'^apply/$', 'apply'), url(r'^quit/$', 'quit'), diff --git a/allotter/views.py b/allotter/views.py index 11137ed..cfd1868 100644 --- a/allotter/views.py +++ b/allotter/views.py @@ -63,13 +63,6 @@ def user_login(request): context_instance=RequestContext(request)) @login_required -def hello(request): - user = request.user - context = {'user': user} - ci = RequestContext(request) - return render_to_response('allotter/hello.html', context, - context_instance=ci) -@login_required def apply(request): user = request.user if not(user.is_authenticated()): @@ -90,3 +83,6 @@ def submit(request): def quit(request): pass +def user_logout(request): + logout(request) + return redirect ('/allotter/') diff --git a/template/allotter/apply.html b/template/allotter/apply.html index d9ce767..72c96c3 100644 --- a/template/allotter/apply.html +++ b/template/allotter/apply.html @@ -3,6 +3,12 @@ {% block title %}Application form {% endblock %} {% block content %} + +<h2>Hello, there</h2> + +<p> Welcome <strong>{{user.first_name.title}} {{user.last_name.title}}</strong>, +to JAM 2012 allotment! </p> + Choose the options as per your preference <h3> {{user.first_name}} {{user.last_name}} {{user.user_name}}</h3> @@ -24,4 +30,5 @@ Choose the options as per your preference <input type="submit" name="quit" value="Quit Allotment" /> </form> +<a href="{{URL_ROOT}}/allotter/logout/">Logout</a> {% endblock content %} |