diff options
author | Jayaram Pai | 2013-10-15 13:59:06 +0530 |
---|---|---|
committer | Jayaram Pai | 2013-10-15 13:59:06 +0530 |
commit | f422686e69b5f98ff7a3db12787aa7bed6849023 (patch) | |
tree | b434203bd46af5392abc79589e8dbd1b5f6f8236 | |
parent | 0241bbd60f416342c8d7a5ff41bc06dedb1148ff (diff) | |
download | SciPy2013-f422686e69b5f98ff7a3db12787aa7bed6849023.tar.gz SciPy2013-f422686e69b5f98ff7a3db12787aa7bed6849023.tar.bz2 SciPy2013-f422686e69b5f98ff7a3db12787aa7bed6849023.zip |
displaying logged in user.
logout link and redirect.
-rw-r--r-- | scipy/templates/upload-document.html | 8 | ||||
-rw-r--r-- | scipy/views.py | 4 | ||||
-rw-r--r-- | website/templates/page.html | 6 | ||||
-rw-r--r-- | website/templates/papers.html | 10 | ||||
-rw-r--r-- | website/views.py | 8 |
5 files changed, 33 insertions, 3 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') diff --git a/website/templates/page.html b/website/templates/page.html index d1f21c8..b19c9ea 100644 --- a/website/templates/page.html +++ b/website/templates/page.html @@ -58,13 +58,17 @@ </nav> </div> <!-- /header-inner --> </div> <!-- /header-wrapper --> - <div id="page-jumbo"> <div id="page-jumbo-inner" class="row"> <ul class="breadcrumbs left"> {% block breadcrumbs %} {% endblock %} </ul> + <ul class="breadcrumbs right"> + {% block userblock %} + {% endblock %} + </ul> + </div> <!-- /jumbo-inner --> </div> <!-- /jumbo --> diff --git a/website/templates/papers.html b/website/templates/papers.html index b1932f1..4bce2e5 100644 --- a/website/templates/papers.html +++ b/website/templates/papers.html @@ -1,5 +1,14 @@ {% 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="row"> {% if status == "up" %} <div data-alert class="alert-box success"> @@ -7,6 +16,7 @@ <a href="#" class="close">×</a> </div> {% endif %} + <h4>Call for Proposals</h4> <p align="justify"> We look forward to submissions for presentations at SciPy India 2013. Please submit an abstract of 400 to 700 words describing the topic, including its relevance to Python. Only submissions with an actual implementation will be considered for presentation (i.e. proposals to implement the code are not acceptable, partial implementations are acceptable so long as they demonstrate the features discussed). Please provide links to your code if this is an open source implementation. diff --git a/website/views.py b/website/views.py index 15534dd..c3f2918 100644 --- a/website/views.py +++ b/website/views.py @@ -21,8 +21,14 @@ def call_for_papers_page(request): if 'status' in request.GET: status = request.GET['status'] + if request.user.is_anonymous(): + current_user = "anonymous" + else: + current_user = request.user + context = { - 'status': status + 'status': status, + 'current_user': current_user } return render_to_response('papers.html', context) |