SciPost Code Repository

Skip to content
Snippets Groups Projects
Commit 3aecc24b authored by Jorran de Wit's avatar Jorran de Wit
Browse files

Possible anonymous Comments

parent 94820dc0
No related branches found
No related tags found
No related merge requests found
......@@ -9,15 +9,20 @@ class CommentForm(forms.ModelForm):
model = Comment
fields = ['is_cor', 'is_rem', 'is_que', 'is_ans', 'is_obj',
'is_rep', 'is_val', 'is_lit', 'is_sug',
'comment_text', 'remarks_for_editors', 'file_attachment']
'comment_text', 'remarks_for_editors', 'file_attachment',
'anonymous']
def __init__(self, *args, **kwargs):
super(CommentForm, self).__init__(*args, **kwargs)
self.is_report_comment = kwargs.pop('is_report_comment', False)
super().__init__(*args, **kwargs)
self.fields['comment_text'].widget.attrs.update(
{'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)'})
if not self.is_report_comment:
del self.fields['anonymous']
class VetCommentForm(forms.Form):
action_option = forms.ChoiceField(widget=forms.RadioSelect, choices=COMMENT_ACTION_CHOICES,
......
......@@ -52,6 +52,7 @@
<div class="row">
<div class="col-12">
{% if form.anonymous %}{{ form.anonymous|bootstrap }}{% endif %}
<input type="submit" name="submit" value="Submit your Comment for vetting" class="btn btn-primary" id="submit-id-submit">
<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>
</div>
......
......@@ -31,4 +31,5 @@
<div>suggestion for further work</div>
{% endif %}
</div>
<br>
{% endif %}
{% load comment_extras %}
{% load user_groups %}
{% load submissions_extras %}
<div class="commentid" id="comment_id{{comment.id}}">
<h3>
{% if comment.is_author_reply %}Author{% endif %}
{% is_edcol_admin request.user as is_edcol_admin %}
<a href="{{comment.author.get_absolute_url}}">{{comment.author.user.first_name}} {{comment.author.user.last_name}}</a>
on {{comment.date_submitted|date:'Y-m-d'}}
<div class="commentid" id="comment_id{{ comment.id }}">
<h3>
{% if request.user.contributor and request.user.contributor == comment.core_content_object.editor_in_charge or is_edcol_admin and request.user|is_not_author_of_submission:comment.core_content_object.arxiv_identifier_w_vn_nr %}
<h3>{% if comment.anonymous %}(chose public anonymity) {% endif %}<a href="{{ comment.author.get_absolute_url }}">{{ comment.author.user.first_name }} {{ comment.author.user.last_name }}</a>
on {{ comment.date_submitted|date:'Y-m-d' }}
</h3>
{% elif comment.anonymous %}
Anonymous on {{comment.date_submitted|date:'Y-m-d'}}
{% else %}
{% if comment.is_author_reply %}Author{% endif %}
<a href="{{comment.author.get_absolute_url}}">{{comment.author.user.first_name}} {{comment.author.user.last_name}}</a>
on {{comment.date_submitted|date:'Y-m-d'}}
{% endif %}
{% if comment.doi_string %}&nbsp; <small>doi: {{ comment.doi_string }}</small>{% endif %}
</h3>
{% if comment|is_reply_to_comment %}
(in reply to <a href="{{comment.content_object.get_absolute_url}}">{{comment.content_object.author.user.first_name}} {{comment.content_object.author.user.last_name}}</a> on {{comment.content_object.date_submitted|date:'Y-m-d'}})
(in reply to <a href="{{comment.content_object.get_absolute_url}}">{% if comment.content_object.anonymous %}Anonymous Comment{% else %}{{comment.content_object.author.user.first_name}} {{comment.content_object.author.user.last_name}}{% endif %}</a> on {{comment.content_object.date_submitted|date:'Y-m-d'}})
{% elif comment|is_reply_to_report %}
(in reply to <a href="{{comment.content_object.get_absolute_url}}">
(in reply to
Report {{comment.content_object.report_nr}}
{% if not comment.content_object.anonymous %}
by {{comment.content_object.author.user.first_name}} {{comment.content_object.author.user.last_name}}
{% endif %}
<a href="{{comment.content_object.get_absolute_url}}">Report {{comment.content_object.report_nr}}{% if not comment.content_object.anonymous %} by {{comment.content_object.author.user.first_name}} {{comment.content_object.author.user.last_name}}{% endif %}</a>
</a> on {{comment.content_object.date_submitted|date:'Y-m-d'}})
on {{comment.content_object.date_submitted|date:'Y-m-d'}})
{% endif %}
</div>
{% load scipost_extras %}
{% load filename %}
{% load file_extentions %}
{% load user_groups %}
{% is_edcol_admin request.user as is_edcol_admin %}
{% is_editorial_college request.user as is_editorial_college %}
<div class="comment">
{% include 'comments/_comment_identifier.html' with comment=comment %}
......@@ -25,7 +29,7 @@
</p>
{% endif %}
</p>
{% if user|is_in_group:'Editorial College' or user|is_in_group:'Editorial Administrators' %}
{% if is_editorial_college or is_edcol_admin %}
{% if comment.remarks_for_editors %}
<h3>Remarks for editors:</h3>
<p>{{ comment.remarks_for_editors|linebreaks }}</p>
......
......@@ -181,7 +181,7 @@ def reply_to_report(request, report_id):
# Verify if this is from an author:
is_author = report.submission.authors.filter(user=request.user).exists()
form = CommentForm(request.POST or None, request.FILES or None)
form = CommentForm(request.POST or None, request.FILES or None, is_report_comment=True)
if form.is_valid():
newcomment = form.save(commit=False)
newcomment.content_object = report
......
......@@ -14,7 +14,6 @@ SCIPOST_JOURNALS_SUBMIT = (
# Journal closed for submission
SCIPOST_JOURNALS_NO_SUBMIT = (
(SCIPOST_JOURNAL_PHYSICS_SELECT, 'SciPost Physics Select'),
(SCIPOST_JOURNAL_PHYSICS_PROC, 'SciPost Physics Proceedings'),
)
# All allowed journals
......
......@@ -39,13 +39,13 @@
.voting-group {
border-radius: $card-border-radius;
color: $scipost-darkblue;
box-shadow: 0 1px 0 0 $gray-600;
border: 1px solid $gray-600;
> div {
padding: 0.25rem 0.5rem;
font-size: 0.8rem;
border-radius: 0;
line-height: 1.25;
line-height: 1;
margin: 0;
display: inline-block;
color: #002b49;
......@@ -98,3 +98,12 @@
}
}
}
.category-group {
display: inline-block;
margin-bottom: 0.5rem;
> div {
line-height: 1.3;
}
}
......@@ -6,6 +6,10 @@
<h3><a href="{% url 'comments:reply_to_report' report_id=report.id %}">Reply to this Report</a> (authors only)</h3>
{% endif %}
{% if report.comments.vetted.exists %}
<br>
{% endif %}
{% for reply in report.comments.vetted %}
{% include 'comments/_single_comment_with_link.html' with comment=reply perms=perms user=user %}
{% endfor %}
......
......@@ -21,6 +21,7 @@ def is_viewable_by_authors(recommendation):
'accepted', 'rejected',
'published', 'withdrawn']
@register.filter
def user_is_referee(submission, user):
return submission.referee_invitations.filter(referee__user=user).exists()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment