diff --git a/comments/forms.py b/comments/forms.py index 13f3b75b06bd3e65ec91076934d391a6a050c836..57f0eb191f078848ddfb52f0917dada7009be10a 100644 --- a/comments/forms.py +++ b/comments/forms.py @@ -24,7 +24,7 @@ comment_refusal_dict = dict(COMMENT_REFUSAL_CHOICES) class CommentForm(forms.ModelForm): class Meta: model = Comment - fields = ['is_rem', 'is_que', 'is_ans', 'is_obj', 'is_rep', 'is_val', 'is_lit', 'is_sug', 'comment_text', 'remarks_for_editors'] + fields = ['is_rem', 'is_que', 'is_ans', 'is_obj', 'is_rep', 'is_cor', 'is_val', 'is_lit', 'is_sug', 'comment_text', 'remarks_for_editors'] def __init__(self, *args, **kwargs): super(CommentForm, self).__init__(*args, **kwargs) @@ -42,7 +42,7 @@ class CommentForm(forms.ModelForm): Div( Fieldset( 'Specify categorization(s):', - 'is_rem', 'is_que', 'is_ans', 'is_obj', 'is_rep', 'is_val', 'is_lit', 'is_sug', + 'is_rem', 'is_que', 'is_ans', 'is_obj', 'is_rep', 'is_cor', 'is_val', 'is_lit', 'is_sug', style="border: 0px; font-size: 90%"), HTML('<br>'), Div( diff --git a/comments/models.py b/comments/models.py index da6575a279f67e3771a3ac5b4123b50968d5cb23..658be03af99a8501071e00b9fce5191d5e21726f 100644 --- a/comments/models.py +++ b/comments/models.py @@ -39,6 +39,7 @@ class Comment(models.Model): # -2: rejected (incorrect) # -3: rejected (not useful) status = models.SmallIntegerField(default=0) + vetted_by = models.ForeignKey(Contributor, blank=True, null=True, related_name='comment_vetted_by') commentary = models.ForeignKey(Commentary, blank=True, null=True) # a Comment is either for a Commentary or Submission submission = models.ForeignKey(Submission, blank=True, null=True) thesislink = models.ForeignKey(ThesisLink, blank=True, null=True) @@ -53,6 +54,7 @@ class Comment(models.Model): is_ans = models.BooleanField(default=False, verbose_name='answer to question') is_obj = models.BooleanField(default=False, verbose_name='objection') is_rep = models.BooleanField(default=False, verbose_name='reply to objection') + is_cor = models.BooleanField(default=False, verbose_name='correction') is_val = models.BooleanField(default=False, verbose_name='validation or rederivation') is_lit = models.BooleanField(default=False, verbose_name='pointer to related literature') is_sug = models.BooleanField(default=False, verbose_name='suggestion for further work') @@ -212,6 +214,8 @@ class Comment(models.Model): output += '<li>objection</li>' if self.is_rep: output += '<li>reply to objection</li>' + if self.is_cor: + output += '<li>correction</li>' if self.is_val: output += '<li>validation or rederivation</li>' if self.is_lit: diff --git a/comments/views.py b/comments/views.py index 071fb19d87ccc01bf454e2fcd9452b2179fc1735..4b3771efc4d0486fe54929673c73117308f75c98 100644 --- a/comments/views.py +++ b/comments/views.py @@ -32,6 +32,7 @@ def vet_submitted_comment_ack(request, comment_id): if form.cleaned_data['action_option'] == '1': # accept the comment as is comment.status = 1 + comment.vetted_by = request.user.contributor comment.save() email_text = ('Dear ' + title_dict[comment.author.title] + ' ' + comment.author.user.last_name + ', \n\nThe Comment you have submitted, concerning publication with title ') @@ -112,6 +113,7 @@ def reply_to_comment(request, comment_id): is_ans = form.cleaned_data['is_ans'], is_obj = form.cleaned_data['is_obj'], is_rep = form.cleaned_data['is_rep'], + is_cor = form.cleaned_data['is_cor'], is_val = form.cleaned_data['is_val'], is_lit = form.cleaned_data['is_lit'], is_sug = form.cleaned_data['is_sug'],