diff options
author | hardythe1 | 2013-11-27 16:08:58 +0530 |
---|---|---|
committer | hardythe1 | 2013-11-27 16:08:58 +0530 |
commit | fffd83ebcdef2853006af6aaf29771dea58b44b0 (patch) | |
tree | 6bcaf3782bd406ea7c22d6ebd7d59719f41e56a2 /website/views.py | |
parent | 903fe1d0e56b8fa76f1790d08ecfe8fe180c596b (diff) | |
download | SciPy2013-fffd83ebcdef2853006af6aaf29771dea58b44b0.tar.gz SciPy2013-fffd83ebcdef2853006af6aaf29771dea58b44b0.tar.bz2 SciPy2013-fffd83ebcdef2853006af6aaf29771dea58b44b0.zip |
changes for reviewers to comment on abstracts
Diffstat (limited to 'website/views.py')
-rw-r--r-- | website/views.py | 29 |
1 files changed, 25 insertions, 4 deletions
diff --git a/website/views.py b/website/views.py index 747f9d4..130556a 100644 --- a/website/views.py +++ b/website/views.py @@ -1,6 +1,7 @@ from django.http import HttpResponse, HttpResponseRedirect +from django.core.context_processors import csrf from django.shortcuts import render_to_response -from models import Paper +from models import * # Home section def home_page(request): @@ -47,12 +48,32 @@ def list_of_abstracts(request): return render_to_response('list_abstracts.html', context) def abstract_details(request, paper_id=None): + user = request.user + reviewers = ['jaidevd', 'prabhu', 'jarrod'] context = {} paper = Paper.objects.get(id=paper_id) + comments = Comment.objects.filter(paper=paper) + if(len(str(paper.attachments))<=0): + attachment = False + else: + attachment = True + if user.username in reviewers: + context['reviewer'] = True context['paper'] = paper - if(len(paper.abstract)<=0): - return HttpResponse(paper.abstract) - return render_to_response('abstract_details.html', context) + context['comments'] = comments + context['attachment'] = attachment + context['current_user'] = user + context.update(csrf(request)) + if request.method == 'POST': + user_comment = request.POST['comment'] + new_comment = Comment() + new_comment.paper = paper + new_comment.comment_by = user + new_comment.comment = user_comment.replace('\n', '<br>') + new_comment.save() + return HttpResponseRedirect('/2013/abstract-details/'+paper_id, context) + else: + return render_to_response('abstract_details.html', context) def accepted_abstracts_page(request): |