summaryrefslogtreecommitdiff
path: root/scipy
diff options
context:
space:
mode:
Diffstat (limited to 'scipy')
-rw-r--r--scipy/templates/upload-document.html8
-rw-r--r--scipy/views.py4
2 files changed, 11 insertions, 1 deletions
diff --git a/scipy/templates/upload-document.html b/scipy/templates/upload-document.html
index 00ff130..8f8f1e8 100644
--- a/scipy/templates/upload-document.html
+++ b/scipy/templates/upload-document.html
@@ -1,4 +1,12 @@
{% extends 'page.html' %}
+
+{% block userblock %}
+{% if current_user != "anonymous" %}
+<li><a href="#"> {{ current_user }}</a></li>
+<li><a href="/2013/accounts/logout">Logout</a></li>
+{% endif %}
+{% endblock %}
+
{% block content %}
<div class="large-6 large-centered columns">
<form class="form-signin" action="/2013/accounts/upload-document/" method="POST" enctype="multipart/form-data"> {% csrf_token %}
diff --git a/scipy/views.py b/scipy/views.py
index 7a9cce1..25932ff 100644
--- a/scipy/views.py
+++ b/scipy/views.py
@@ -45,7 +45,7 @@ def user_login(request):
# User Logout View
def user_logout(request):
logout(request)
- return HttpResponseRedirect('/2013')
+ return HttpResponseRedirect('/')
# User Register View
def user_register(request):
@@ -89,6 +89,7 @@ def upload_document(request):
context = {}
context.update(csrf(request))
context['form'] = form
+ context['current_user'] = request.user
return render_to_response('upload-document.html', context)
else:
form = DocumentUploadForm()
@@ -96,6 +97,7 @@ def upload_document(request):
context = {}
context.update(csrf(request))
context['form'] = DocumentUploadForm()
+ context['current_user'] = request.user
return render_to_response('upload-document.html', context)
else:
return HttpResponseRedirect('/2013/accounts/login')