summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPrimal Pappachan2012-03-09 10:56:51 +0530
committerPrimal Pappachan2012-03-09 10:56:51 +0530
commita8a644acdd7775da36cd109701a6a7235b851dd2 (patch)
tree06add862b518c0c2add9375a7bf8d9cfd1729e53
parente95e8154391b1d1f60bff72e18ab935d66eaaa17 (diff)
parent83a237759bf184c1907efe56b8bf27a630112923 (diff)
downloadaloha-a8a644acdd7775da36cd109701a6a7235b851dd2.tar.gz
aloha-a8a644acdd7775da36cd109701a6a7235b851dd2.tar.bz2
aloha-a8a644acdd7775da36cd109701a6a7235b851dd2.zip
added 2 urls
-rw-r--r--allotter/urls.py3
-rw-r--r--allotter/views.py10
-rw-r--r--template/allotter/apply.html7
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 %}