diff --git a/commentaries/templates/commentaries/commentary_detail.html b/commentaries/templates/commentaries/commentary_detail.html index 980c2206d679e91f341d660f694557d56c29cb89..31fcc65fdf94daeb7e3484bebc6679371604bbe6 100644 --- a/commentaries/templates/commentaries/commentary_detail.html +++ b/commentaries/templates/commentaries/commentary_detail.html @@ -47,118 +47,8 @@ </section> {% endif %} -{% if comments %} -<section> - <hr class="hr12"> - <div class="flex-greybox"> - <h2>Comments on this publication</h2> - <button id="commentsbutton">Toggle comments view</button> - </div> - - <div id="commentslist"> - {% for comment in comments %} - - <hr class="hr6"> - -<!-- - <div class="row"> - <div class="col-3"> - {{ comment.print_identifier|safe }} - </div> - - <div class="col-9"> - {{ comment.categories_as_ul|safe }} - <br/> - <div class="opinionsDisplay"> - {% if user.is_authenticated and user.contributor.rank > 0 and user.contributor != comment.author %} - <form action="{% url 'comments:express_opinion' comment.id %}" method="post"> - {% csrf_token %} - {{ opinion_form }} - <input type="submit" value="Submit"/> - </form> - {% endif %} - {{ comment.opinions_as_ul|safe }} - </div> - </div> - </div> ---> - <div class="flex-container"> - <div class="flex-commentbox"> - {{ comment.print_identifier|safe }} - {{ comment.categories_as_ul|safe }} - <div class="opinionsDisplay"> - {% if user.is_authenticated and user.contributor.rank > 0 and user.contributor != comment.author %} - <form action="{% url 'comments:express_opinion' comment.id %}" method="post"> - {% csrf_token %} - {{ opinion_form }} - <input type="submit" value="Submit"/> - </form> - {% endif %} - {{ comment.opinions_as_ul|safe }} - </div> - </div> - </div> - <div class="row"> - <div class="col-1"></div> - <div class="col-10"> - <p>{{ comment.comment_text|linebreaks }}</p> - </div> - </div> - - {% for reply in author_replies %} - {% if reply.in_reply_to_comment.id = comment.id %} - - <div class="row"> - <div class="col-1"></div> - <hr style="border-style: dotted;" /> - <div class="col-3"> - {{ reply.print_identifier|safe }} - </div> - </div> - <div class="row"> - <div class="col-1"></div> - <div class="col-10"> - <p>{{ reply.reply_text|linebreaks }}</p> - </div> - </div> - - {% endif %} - {% endfor %} - - {% if user.is_authenticated and user.contributor.rank > 0 %} - <div class="row"> - <div class="col-1"></div> - <hr class="hr6"/> - </div> - <div class="row"> - <div class="col-1"></div> - <div class="col-5"> - <h3><a href="{% url 'comments:author_reply_to_comment' comment_id=comment.id %}">Reply to this comment (Author)</a></h3> - </div> - <div class="col-5"> - <h3><a href="{% url 'comments:reply_to_comment' comment_id=comment.id %}">Reply to this comment (Contributor)</a></h3> - </div> - </div> - {% endif %} - {% endfor %} - </div id="commentslist"> -</section> -{% endif %} - -{% if user.is_authenticated and commentary.open_for_commenting and user.contributor.rank > 0 %} -<section> - <hr class="hr12"> - <div class="flex-greybox"> - <h1>Contribute a Comment:</h1> - </div> - <form action="{% url 'commentaries:commentary' commentary.id %}" method="post"> - {% csrf_token %} - {% load crispy_forms_tags %} - {% crispy form %} - </form> -</section> -{% endif %} +{% include 'scipost/comments_block.html' %} {% endif %} <!-- Temporary strip --> diff --git a/commentaries/views.py b/commentaries/views.py index 31f7386a64404a354b1d1f7d78aa0abfc326d9b8..3859752cf47d3654b1902c3cca2f53ea7909225a 100644 --- a/commentaries/views.py +++ b/commentaries/views.py @@ -14,7 +14,7 @@ from .forms import * from comments.models import Comment, AuthorReply from comments.forms import CommentForm -from scipost.forms import TITLE_CHOICES, AuthenticationForm, OpinionForm +from scipost.forms import TITLE_CHOICES, AuthenticationForm#, OpinionForm title_dict = dict(TITLE_CHOICES) # Convert titles for use in emails @@ -200,7 +200,6 @@ def commentary_detail(request, commentary_id): author_replies = AuthorReply.objects.filter(commentary=commentary) except AuthorReply.DoesNotExist: author_replies = () - opinion_form = OpinionForm() - context = {'commentary': commentary, 'comments': comments.filter(status__gte=1).order_by('date_submitted'), - 'author_replies': author_replies, 'form': form, 'opinion_form': opinion_form} + context = {'commentary': commentary, 'comments': comments.filter(status__gte=1).order_by('-date_submitted'), + 'author_replies': author_replies, 'form': form} return render(request, 'commentaries/commentary_detail.html', context) diff --git a/comments/models.py b/comments/models.py index e3f41e9aa7411073e85b8b8dbcc0fcdd1abdf0b1..4616f65acd37042d0900755c3d44fef6980092f4 100644 --- a/comments/models.py +++ b/comments/models.py @@ -1,6 +1,7 @@ from django.utils import timezone from django.db import models from django.contrib.auth.models import User +from django.shortcuts import get_object_or_404 from .models import * #from commentaries.models import * @@ -11,7 +12,7 @@ from .models import * #from submissions.models import * from commentaries.models import Commentary -from scipost.models import Contributor, Opinion +from scipost.models import Contributor#, Opinion from submissions.models import Submission, Report from theses.models import ThesisLink @@ -64,18 +65,38 @@ class Comment(models.Model): date_submitted = models.DateTimeField('date submitted') # Opinions nr_A = models.PositiveIntegerField(default=0) + in_agreement = models.ManyToManyField(Contributor, related_name='in_agreement') nr_N = models.PositiveIntegerField(default=0) + in_notsure = models.ManyToManyField(Contributor, related_name='in_notsure') nr_D = models.PositiveIntegerField(default=0) + in_disagreement = models.ManyToManyField(Contributor, related_name='in_disagreement') def __str__ (self): return self.comment_text - def recalculate_nr_opinions(self): - self.nr_A = Opinion.objects.filter(comment=self, opinion='A').count() - self.nr_N = Opinion.objects.filter(comment=self, opinion='N').count() - self.nr_D = Opinion.objects.filter(comment=self, opinion='D').count() +# def recalculate_nr_opinions(self): +# self.nr_A = Opinion.objects.filter(comment=self, opinion='A').count() +# self.nr_N = Opinion.objects.filter(comment=self, opinion='N').count() +# self.nr_D = Opinion.objects.filter(comment=self, opinion='D').count() +# self.save() + + def update_opinions(self, contributor_id, opinion): + contributor = get_object_or_404(Contributor, pk=contributor_id) + self.in_agreement.remove(contributor) + self.in_notsure.remove(contributor) + self.in_disagreement.remove(contributor) + if opinion == 'A': + self.in_agreement.add(contributor) + elif opinion == 'N': + self.in_notsure.add(contributor) + elif opinion == 'D': + self.in_disagreement.add(contributor) + self.nr_A = self.in_agreement.count() + self.nr_N = self.in_notsure.count() + self.nr_D = self.in_disagreement.count() self.save() + def opinions_as_ul(self): output = '<div class="opinionsDisplay"><ul>' output += '<li style="background-color: #000099">Agree: ' + str(self.nr_A) + '</li>' @@ -96,8 +117,9 @@ class Comment(models.Model): #output += '</h3>' if self.in_reply_to: #output += '<h4>in reply to ' + str(self.in_reply_to.id) + '</h4>\n' - output += (' <a href="#comment_id' + str(self.in_reply_to_id) + '" style="font-size: 80%">(in reply to ' + str(self.in_reply_to.author.user.first_name) + ' ' + - str(self.in_reply_to.author.user.last_name) + ' on ' + self.in_reply_to.date_submitted.strftime("%Y-%m-%d") + ')</a>') + output += (' (in reply to <a href="#comment_id' + str(self.in_reply_to_id) + '" style="font-size: 80%">' + + str(self.in_reply_to.author.user.first_name) + ' ' + + str(self.in_reply_to.author.user.last_name) + '</a> on ' + self.in_reply_to.date_submitted.strftime("%Y-%m-%d")) #output += '<h4>' + self.date_submitted.strftime("%Y-%m-%d") + '</h4>\n</div>\n' output += '</h3></div>' return output diff --git a/comments/urls.py b/comments/urls.py index 68a74fcbfa7fea3b8b3c23bdfe1255e3138091fe..2eaf6e587b9f67c695c8006060f1ba2ecd8f8a30 100644 --- a/comments/urls.py +++ b/comments/urls.py @@ -14,4 +14,5 @@ urlpatterns = [ url(r'^vet_author_replies$', views.vet_author_replies, name='vet_author_replies'), url(r'^vet_author_reply_ack/(?P<reply_id>[0-9]+)$', views.vet_author_reply_ack, name='vet_author_reply_ack'), url(r'^express_opinion/(?P<comment_id>[0-9]+)$', views.express_opinion, name='express_opinion'), + url(r'^express_opinion/(?P<comment_id>[0-9]+)/(?P<opinion>[AND])$', views.express_opinion, name='express_opinion'), ] diff --git a/comments/views.py b/comments/views.py index 5c09107ee702e214f7d048dc6d5eb1f13f56f5e9..cb763e7b0a9db1db061c2ea4111ec9281d329f3b 100644 --- a/comments/views.py +++ b/comments/views.py @@ -12,8 +12,8 @@ from django.db.models import Avg from .models import * from .forms import * -from scipost.models import title_dict, Opinion -from scipost.forms import OpinionForm +from scipost.models import title_dict#, Opinion +#from scipost.forms import OpinionForm def vet_submitted_comments(request): @@ -208,8 +208,8 @@ def vet_author_reply_ack(request, reply_id): context = {} return render(request, 'comments/vet_author_reply_ack.html', context) - -def express_opinion(request, comment_id): +# OLD +def express_opinion_old(request, comment_id): # A contributor has expressed an opinion on a comment contributor = request.user.contributor comment = get_object_or_404(Comment, pk=comment_id) @@ -230,3 +230,39 @@ def express_opinion(request, comment_id): else: # will never call this return(render(request, 'scipost/index.html')) + +def express_opinion_old(request, comment_id, opinion): + # A contributor has expressed an opinion on a comment + contributor = request.user.contributor + comment = get_object_or_404(Comment, pk=comment_id) + # delete any previous opinion on this by this contributor + Opinion.objects.filter(rater=contributor, comment=comment).delete() + newopinion = Opinion(rater=request.user.contributor, comment=comment, opinion=opinion) + newopinion.save() + comment.recalculate_nr_opinions() + if comment.submission is not None: + return HttpResponseRedirect('/submission/' + str(comment.submission.id) + '/#comment_id' + str(comment.id)) + if comment.commentary is not None: + return HttpResponseRedirect('/commentary/' + str(comment.commentary.id) + '/#comment_id' + str(comment.id)) + if comment.thesislink is not None: + return HttpResponseRedirect('/thesis/' + str(comment.thesislink.id) + '/#comment_id' + str(comment.id)) + else: + # will never call this + return(render(request, 'scipost/index.html')) +# ENDOLD + + +def express_opinion(request, comment_id, opinion): + # A contributor has expressed an opinion on a comment + contributor = request.user.contributor + comment = get_object_or_404(Comment, pk=comment_id) + comment.update_opinions (contributor.id, opinion) + if comment.submission is not None: + return HttpResponseRedirect('/submission/' + str(comment.submission.id) + '/#comment_id' + str(comment.id)) + if comment.commentary is not None: + return HttpResponseRedirect('/commentary/' + str(comment.commentary.id) + '/#comment_id' + str(comment.id)) + if comment.thesislink is not None: + return HttpResponseRedirect('/thesis/' + str(comment.thesislink.id) + '/#comment_id' + str(comment.id)) + else: + # will never call this + return(render(request, 'scipost/index.html')) diff --git a/scipost/admin.py b/scipost/admin.py index 389e0dd5d3e7f692a81e16c5b69ba3d8b34e0467..f15a05577f295b7db20133e945222b6161498227 100644 --- a/scipost/admin.py +++ b/scipost/admin.py @@ -3,7 +3,7 @@ from django.contrib import admin from django.contrib.auth.admin import UserAdmin from django.contrib.auth.models import User -from scipost.models import Contributor, AuthorshipClaim, Opinion +from scipost.models import Contributor, AuthorshipClaim#, Opinion class ContributorInline(admin.StackedInline): #class ContributorInline(admin.TabularInline): @@ -21,4 +21,4 @@ admin.site.register(User, UserAdmin) #admin.site.register(Contributor) admin.site.register(AuthorshipClaim) -admin.site.register(Opinion) +#admin.site.register(Opinion) diff --git a/scipost/forms.py b/scipost/forms.py index d19ab2680e283c802014a2ad641b1b92cdfe76d2..4fb1de02f09451f415835a3e024a089068f8bfa8 100644 --- a/scipost/forms.py +++ b/scipost/forms.py @@ -69,8 +69,8 @@ AUTHORSHIP_CLAIM_CHOICES = ( class AuthorshipClaimForm(forms.Form): claim = forms.ChoiceField(choices=AUTHORSHIP_CLAIM_CHOICES, required=False) -class OpinionForm(forms.Form): - opinion = forms.ChoiceField(choices=OPINION_CHOICES, label='Your opinion on this Comment: ') +#class OpinionForm(forms.Form): +# opinion = forms.ChoiceField(choices=OPINION_CHOICES, label='Your opinion on this Comment: ') class AssessmentForm(forms.ModelForm): diff --git a/scipost/models.py b/scipost/models.py index 6d484c5d55562aef141cc6f1b13c5991f287147b..d94f99436e089eb593c7fccf1c3b487ab26eb130 100644 --- a/scipost/models.py +++ b/scipost/models.py @@ -128,18 +128,18 @@ class Assessment(models.Model): ### Opinions -OPINION_CHOICES = ( - ('ABS', '-'), - ('A', 'agree'), - ('N', 'not sure'), - ('D', 'disagree'), -) -opinion_choices_dict = dict(OPINION_CHOICES) - -class Opinion(models.Model): - rater = models.ForeignKey(Contributor) - comment = models.ForeignKey('comments.Comment') - opinion = models.CharField(max_length=3, choices=OPINION_CHOICES, default='ABS') +#OPINION_CHOICES = ( +# ('ABS', '-'), +# ('A', 'agree'), +# ('N', 'not sure'), +# ('D', 'disagree'), +#) +#opinion_choices_dict = dict(OPINION_CHOICES) + +#class Opinion(models.Model): +# rater = models.ForeignKey(Contributor) +# comment = models.ForeignKey('comments.Comment') +# opinion = models.CharField(max_length=3, choices=OPINION_CHOICES, default='ABS') ### AssessmentAggregates diff --git a/scipost/static/scipost/SciPost.css b/scipost/static/scipost/SciPost.css index 4286ba29cf1454c911ebb2fc1c275dbf8d4c64cf..453b7627c434bc2db53a8a5325db799c54796c9d 100644 --- a/scipost/static/scipost/SciPost.css +++ b/scipost/static/scipost/SciPost.css @@ -498,6 +498,19 @@ section form.ratingsdata ul li label { margin: 1px 3px; padding: 2px 4px; } +.opinionsDisplay form input[type=submit] { + color: #ffffff;; +} +.opinionsDisplay form input[type=submit].agree { + background-color: #000099; +} +.opinionsDisplay form input[type=submit].notsure { + background-color: #555555; +} +.opinionsDisplay form input[type=submit].disagree { + background-color: #990000; +} + article { background-color:#eeeeee; diff --git a/scipost/templates/scipost/comments_block.html b/scipost/templates/scipost/comments_block.html new file mode 100644 index 0000000000000000000000000000000000000000..fdeac064b536067401dd5a17cb818cf5025e8fa6 --- /dev/null +++ b/scipost/templates/scipost/comments_block.html @@ -0,0 +1,98 @@ +{% if comments %} +<section> + <hr class="hr12"> + <div class="flex-greybox"> + <h2>Comments on this publication</h2> + <button id="commentsbutton">Toggle comments view</button> + </div> + + <div id="commentslist"> + {% for comment in comments %} + + <hr class="hr6"> + + <div class="flex-container"> + <div class="flex-commentbox"> + {{ comment.print_identifier|safe }} + {{ comment.categories_as_ul|safe }} + <div class="opinionsDisplay"> + {% if user.is_authenticated and user.contributor.rank > 0 and user.contributor != comment.author %} + <form action="{% url 'comments:express_opinion' comment_id=comment.id opinion='A' %}" method="post"> + {% csrf_token %} + <input type="submit" class="agree" value="Agree {{ comment.nr_A }} "/> + </form> + <form action="{% url 'comments:express_opinion' comment_id=comment.id opinion='N' %}" method="post"> + {% csrf_token %} + <input type="submit" class="notsure" value="Not sure {{ comment.nr_N }}"/> + </form> + <form action="{% url 'comments:express_opinion' comment_id=comment.id opinion='D'%}" method="post"> + {% csrf_token %} + <input type="submit" class="disagree" value="Disagree {{ comment.nr_D }}"/> + </form> + {% endif %} + </div> + </div> + </div> + + + <div class="row"> + <div class="col-1"></div> + <div class="col-10"> + <p>{{ comment.comment_text|linebreaks }}</p> + </div> + </div> + + {% for reply in author_replies %} + {% if reply.in_reply_to_comment.id = comment.id %} + + <div class="row"> + <div class="col-1"></div> + <hr style="border-style: dotted;" /> + <div class="col-3"> + {{ reply.print_identifier|safe }} + </div> + </div> + <div class="row"> + <div class="col-1"></div> + <div class="col-10"> + <p>{{ reply.reply_text|linebreaks }}</p> + </div> + </div> + + {% endif %} + {% endfor %} + + {% if user.is_authenticated and user.contributor.rank > 0 %} + <div class="row"> + <div class="col-1"></div> + <hr class="hr6"/> + </div> + <div class="row"> + <div class="col-1"></div> + <div class="col-5"> + <h3><a href="{% url 'comments:author_reply_to_comment' comment_id=comment.id %}">Reply to this comment (Author)</a></h3> + </div> + <div class="col-5"> + <h3><a href="{% url 'comments:reply_to_comment' comment_id=comment.id %}">Reply to this comment (Contributor)</a></h3> + </div> + </div> + {% endif %} + {% endfor %} + </div id="commentslist"> +</section> +{% endif %} + +{% if user.is_authenticated and commentary.open_for_commenting and user.contributor.rank > 0 %} +<section> + <hr class="hr12"> + <div class="flex-greybox"> + <h1>Contribute a Comment:</h1> + </div> + <form action="{% url 'commentaries:commentary' commentary.id %}" method="post"> + {% csrf_token %} + {% load crispy_forms_tags %} + {% crispy form %} + </form> +</section> +{% endif %} + diff --git a/submissions/templates/submissions/submission_detail.html b/submissions/templates/submissions/submission_detail.html index 2140ab0e207fc20623cfa963a4e69d02515c2f3a..80d6041947f7398d8802cdab6008377f4406ee23 100644 --- a/submissions/templates/submissions/submission_detail.html +++ b/submissions/templates/submissions/submission_detail.html @@ -136,128 +136,7 @@ {% endif %} -{% if comments %} -<section> - <hr class="hr12"> - <div class="flex-greybox"> - <h2>Comments on this Submission</h2> - <button id="commentsbutton">Toggle comments view</button> - </div> - - <div id="commentslist"> - {% for comment in comments %} - - <hr class="hr6"> -<!-- - <div class="row"> - <div class="col-3"> - {{ comment.print_identifier|safe }} - </div> - <div class="col-9"> - <div class="commentcategorydisplay"> - <h4>Category:</h4> - <ul> - {% if comment.is_rem %}<li>remark</li>{% endif %} - {% if comment.is_que %}<li>question</li>{% endif %} - {% if comment.is_ans %}<li>answer to question</li>{% endif %} - {% if comment.is_obj %}<li>objection</li>{% endif %} - {% if comment.is_rep %}<li>reply to objection</li>{% endif %} - {% if comment.is_val %}<li>validation or rederivation</li>{% endif %} - {% if comment.is_lit %}<li>pointer to related literature</li>{% endif %} - {% if comment.is_sug %}<li>suggestion for further work</li>{% endif %} - </ul> - </div> - <br/> - <div class="opinionsDisplay"> - {% if user.is_authenticated and user.contributor.rank > 0 and user.contributor != comment.author %} - <form action="{% url 'comments:express_opinion' comment.id %}" method="post"> - {% csrf_token %} - {{ opinion_form }} - <input type="submit" value="Submit"/> - </form> - {% endif %} - {{ comment.opinions_as_ul|safe }} - </div> - </div> - </div> ---> - <div class="flex-container"> - <div class="flex-commentbox"> - {{ comment.print_identifier|safe }} - {{ comment.categories_as_ul|safe }} - <div class="opinionsDisplay"> - {% if user.is_authenticated and user.contributor.rank > 0 and user.contributor != comment.author %} - <form action="{% url 'comments:express_opinion' comment.id %}" method="post"> - {% csrf_token %} - {{ opinion_form }} - <input type="submit" value="Submit"/> - </form> - {% endif %} - {{ comment.opinions_as_ul|safe }} - </div> - </div> - </div> - - - <div class="row"> - <div class="col-1"></div> - <div class="col-10"> - <p>{{ comment.comment_text|linebreaks }}</p> - </div> - </div> - - {% for reply in author_replies %} - {% if reply.in_reply_to_comment.id = comment.id %} - <div class="row"> - <div class="col-1"></div> - <hr style="border-style: dotted;" /> - <div class="col-3"> - {{ reply.print_identifier|safe }} - </div> - </div> - - <div class="row"> - <div class="col-1"></div> - <div class="col-10"> - <p>{{ reply.reply_text|linebreaks }}</p> - </div> - </div> - {% endif %} - {% endfor %} - - {% if user.is_authenticated and user.contributor.rank > 0 %} - <div class="row"> - <div class="col-1"></div> - <hr class="hr6"/> - </div> - <div class="row"> - <div class="col-1"></div> - <div class="col-5"> - <h3><a href="{% url 'comments:author_reply_to_comment' comment_id=comment.id %}">Reply to this comment (Author)</a></h3> - </div> - <div class="col-5"> - <h3><a href="{% url 'comments:reply_to_comment' comment_id=comment.id %}">Reply to this comment (Contributor)</a></h3> - </div> - </div> - {% endif %} - {% endfor %} - </div> -</section> -{% endif %} - -{% if user.is_authenticated and submission.open_for_commenting and user.contributor.rank > 0 %} -<section> - <hr class="hr12"/> - <div class="flex-greybox"> - <h1>Contribute a Comment:</h1> - </div> - <form action="{% url 'submissions:submission' submission.id %}" method="post"> - {% csrf_token %} - {% load crispy_forms_tags %} - {% crispy form %} - </form> -</section> -{% endif %} +{% include 'scipost/comments_block.html' %} {% endif %} <!-- Temporary strip --> diff --git a/submissions/views.py b/submissions/views.py index 2f0f1801d3f5b6a0eb698cb39fe70719c25a662b..4818871a8c11fce5c43f6d0e1fb8810ae5eb39a7 100644 --- a/submissions/views.py +++ b/submissions/views.py @@ -14,7 +14,7 @@ from .forms import * from comments.models import Comment, AuthorReply from scipost.models import Contributor, title_dict -from scipost.forms import OpinionForm +#from scipost.forms import OpinionForm from submissions.models import Submission from comments.forms import CommentForm @@ -161,10 +161,9 @@ def submission_detail(request, submission_id): author_replies = AuthorReply.objects.filter(submission=submission) except AuthorReply.DoesNotExist: author_replies = () - opinion_form = OpinionForm() - context = {'submission': submission, 'comments': comments.filter(status__gte=1).order_by('date_submitted'), + context = {'submission': submission, 'comments': comments.filter(status__gte=1).order_by('-date_submitted'), 'reports': reports.filter(status__gte=1), 'author_replies': author_replies, - 'form': form, 'opinion_form': opinion_form} + 'form': form, } return render(request, 'submissions/submission_detail.html', context) diff --git a/theses/views.py b/theses/views.py index 0193a25aaae24ae7c9a8d3cbd374437af797bde1..dd7fa335284ec5fe281d5cf38bc72fb40a0036e0 100644 --- a/theses/views.py +++ b/theses/views.py @@ -14,7 +14,7 @@ from .forms import * from comments.models import Comment, AuthorReply from comments.forms import CommentForm -from scipost.forms import TITLE_CHOICES, AuthenticationForm, OpinionForm +from scipost.forms import TITLE_CHOICES, AuthenticationForm#, OpinionForm title_dict = dict(TITLE_CHOICES) # Convert titles for use in emails @@ -203,7 +203,6 @@ def thesis_detail(request, thesislink_id): author_replies = AuthorReply.objects.filter(thesislink=thesislink) except AuthorReply.DoesNotExist: author_replies = () - opinion_form = OpinionForm() context = {'thesislink': thesislink, 'comments': comments.filter(status__gte=1).order_by('date_submitted'), - 'author_replies': author_replies, 'form': form, 'opinion_form': opinion_form} + 'author_replies': author_replies, 'form': form} return render(request, 'theses/thesis_detail.html', context)