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 %}