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 | |
parent | 903fe1d0e56b8fa76f1790d08ecfe8fe180c596b (diff) | |
download | SciPy2013-fffd83ebcdef2853006af6aaf29771dea58b44b0.tar.gz SciPy2013-fffd83ebcdef2853006af6aaf29771dea58b44b0.tar.bz2 SciPy2013-fffd83ebcdef2853006af6aaf29771dea58b44b0.zip |
changes for reviewers to comment on abstracts
-rw-r--r-- | scipy/forms.py | 20 | ||||
-rw-r--r-- | website/admin.py | 6 | ||||
-rw-r--r-- | website/models.py | 6 | ||||
-rw-r--r-- | website/static/css/main.css | 6 | ||||
-rw-r--r-- | website/templates/abstract_details.html | 30 | ||||
-rw-r--r-- | website/templates/invited_speakers.html | 8 | ||||
-rw-r--r-- | website/templates/list_abstracts.html | 1 | ||||
-rw-r--r-- | website/views.py | 29 |
8 files changed, 78 insertions, 28 deletions
diff --git a/scipy/forms.py b/scipy/forms.py index 2c13850..b3c60f6 100644 --- a/scipy/forms.py +++ b/scipy/forms.py @@ -56,23 +56,3 @@ class DocumentUploadForm(forms.ModelForm): elif content_size > 5242880: raise forms.ValidationError('File size exceeds 5MB') return attachments - - - - - - - - - - - - - - - - - - - - diff --git a/website/admin.py b/website/admin.py index 8f02a21..1f2fa58 100644 --- a/website/admin.py +++ b/website/admin.py @@ -1,9 +1,13 @@ from django.contrib import admin -from website.models import Paper +from website.models import Paper, Comment class PaperAdmin(admin.ModelAdmin): list_display = ('user', 'verified') +class CommentAdmin(admin.ModelAdmin): + list_display = ('comment', 'comment_by') + admin.site.register(Paper, PaperAdmin) +admin.site.register(Comment, CommentAdmin) diff --git a/website/models.py b/website/models.py index 158c073..9784776 100644 --- a/website/models.py +++ b/website/models.py @@ -17,3 +17,9 @@ class Paper(models.Model): links = models.CharField(max_length=128) attachments = models.FileField(upload_to=get_document_dir) verified = models.NullBooleanField() + +class Comment(models.Model): + paper = models.ForeignKey(Paper) + comment_by = models.ForeignKey(User) + comment = models.CharField(max_length=500) + diff --git a/website/static/css/main.css b/website/static/css/main.css index 88812e6..356245f 100644 --- a/website/static/css/main.css +++ b/website/static/css/main.css @@ -208,3 +208,9 @@ padding: 10px; text-align: justify; } +.comment { + margin: 0 0 15px 0; + padding: 10px 10px; + background: #f5f5f5; + border-left: 2px solid #86c543; +} diff --git a/website/templates/abstract_details.html b/website/templates/abstract_details.html index 3abf02e..07f5f75 100644 --- a/website/templates/abstract_details.html +++ b/website/templates/abstract_details.html @@ -6,17 +6,43 @@ <li><a href="{% url 'website:list-abstracts'%}">List of Abstracts</a></li> {% endblock %} +{% 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 %} -<center><h4>{{ paper.title }}</h4></center> +<center><h4><u>{{ paper.title }}</u></h4></center> <p><strong>{{ paper.user.first_name }} {{ paper.user.last_name }}</strong></p> <p><strong>{{ paper.bio }}</strong></p> +<hr> <p><strong>Abstract: </strong></p> <div id="abstract"> <p>{{ paper.abstract }}</p> </div> <p>Affiliation: <strong>{{ paper.affiliation }}</strong></p> <p>Links: {{ paper.links }}</p> -<p><a href="/downloads/{{ paper.attachments }}">Attachment</a></p> +{% if attachment%} +<p><a class="button tiny success" href="/downloads/{{ paper.attachments }}">View Attachment</a></p> +{% endif %} +<hr> +{% if reviewer %} + <h5>Comments</h5> + {% for comment in comments %} + <div class="comment"> + <strong>{{ comment.comment_by.first_name }} {{ comment.comment_by.last_name }}</strong> + <p>{{ comment.comment|safe }}</p> + </div> + {% endfor %} + <form action="/abstract-details/{{ paper.id }}/" method='POST' enctype="multipart/form-data"> + {% csrf_token %} + <textarea rows="5" cols="100" name="comment"></textarea> + <input class="button tiny success" type=submit value="Comment"> + </form> +{% endif %} {% endblock %} diff --git a/website/templates/invited_speakers.html b/website/templates/invited_speakers.html index d9b56bf..fc5f773 100644 --- a/website/templates/invited_speakers.html +++ b/website/templates/invited_speakers.html @@ -1,5 +1,11 @@ {% extends 'page.html'%} {% load static %} + +{% block breadcrumbs %} +<li><a href="{% url 'website:invited-speakers'%}">Invited Speakers</a></li> +<li><a href="{% url 'website:list-abstracts'%}">List of Abstracts</a></li> +{% endblock %} + {% block content %} <div class="row"> <h4>Invited Speakers</h4> @@ -29,4 +35,4 @@ </div> <!-- /speaker --> </div> <!-- /row --> -{% endblock %}
\ No newline at end of file +{% endblock %} diff --git a/website/templates/list_abstracts.html b/website/templates/list_abstracts.html index 4389d2d..ebf6d54 100644 --- a/website/templates/list_abstracts.html +++ b/website/templates/list_abstracts.html @@ -15,4 +15,5 @@ <tr><td><a href="{% url 'website:abstract-details' paper.id %}">{{ paper.title }}</a></td><td>{{ paper.user.first_name }} {{ paper.user.last_name }}</td></tr> {% endfor %} </table> +Note: These are not selected abstracts. Our committee is reviewing the abstracts & list of same will be published soon. {% endblock %} 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): |