diff --git a/comments/forms.py b/comments/forms.py index d813f359407dd0e05238d9effc0169e195c1e1b4..c114082fd6aa21980db250503eb72edec522bdd1 100644 --- a/comments/forms.py +++ b/comments/forms.py @@ -23,6 +23,7 @@ class CommentForm(forms.ModelForm): {'placeholder': 'NOTE: only serious and meaningful Comments will be accepted.'}) self.fields['remarks_for_editors'].widget.attrs.update( {'rows': 3, 'placeholder': '(these remarks will not be publicly visible)'}) + self.fields['anonymous'].initial = True if not self.is_report_comment: del self.fields['anonymous'] diff --git a/comments/templates/comments/_add_comment_form.html b/comments/templates/comments/_add_comment_form.html index c420875cce1cc3553c0642e742af133fb320612d..d2b541f7686639c048510843bda3f9cebeddf931 100644 --- a/comments/templates/comments/_add_comment_form.html +++ b/comments/templates/comments/_add_comment_form.html @@ -8,8 +8,20 @@ comment_text_input.on('keyup', function(){ var new_text = $(this).val() $("#preview-comment_text").text(new_text) - MathJax.Hub.Queue(["Typeset",MathJax.Hub]); - }).trigger('keyup') + if( typeof MathJax !== 'undefined' ) { + MathJax.Hub.Queue(["Typeset",MathJax.Hub]); + } + }).trigger('keyup'); + + $('input[name$="anonymous"]').on('change', function() { + $('.anonymous-alert').show() + .children('h3').hide() + if ($(this).prop('checked')) { + $('.anonymous-yes').show(); + } else { + $('.anonymous-no').show(); + } + }).trigger('change'); }); </script> {% endblock %} @@ -50,9 +62,19 @@ <div class="row"> <div class="col-12"> - {% if form.anonymous %}{{ form.anonymous|bootstrap }}{% endif %} + {% if form.anonymous %} + {{ form.anonymous|bootstrap }} + <div class="anonymous-alert" style="display: none;"> + <h3 class="anonymous-yes">Your Comment will remain anonymous.</h3> + <h3 class="anonymous-no"><span class="text-danger">Your Comment will be <span class="text-underline">signed</span>.</span> Thank you very much!</h3> + </div> + {% endif %} <input type="submit" name="submit" value="Submit your Comment for vetting" class="btn btn-primary" id="submit-id-submit"> + {% if form.anonymous %} + <p class="mt-2" id="goodCommenter"><i>By clicking on Submit, you agree with the <a target="_blank" href="{% url 'scipost:terms_and_conditions' %}">Terms and Conditions</a>.</i></p> + {% else %} <p class="mt-2" id="goodCommenter"><i>By clicking on Submit, you agree with the <a target="_blank" href="{% url 'scipost:terms_and_conditions' %}">Terms and Conditions</a>, in particular that <span class="text-danger">your identity will be attached to the Comment</span>.</i></p> + {% endif %} </div> </div> </form> diff --git a/comments/templates/comments/reply_to_report.html b/comments/templates/comments/reply_to_report.html index 8d9984ad077613e5a81db037921131f2107f3c53..29b8cc96ab932559132213235459704fdb50c75d 100644 --- a/comments/templates/comments/reply_to_report.html +++ b/comments/templates/comments/reply_to_report.html @@ -28,10 +28,10 @@ <div class="row"> <div class="col-12"> <h2 class="highlight">Your Reply to this Report:</h2> - {% if is_author %} - <p><em>Please focus on responding to the Report. Although you are welcome to mention what you intend to change in your manuscript as a result of this Report, a formal list of changes is best kept as accompaniment to your eventual resubmission.</em></p> - <p><em>Attachments are here meant for e.g. informative graphs; please do not attach a new version of your manuscript to this Reply.</em></p> - {% endif %} + {% if is_author %} + <p><em>Please focus on responding to the Report. Although you are welcome to mention what you intend to change in your manuscript as a result of this Report, a formal list of changes is best kept as accompaniment to your eventual resubmission.</em></p> + <p><em>Attachments are here meant for e.g. informative graphs; please do not attach a new version of your manuscript to this Reply.</em></p> + {% endif %} {% url 'comments:reply_to_report' report_id=report.id as add_comment_url %} {% include 'comments/_add_comment_form.html' with url=add_comment_url form=form %} {% endif %} diff --git a/comments/views.py b/comments/views.py index 69f65864535d70908d3b47e16dbfd6d06b08f6c1..9b37556ff53d51b17a905b84157e669f1e62130f 100644 --- a/comments/views.py +++ b/comments/views.py @@ -18,10 +18,11 @@ from .models import Comment from .forms import CommentForm, VetCommentForm from .utils import CommentUtils, validate_file_extention -from theses.models import ThesisLink +from commentaries.models import Commentary +from mails.utils import DirectMailUtil from submissions.utils import SubmissionUtils from submissions.models import Submission, Report -from commentaries.models import Commentary +from theses.models import ThesisLink @login_required @@ -92,7 +93,13 @@ def vet_submitted_comment(request, comment_id): # Add events to related Submission and send mail to author of the Submission content_object.submission.add_event_for_eic('A Comment has been accepted.') content_object.submission.add_event_for_author('A new Comment has been added.') - if not comment.is_author_reply: + if comment.is_author_reply: + # Email Report author: Submission authors have replied + mail_sender = DirectMailUtil( + mail_code='referees/inform_referee_authors_replied_to_report', + instance=content_object) + mail_sender.send() + else: SubmissionUtils.load({'submission': content_object.submission}) SubmissionUtils.send_author_comment_received_email() diff --git a/cronjob_production_daily.sh b/cronjob_production_daily.sh index 7de15c4334a73f60e128fb7181c970ba595ccb8b..4a905cddf19e329fd25696d412a230c4481c0ac3 100644 --- a/cronjob_production_daily.sh +++ b/cronjob_production_daily.sh @@ -6,3 +6,4 @@ cd /home/scipost/webapps/scipost/scipost_v1 source venv/bin/activate python3 manage.py remind_fellows_to_submit_report +python3 manage.py send_refereeing_reminders diff --git a/templates/email/eic/referee_unresponsive.json b/templates/email/eic/referee_unresponsive.json index 3a05aa815fb6509000cc04ebb4eb087f43a0b2b6..5d8898c6464dd162dd0417434cdcb6bb7ae56669 100644 --- a/templates/email/eic/referee_unresponsive.json +++ b/templates/email/eic/referee_unresponsive.json @@ -1,9 +1,7 @@ { "subject": "SciPost: unresponsive referee", - "to_address_bup": "submission.editor_in_charge.user.email", - "bcc_to_bup": "admin@scipost.org", - "to_address": "J.S.Caux@uva.nl", - "bcc_to": "J.S.Caux@uva.nl", + "to_address": "submission.editor_in_charge.user.email", + "bcc_to": "edadmin@scipost.org", "from_address_name": "SciPost Refereeing", "from_address": "refereeing@scipost.org", "context_object": "invitation" diff --git a/templates/email/referees/inform_referee_authors_replied_to_report.html b/templates/email/referees/inform_referee_authors_replied_to_report.html new file mode 100644 index 0000000000000000000000000000000000000000..41eca5d456686a1f8e245aa8ead294f91628837b --- /dev/null +++ b/templates/email/referees/inform_referee_authors_replied_to_report.html @@ -0,0 +1,18 @@ +<p> + Dear {{ report.author.get_title_display }} {{ report.author.user.last_name }}, +</p> +<p> + For your information, an Author Reply has been posted on your recent Report on + <br><br> + {{ report.submission.title }} + <br>by {{ report.submission.author_list }}<br> + (see https://scipost.org{{ report.submission.get_absolute_url }} - first submitted {{ report.submission.original_submission_date|date:"d M Y" }}). +</p> +<p> + You can view your Report and the associated reply directly at + <a href="https://scipost.org{{ report.get_absolute_url }}">this link</a>. +</p> +<p> + We thank you very much for your contribution.<br/><br/>The SciPost Team. +</p> +{% include 'email/_footer.html' %} diff --git a/templates/email/referees/inform_referee_authors_replied_to_report.json b/templates/email/referees/inform_referee_authors_replied_to_report.json new file mode 100644 index 0000000000000000000000000000000000000000..2a5297e6a546272e565ce3956556093b3d377d3a --- /dev/null +++ b/templates/email/referees/inform_referee_authors_replied_to_report.json @@ -0,0 +1,8 @@ +{ + "subject": "SciPost: authors replied to your Report", + "to_address": "author.user.email", + "bcc_to": "submission.editor_in_charge.user.email,edadmin@scipost.org", + "from_address_name": "SciPost Refereeing", + "from_address": "refereeing@scipost.org", + "context_object": "report" +} diff --git a/templates/email/referees/invite_contributor_to_referee.html b/templates/email/referees/invite_contributor_to_referee.html index 9c14185b803a196919d2b239019c08cf966c011f..c4eb852a1d39c1b3dfdace341ca15e544b01eac4 100644 --- a/templates/email/referees/invite_contributor_to_referee.html +++ b/templates/email/referees/invite_contributor_to_referee.html @@ -4,7 +4,7 @@ <p> We have received a Submission to SciPost which, in view of your expertise and on behalf of the Editor-in-charge {{invitation.submission.editor_in_charge.get_title_display}} {{invitation.submission.editor_in_charge.user.last_name}}, we would like to invite you to referee: <br><br> - <a href="https://scipost.org{{invitation.submission.get_absolute_url}}">{{invitation.submission.title}}</a> + {{invitation.submission.title}} <br>by {{invitation.submission.author_list}}<br> (see https://scipost.org{{ invitation.submission.get_absolute_url }} - first submitted {{ invitation.submission.original_submission_date|date:"d M Y" }}). </p> diff --git a/templates/email/referees/invite_contributor_to_referee.json b/templates/email/referees/invite_contributor_to_referee.json index c1495012e13e12c449a53bf25d853a139487af0e..363a082194e4456262969e52629723d40aff4c1a 100644 --- a/templates/email/referees/invite_contributor_to_referee.json +++ b/templates/email/referees/invite_contributor_to_referee.json @@ -1,7 +1,7 @@ { "subject": "SciPost: refereeing request", "to_address": "referee.user.email", - "bcc_to": "submission.editor_in_charge.user.email,admin@scipost.org", + "bcc_to": "submission.editor_in_charge.user.email,edadmin@scipost.org", "from_address_name": "SciPost Refereeing", "from_address": "refereeing@scipost.org", "context_object": "invitation" diff --git a/templates/email/referees/invite_contributor_to_referee_reminder1.json b/templates/email/referees/invite_contributor_to_referee_reminder1.json index 3332fb790fc42a54fcf619ad64dacfffd20d4775..afac1de88597f964b9d449e069d6e67eeadf4e10 100644 --- a/templates/email/referees/invite_contributor_to_referee_reminder1.json +++ b/templates/email/referees/invite_contributor_to_referee_reminder1.json @@ -1,9 +1,7 @@ { "subject": "SciPost: refereeing request reminder", - "to_address_bup": "referee.user.email", - "bcc_to_bup": "submission.editor_in_charge.user.email,admin@scipost.org", - "to_address": "J.S.Caux@uva.nl", - "bcc_to": "J.S.Caux@uva.nl", + "to_address": "referee.user.email", + "bcc_to": "submission.editor_in_charge.user.email,edadmin@scipost.org", "from_address_name": "SciPost Refereeing", "from_address": "refereeing@scipost.org", "context_object": "invitation" diff --git a/templates/email/referees/invite_contributor_to_referee_reminder2.json b/templates/email/referees/invite_contributor_to_referee_reminder2.json index 3332fb790fc42a54fcf619ad64dacfffd20d4775..afac1de88597f964b9d449e069d6e67eeadf4e10 100644 --- a/templates/email/referees/invite_contributor_to_referee_reminder2.json +++ b/templates/email/referees/invite_contributor_to_referee_reminder2.json @@ -1,9 +1,7 @@ { "subject": "SciPost: refereeing request reminder", - "to_address_bup": "referee.user.email", - "bcc_to_bup": "submission.editor_in_charge.user.email,admin@scipost.org", - "to_address": "J.S.Caux@uva.nl", - "bcc_to": "J.S.Caux@uva.nl", + "to_address": "referee.user.email", + "bcc_to": "submission.editor_in_charge.user.email,edadmin@scipost.org", "from_address_name": "SciPost Refereeing", "from_address": "refereeing@scipost.org", "context_object": "invitation" diff --git a/templates/email/referees/invite_unregistered_to_referee.json b/templates/email/referees/invite_unregistered_to_referee.json index 84094ac0f51e622df367b2717aa381fe18d41dd5..13b5f05ee65ba24bf27dd527f63381f8774128ad 100644 --- a/templates/email/referees/invite_unregistered_to_referee.json +++ b/templates/email/referees/invite_unregistered_to_referee.json @@ -1,7 +1,7 @@ { "subject": "SciPost: refereeing and registration invitation", "to_address": "email_address", - "bcc_to": "invited_by.email,admin@scipost.org", + "bcc_to": "invited_by.email,edadmin@scipost.org", "from_address_name": "SciPost Refereeing", "from_address": "refereeing@scipost.org", "context_object": "invitation" diff --git a/templates/email/referees/invite_unregistered_to_referee_reminder1.json b/templates/email/referees/invite_unregistered_to_referee_reminder1.json index e0d6bfffa6be7af2bf038ffd9b989072062bb518..ee9ffbfcfd7990014e45e4e7fafd7f29121e8a4a 100644 --- a/templates/email/referees/invite_unregistered_to_referee_reminder1.json +++ b/templates/email/referees/invite_unregistered_to_referee_reminder1.json @@ -1,9 +1,7 @@ { "subject": "SciPost: refereeing and registration invitation reminder", - "to_address_bup": "email_address", - "bcc_to_bup": "invited_by.email,admin@scipost.org", - "to_address": "J.S.Caux@uva.nl", - "bcc_to": "J.S.Caux@uva.nl", + "to_address": "email_address", + "bcc_to": "invited_by.email,edadmin@scipost.org", "from_address_name": "SciPost Refereeing", "from_address": "refereeing@scipost.org", "context_object": "invitation" diff --git a/templates/email/referees/invite_unregistered_to_referee_reminder2.json b/templates/email/referees/invite_unregistered_to_referee_reminder2.json index f8a1db32f0c48bb3218609779cc0dc57ee13e0d0..ee9ffbfcfd7990014e45e4e7fafd7f29121e8a4a 100644 --- a/templates/email/referees/invite_unregistered_to_referee_reminder2.json +++ b/templates/email/referees/invite_unregistered_to_referee_reminder2.json @@ -1,9 +1,7 @@ { "subject": "SciPost: refereeing and registration invitation reminder", - "to_address_bup": "email_address", - "bcc_to_bup": "invited_by.email,admin@scipost.org", - "to_address": "J.S.Caux@uva.nl", - "bcc_to": "admin@scipost.org", + "to_address": "email_address", + "bcc_to": "invited_by.email,edadmin@scipost.org", "from_address_name": "SciPost Refereeing", "from_address": "refereeing@scipost.org", "context_object": "invitation" diff --git a/templates/email/referees/remind_referee_deadline_1week.json b/templates/email/referees/remind_referee_deadline_1week.json index 0d8566194c873253ff92023fbdc5a02f94d173e4..55127785d41f57489a2ffb6a59a758b57934a95d 100644 --- a/templates/email/referees/remind_referee_deadline_1week.json +++ b/templates/email/referees/remind_referee_deadline_1week.json @@ -1,9 +1,7 @@ { "subject": "SciPost: refereeing deadline approaching", - "to_address_bup": "referee.user.email", - "bcc_to_bup": "submission.editor_in_charge.user.email,admin@scipost.org", "to_address": "referee.user.email", - "bcc_to": "submission.editor_in_charge.user.email,admin@scipost.org", + "bcc_to": "submission.editor_in_charge.user.email,edadmin@scipost.org", "from_address_name": "SciPost Refereeing", "from_address": "refereeing@scipost.org", "context_object": "invitation"