diff --git a/comments/views.py b/comments/views.py index 86ca1bbeb3a6e43bb6788242a990b225e0e11903..67b2d9fbf7a5878175351a2621efddbff8cd8752 100644 --- a/comments/views.py +++ b/comments/views.py @@ -47,6 +47,7 @@ def vet_submitted_comment_ack(request, comment_id): ' at Submission page https://scipost.org/submission/' + str(comment.submission.id)) comment.submission.latest_activity = timezone.now() comment.submission.save() + SubmissionUtils.send_author_comment_received_email() elif comment.thesislink is not None: email_text += (comment.thesislink.title + ' by ' + comment.thesis.author + ' at Thesis Link https://scipost.org/thesis/' + str(comment.thesis.id)) diff --git a/submissions/templates/submissions/submit_manuscript.html b/submissions/templates/submissions/submit_manuscript.html index f034ff78ec80e1217650b26395bc4a6a1ac3c310..8e2418629ff6419a7f4758f03779b21c70fd815a 100644 --- a/submissions/templates/submissions/submit_manuscript.html +++ b/submissions/templates/submissions/submit_manuscript.html @@ -16,7 +16,7 @@ and the <a href="{% url 'journals:journals_terms_and_conditions' %}#author_obligations">author obligations</a>.</p> <p>Please prepare your manuscript according to the <a href="{% url 'submissions:author_guidelines' %}">author guidelines</a>.</p> - {% if False %} <!-- Temporary deactivate submissions --> + {% if request.user.last_name == Piroli %} <!-- Temporary deactivate submissions --> {% if perms.scipost.can_submit_manuscript %} diff --git a/submissions/templates/submissions/vet_submitted_reports.html b/submissions/templates/submissions/vet_submitted_reports.html index bb11765db5e09d671b2d7e14537a89110b228674..d88bdeae77764c5e05b341a0f7ddc2865cdaa999 100644 --- a/submissions/templates/submissions/vet_submitted_reports.html +++ b/submissions/templates/submissions/vet_submitted_reports.html @@ -35,12 +35,7 @@ $(document).ready(function(){ <br> <hr> <h3>Submission associated to Report:</h3> - <table> - <tr><td>Title: </td><td>{{ report_to_vet.submission.title }}</td></tr> - <tr><td>Author(s): </td><td>{{ report_to_vet.submission.author_list }}</td></tr> - <tr><td>arxiv link: </td><td><a href="{{ report_to_vet.submission.arxiv_link }}">{{ report_to_vet.submission.arxiv_link }}</a></td></tr> - <tr><td>Date submitted: </td><td>{{ report_to_vet.submission.submission_date }}</td></tr> - </table> + {{ report_to_vet.submission.header_as_table }} <br /> <h4>Abstract:</h4> <p>{{ report_to_vet.submission.abstract }}</p> diff --git a/submissions/utils.py b/submissions/utils.py index bf89d8135c512989a56efbb23026ac8257c23f2e..1bb8c2db00eaacff4535fe0c6e5c561031daaf11 100644 --- a/submissions/utils.py +++ b/submissions/utils.py @@ -226,3 +226,41 @@ class SubmissionUtils(object): reply_to=['submissions@scipost.org']) emailmessage.send(fail_silently=False) + + @classmethod + def send_author_report_received_email(cls): + email_text = ('Dear ' + title_dict[cls.submission.submitted_by.title] + ' ' + + cls.submission.submitted_by.user.last_name + + ', \n\nA Report has been posted on your recent Submission to SciPost,\n\n' + + cls.submission.title + ' by ' + cls.submission.author_list + '.' + '\n\nYou can view it at the Submission Page ' + 'https://scipost.org/submission/' + str(cls.submission.id) + '.' + '\n\nWe thank you very much for your contribution.' + '\n\nSincerely,' + + '\n\nThe SciPost Team.') + emailmessage = EmailMessage( + 'SciPost: Report received on your Submission', email_text, + 'SciPost Editorial Admin <submissions@scipost.org>', + [cls.submission.submitted_by.user.email], + ['submissions@scipost.org'], + reply_to=['submissions@scipost.org']) + emailmessage.send(fail_silently=False) + + @classmethod + def send_author_comment_received_email(cls): + email_text = ('Dear ' + title_dict[cls.submission.submitted_by.title] + ' ' + + cls.submission.submitted_by.user.last_name + + ', \n\nA Comment has been posted on your recent Submission to SciPost,\n\n' + + cls.submission.title + ' by ' + cls.submission.author_list + '.' + '\n\nYou can view it at the Submission Page ' + 'https://scipost.org/submission/' + str(cls.submission.id) + '.' + '\n\nWe thank you very much for your contribution.' + '\n\nSincerely,' + + '\n\nThe SciPost Team.') + emailmessage = EmailMessage( + 'SciPost: Comment received on your Submission', email_text, + 'SciPost Editorial Admin <submissions@scipost.org>', + [cls.submission.submitted_by.user.email], + ['submissions@scipost.org'], + reply_to=['submissions@scipost.org']) + emailmessage.send(fail_silently=False) diff --git a/submissions/views.py b/submissions/views.py index f2337fad1acea95e3ac1fe1b996add9a19df2770..486b8b6162d676e62dcb141fa1785c16f8b8a656 100644 --- a/submissions/views.py +++ b/submissions/views.py @@ -706,7 +706,7 @@ def submit_report(request, submission_id): @permission_required('scipost.can_take_charge_of_submissions', raise_exception=True) def vet_submitted_reports(request): contributor = Contributor.objects.get(user=request.user) - report_to_vet = Report.objects.filter(status=0).first() # only handle one at a time + report_to_vet = Report.objects.filter(status=0, submission__editor_in_charge=contributor).first() # only handle one at a time form = VetReportForm() context = {'contributor': contributor, 'report_to_vet': report_to_vet, 'form': form } return(render(request, 'submissions/vet_submitted_reports.html', context)) @@ -729,6 +729,7 @@ def vet_submitted_report_ack(request, report_id): # email report author SubmissionUtils.load({'report': report, 'email_response': form.cleaned_data['email_response_field']}) SubmissionUtils.acknowledge_report_email() # email report author, bcc EIC + SubmissionUtils.send_author_report_received_email() context = {} return render(request, 'submissions/vet_submitted_report_ack.html', context)