SciPost Code Repository

Skip to content
Snippets Groups Projects
Commit 5fe1579e authored by Jean-Sébastien Caux's avatar Jean-Sébastien Caux
Browse files

Submissions workflow improved

parent fce3e0c7
No related branches found
No related tags found
No related merge requests found
Showing
with 300 additions and 176 deletions
......@@ -46,8 +46,8 @@ class CommentForm(forms.ModelForm):
style="border: 0px; font-size: 90%"),
HTML('<br>'),
Div(
Submit('submit', 'Submit your Comment for vetting', css_class="submitComment"),
HTML('<p id="goodCommenter"><i>By clicking on Submit, the commenter agrees to the <a href="{% url \'scipost:terms_and_conditions\' %}">Terms and Conditions</a>.</i></p>'),
Submit('submit', 'Submit your Comment for vetting', css_class="submitButton"),
HTML('<p id="goodCommenter"><i>By clicking on Submit, you agree with the <a href="{% url \'scipost:terms_and_conditions\' %}">Terms and Conditions</a>.</i></p>'),
),
css_class="col-3"),
css_class="row"),
......
......@@ -267,10 +267,11 @@ a:hover {
text-decoration: underline;
}
.submitComment {
.submitButton {
background-color: #002B49;
color: #ffffff;
border: 1px solid #FFA300;
margin: 5px;
padding: 5px;
}
......
......@@ -209,10 +209,10 @@
<h3>Submissions assignments</h3>
<ul>
{% if perms.scipost.can_assign_submissions %}
<li><a href="{% url 'submissions:assign_submissions' %}">Assign SciPost Submissions</a> ({{ nr_submissions_to_assign }})</li>
<li>Assign Submissions via the <a href="{% url 'submissions:pool' %}">Submissions Pool</a> ({{ nr_submissions_to_assign }})</li>
{% endif %}
{% if perms.scipost.can_take_charge_of_submissions %}
<li><a href="{% url 'submissions:accept_or_decline_assignments' %}">Accept or decline assignments</a> ({{ nr_assignments_to_consider }})</li>
<li>Accept or decline assignments via the <a href="{% url 'submissions:pool' %}">Submissions Pool</a> ({{ nr_assignments_to_consider }})</li>
{% endif %}
</ul>
</div>
......
......@@ -137,12 +137,13 @@ class Utils(object):
if cls.invitation.invitation_type == 'R':
# Refereeing invitation
# TO BE COMPLETED
# Details of the submission to referee are already in the personal_message field
email_text += ('We would hereby like to cordially invite you to become a Contributor on SciPost ' +
'(our records show that you are not yet registered); ' +
'(our records show that you are not yet registered); ' +
'we have prepared a pre-filled form for you at\n\n' +
'https://scipost.org/invitation/' + cls.invitation.invitation_key + '\n\n' +
'after which your registration will be activated, allowing you to contribute.\n\n' +
'after which your registration will be activated, allowing you to contribute, '
'in particular by providing referee reports.\n\n' +
'Many thanks in advance,\n\nThe SciPost Team')
emailmessage = EmailMessage(
'SciPost registration invitation', email_text, 'SciPost Registration <registration@scipost.org>',
......
......@@ -424,7 +424,9 @@ def personal_page(request):
nr_assignments_to_consider = 0
active_assignments = None
if is_MEC(request.user):
nr_assignments_to_consider = EditorialAssignment.objects.filter(to=contributor, accepted=None).count()
nr_assignments_to_consider = (EditorialAssignment.objects
.filter(to=contributor, accepted=None, deprecated=False)
.count())
active_assignments = EditorialAssignment.objects.filter(to=contributor, accepted=True, completed=False)
nr_commentary_page_requests_to_vet = 0
nr_comments_to_vet = 0
......
......@@ -267,7 +267,7 @@ a:hover {
text-decoration: underline;
}
.submitComment {
.submitButton {
background-color: #002B49;
color: #ffffff;
border: 1px solid #FFA300;
......
......@@ -76,6 +76,7 @@ class RefereeRecruitmentForm(forms.ModelForm):
self.helper = FormHelper()
self.helper.layout = Layout(
Div(Field('title'), Field('first_name'), Field('last_name'), Field('email_address'),
Submit('submit', 'Send invitation', css_class="submitButton"),
css_class="flex-whitebox320")
)
......
......@@ -126,7 +126,7 @@ class Submission(models.Model):
'<p>Editor-in-charge: {{ EIC }}</p>')
if self.status == 'unassigned':
header += ('<p style="color: red">Status: {{ status }}.'
' You can <a href="/submissions/volunteer_as_EIC/{{ id }}">volunteer</a> to become Editor-in-charge</p>')
' You can volunteer to become Editor-in-charge by <a href="/submissions/volunteer_as_EIC/{{ id }}">clicking here</a>.</p>')
else:
header += '<p>Status: {{ status }}</p>'
header += '</div></div></li>'
......@@ -188,7 +188,35 @@ class EditorialAssignment(models.Model):
return (self.to.user.first_name + ' ' + self.to.user.last_name + ' to become EIC of ' +
self.submission.title[:30] + ' by ' + self.submission.author_list[:30] +
', requested on ' + self.date_created.strftime('%Y-%m-%d'))
def info_as_li(self):
context = Context({'first_name': self.to.user.first_name,
'last_name': self.to.user.last_name,
'date_created': self.date_created.strftime('%Y-%m-%d %H:%M')})
info = '<li'
if self.accepted:
info += ' style="color: green"'
elif self.deprecated:
info += ' style="color: purple"'
elif self.accepted == False:
if self.refusal_reason == 'NIE' or self.refusal_reason == 'DNP':
info += ' style="color: #CC0000"'
else:
info += ' style="color: #FF7700"'
info += '>{{ first_name }} {{ last_name }}, requested {{ date_created }}'
if self.accepted:
info += ', accepted {{ date_answered }}'
context['date_answered'] = self.date_answered.strftime('%Y-%m-%d %H:%M')
if self.deprecated:
info += ', deprecated'
if self.refusal_reason:
info += ', declined {{ date_answered }}, reason: {{ reason }}'
context['date_answered'] = self.date_answered.strftime('%Y-%m-%d %H:%M')
context['reason'] = assignment_refusal_reasons_dict[self.refusal_reason]
info += '</li>'
template = Template(info)
return template.render(context)
def header_as_li(self):
header = '<li><div class="flex-container">'
header += '<div class="flex-whitebox0"><p><a href="/submission/{{ id }}" class="pubtitleli">{{ title }}</a></p>'
......@@ -202,21 +230,6 @@ class EditorialAssignment(models.Model):
'status': submission_status_dict[self.submission.status]})
return template.render(context)
def declination_as_li(self):
output = '<li'
if self.refusal_reason == 'NIE' or self.refusal_reason == 'DNP':
output += ' style="color: red"'
output += ('>Fellow {{ first_name }} {{ last_name }}, '
'requested {{ date_created }}, declined {{ date_answered }}, '
'reason: {{ reason }}</li>')
template = Template(output)
context = Context({'first_name': self.to.user.first_name,
'last_name': self.to.user.last_name,
'date_created': self.date_created.strftime('%Y-%m-%d %H:%M'),
'date_answered': self.date_answered.strftime('%Y-%m-%d %H:%M'),
'reason': assignment_refusal_reasons_dict[self.refusal_reason]})
return template.render(context)
class RefereeInvitation(models.Model):
submission = models.ForeignKey(Submission)
......
......@@ -5,11 +5,16 @@
{% block bodysup %}
<section>
{% if assignment.accepted %}
{% if errormessage %}
<p>{{ errormessage }}</p>
<p>Return to the <a href="{% url 'submissions:pool' %}">Submissions Pool</a>.</p>
{% elif assignment.accepted %}
<h1>Thank you for becoming Editor-in-charge of this submission.</h1>
<p>Please go to the <a href="{% url 'submissions:editorial_page' submission_id=assignment.submission.id %}">Submission's editorial page</a> and select referees now.</p>
{% else %}
<h1>Thank you for considering.</h1>
<p>Return to the <a href="{% url 'submissions:pool' %}">Submissions Pool</a>.</p>
{% endif %}
</section>
......
{% extends 'scipost/base.html' %}
{% block pagetitle %}: accept or decline assignments{% endblock pagetitle %}
{% block bodysup %}
<script>
$(document).ready(function(){
$('#ref_reason').hide();
$('#id_accept').on('change', function() {
if ($('#id_accept_1').is(':checked')) {
$('#ref_reason').show();
}
else {
$('#ref_reason').hide();
}
});
});
</script>
<section>
{% if not assignment_to_consider %}
<h1>There are no Assignments for you to consider.</h1>
{% elif errormessage %}
<h1></h1>
<p>{{ errormessage }}</p>
{% else %}
<div class="flex-greybox">
<h1>SciPost Submission: can you act as Editor-in-charge? (see below to accept/decline):</h1>
</div>
<br>
<hr>
{{ assignment_to_consider.submission.header_as_table }}
<br />
<h4>Abstract:</h4>
<p>{{ assignment_to_consider.submission.abstract }}</p>
<br/>
<hr>
<div class="flex-greybox">
<h1>Accept or Decline this Assignment</h1>
</div>
<h3>By accepting, you will be required to start a refereeing round on the next screen.</h3>
<form action="{% url 'submissions:accept_or_decline_assignment_ack' assignment_id=assignment_to_consider.id %}" method="post">
{% csrf_token %}
{{ form.accept }}
<div id="ref_reason">
<p>Please select a reason for declining this assignment:</p>
{{ form.refusal_reason }}
</div>
<input type="submit" value="Submit" />
</form>
{% endif %}
</section>
{% endblock bodysup %}
{% extends 'scipost/base.html' %}
{% block pagetitle %}: assign submissions{% endblock pagetitle %}
{% block pagetitle %}: assign submission{% endblock pagetitle %}
{% block bodysup %}
<section>
{% if not submission_to_assign %}
<h1>There are no Submissions for you to assign.</h1>
{% else %}
<h1>SciPost Submission to Assign</h1>
<h1>SciPost Submission: send an Assignment Request</h1>
<br>
<hr>
......@@ -30,24 +26,24 @@
<hr>
{{ submission_to_assign.status_info_as_table }}
<hr>
<h1>Required actions:</h1>
<form action="{% url 'submissions:assign_submission_ack' submission_id=submission_to_assign.id %}" method="post">
{% csrf_token %}
{{ form.as_ul }}
<input type="submit" value="Submit" />
</form>
{% if assignments_declined %}
{% if submission_to_assign.editorialassignment_set.all %}
<h4>EIC Assignment requests already sent:</h4>
<h3>If more than 5 Fellows have declined an assignment for a red-marked reason, the Submission should be rejected.</h3>
<h3>Previously-declined Assignments:</h3>
<ul>
{% for assignment in assignments_declined %}
{{ assignment.declination_as_li }}
{% for assignment in sub.editorialassignment_set.all %}
{{ assignment.info_as_li }}
{% endfor %}
</ul>
{% endif %}
{% endif %}
<h1>Send a new assignment request:</h1>
<form action="{% url 'submissions:assign_submission_ack' submission_id=submission_to_assign.id %}" method="post">
{% csrf_token %}
{{ form.as_ul }}
<input type="submit" value="Submit" />
</form>
</section>
{% endblock bodysup %}
......@@ -5,7 +5,8 @@
{% block bodysup %}
<section>
<h1>The new submission has been successfully assigned to an editor-in-charge.</h1>
<h1>Your assignment request has successfully been sent.</h1>
<p>Return to the <a href="{% url 'submissions:pool' %}">Submissions Pool</a>.</p>
</section>
{% endblock bodysup %}
......@@ -29,7 +29,7 @@
<form action="{% url 'submissions:communication' submission_id=submission.id comtype=comtype %}" method="post">
{% csrf_token %}
{{ form }}
<input comtype="submit" value="Send communication"/>
<input type="submit" value="Send communication"/>
</form>
</section>
......
......@@ -4,8 +4,61 @@
{% block bodysup %}
<script>
$(document).ready(function(){
$('#ref_reason').hide();
$('#id_accept').on('change', function() {
if ($('#id_accept_1').is(':checked')) {
$('#ref_reason').show();
}
else {
$('#ref_reason').hide();
}
});
});
</script>
<section>
{% if assignments_to_consider %}
{% for assignment_to_consider in assignments_to_consider %}
<div class="flex-greybox">
<h1>Assignment request: can you act as Editor-in-charge? (see below to accept/decline):</h1>
</div>
<br>
<hr>
{{ assignment_to_consider.submission.header_as_table }}
<br />
<h4>Abstract:</h4>
<p>{{ assignment_to_consider.submission.abstract }}</p>
<br/>
<hr>
<div class="flex-greybox">
<h1>Accept or Decline this Assignment</h1>
</div>
<h3>By accepting, you will be required to start a refereeing round on the next screen.</h3>
<form action="{% url 'submissions:accept_or_decline_assignment_ack' assignment_id=assignment_to_consider.id %}" method="post">
{% csrf_token %}
{{ form.accept }}
<div id="ref_reason">
<p>Please select a reason for declining this assignment:</p>
{{ form.refusal_reason }}
</div>
<input type="submit" value="Submit" />
</form>
<hr class="hr6"/>
{% endfor %}
<hr class="hr12"/>
{% endif %}
<div class="flex-container">
<div class="flex-greybox320">
<h1>SciPost Submissions Pool</h1>
......@@ -14,7 +67,25 @@
<ul>
{% for sub in submissions_in_pool %}
<br/>
{{ sub.header_as_li_for_Fellows }}
{% if perms.scipost.can_assign_submissions %}
{% if sub.editorialassignment_set.all %}
<h4>EIC Assignment requests:</h4>
<ul>
{% for assignment in sub.editorialassignment_set.all %}
{{ assignment.info_as_li }}
{% endfor %}
</ul>
{% endif %}
{% if sub.editor_in_charge == None %}
<h4>Actions:</h4>
<ul>
<li><a href="{% url 'submissions:assign_submission' submission_id=sub.id %}">Send a new assignment request</a></li>
<li><a href="{% url 'submissions:assignment_failed' submission_id=sub.id %}">Close pre-screening: failure to find EIC</a></li>
</ul>
{% endif %}
{% endif %}
{% endfor %}
</ul>
......
......@@ -28,6 +28,10 @@
<h3>Abstract:</h3>
<p>{{ submission.abstract }}</p>
{% if submission.referees_flagged %}
<h3>Referees flagged upon submission (treat reports with caution):</h3>
<p>{{ submission.referees_flagged }}</p>
{% endif %}
</section>
......@@ -57,7 +61,6 @@
{% csrf_token %}
{% load crispy_forms_tags %}
{% crispy ref_recruit_form %}
<input type="submit" value="Send invitation">
</form>
{% endif %}
</section>
......
......@@ -55,10 +55,11 @@
<li><h3><a href="{% url 'submissions:submit_report' submission.id %}">Contribute a Report</a>
<div class="reportingDeadline">Deadline for reporting: {{ submission.reporting_deadline }}</div></h3></li>
{% else %}
<li>Reporting for this Submission is now closed.</li>
<li>Reporting for this Submission is closed.</li>
{% endif %}
{% if submission.open_for_commenting and perms.scipost.can_submit_comments %}
<li><h3><a href="#contribute_comment">Contribute a Comment</a></h3></li>
<li>Commenting on this Submission is closed.</li>
{% endif %}
</ul>
</section>
......
......@@ -16,16 +16,13 @@
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 True %} <!-- Temporary deactivate submissions -->
{% if perms.scipost.can_submit_manuscript %}
<div class="flex-greybox">
<h3><em>You can prefill part of the form using the arXiv identifier:</em></h3>
<p><em>(give the identifier without prefix but with version number, as per the placeholder)</em></p>
{% if errormessage %}
<h3 style="color: red;">Error: {{ errormessage }}</h3>
{% endif %}
<form action="{% url 'submissions:prefill_using_identifier' %}" method="post">
{% csrf_token %}
{{ identifierform }}
......@@ -33,6 +30,9 @@
</form>
</div>
<br/>
{% if errormessage %}
<h3 style="color: red;">Error: {{ errormessage }}</h3>
{% endif %}
<form action="{% url 'submissions:submit_manuscript' %}" method="post">
{% csrf_token %}
......@@ -41,6 +41,10 @@
{{ form.as_table }}
</ul>
</table>
<p>By clicking on Submit, you state that you have read and agree with
the <a href="{% url 'journals:journals_terms_and_conditions' %}">SciPost Journals Terms and Conditions</a>,
the <a href="{% url 'journals:journals_terms_and_conditions' %}#license_and_copyright_agreement">license and copyright agreement</a>
and the <a href="{% url 'journals:journals_terms_and_conditions' %}#author_obligations">author obligations</a>.</p>
<input type="submit" value="Submit"/>
</form>
{% else %}
......
......@@ -48,7 +48,7 @@ $(document).ready(function(){
<div class="flex-greybox">
<h3>Report to vet:</h3>
</div>
{{ report_to_vet.print_contents_for_editors }}
{{ report_to_vet.print_contents_for_editors|linebreaks }}
<hr class="hr6"/>
<div class="flex-greaybox">
......
......@@ -9,18 +9,17 @@ urlpatterns = [
url(r'^browse/(?P<discipline>[a-z]+)/(?P<nrweeksback>[0-9]+)/$', views.browse, name='browse'),
url(r'^sub_and_ref_procedure$', TemplateView.as_view(template_name='submissions/sub_and_ref_procedure.html'), name='sub_and_ref_procedure'),
url(r'^author_guidelines$', TemplateView.as_view(template_name='submissions/author_guidelines.html'), name='author_guidelines'),
#url(r'^submission/(?P<submission_id>[0-9]+)/$', views.submission_detail, name='submission'),
url(r'^(?P<submission_id>[0-9]+)/$', views.submission_detail, name='submission'),
url(r'^prefill_using_identifier$', views.prefill_using_identifier, name='prefill_using_identifier'),
url(r'^submit_manuscript$', views.submit_manuscript, name='submit_manuscript'),
url(r'^submit_manuscript_ack$', TemplateView.as_view(template_name='submissions/submit_manuscript_ack.html'), name='submit_manuscript_ack'),
url(r'^pool$', views.pool, name='pool'),
# Assignment of Editor-in-charge
url(r'^assign_submissions$', views.assign_submissions, name='assign_submissions'),
url(r'^assign_submission/(?P<submission_id>[0-9]+)$', views.assign_submission, name='assign_submission'),
url(r'^assign_submission_ack/(?P<submission_id>[0-9]+)$', views.assign_submission_ack, name='assign_submission_ack'),
url(r'^accept_or_decline_assignments$', views.accept_or_decline_assignments, name='accept_or_decline_assignments'),
url(r'^accept_or_decline_assignment_ack/(?P<assignment_id>[0-9]+)$', views.accept_or_decline_assignment_ack, name='accept_or_decline_assignment_ack'),
url(r'^volunteer_as_EIC/(?P<submission_id>[0-9]+)$', views.volunteer_as_EIC, name='volunteer_as_EIC'),
url(r'^assignment_failed/(?P<submission_id>[0-9]+)$', views.assignment_failed, name='assignment_failed'),
# Editorial workflow and refereeing
url(r'^editorial_page/(?P<submission_id>[0-9]+)$', views.editorial_page, name='editorial_page'),
url(r'^select_referee/(?P<submission_id>[0-9]+)$', views.select_referee, name='select_referee'),
......
......@@ -87,13 +87,21 @@ def prefill_using_identifier(request):
pass
return redirect(reverse('submissions:submit_manuscript'))
@permission_required('scipost.can_submit_manuscript', raise_exception=True)
def submit_manuscript(request):
if request.method == 'POST':
form = SubmissionForm(request.POST)
if form.is_valid():
submitted_by = Contributor.objects.get(user=request.user)
# Verify if submitter is among the authors
if not submitted_by.user.last_name in form.cleaned_data['author_list']:
errormessage = ('Your name does not match that of any of the authors. '
'You are not authorized to submit this preprint.')
identifierform = SubmissionIdentifierForm()
return render(request, 'submissions/submit_manuscript.html',
{'identifierform': identifierform, 'form': form,
'errormessage': errormessage})
submission = Submission (
submitted_by = submitted_by,
submitted_to_journal = form.cleaned_data['submitted_to_journal'],
......@@ -110,6 +118,22 @@ def submit_manuscript(request):
referees_flagged = form.cleaned_data['referees_flagged'],
)
submission.save()
email_text = ('Dear ' + title_dict[submitted_by.title] + ' ' +
submitted_by.user.last_name +
', \n\nWe have received your Submission to SciPost,\n\n' +
submission.title + ' by ' + submission.author_list + '.' +
'\n\nWe will update you on the results of the pre-screening process '
'within the next 5 working days.'
'\n\nYou can track your Submission at any time '
'from your personal page https://scipost.org/personal_page.' +
'\n\nWith many thanks,' +
'\n\nThe SciPost Team.')
emailmessage = EmailMessage(
'SciPost: Submission received', email_text,
'SciPost Editorial Admin <submissions@scipost.org>',
[submitted_by.user.email, 'submissions@scipost.org'],
reply_to=['submissions@scipost.org'])
emailmessage.send(fail_silently=False)
return HttpResponseRedirect(reverse('submissions:submit_manuscript_ack'))
else:
identifierform = SubmissionIdentifierForm()
......@@ -213,6 +237,7 @@ def submission_detail(request, submission_id):
# Editorial workflow #
######################
@login_required
@permission_required('scipost.can_take_charge_of_submissions', raise_exception=True)
def pool(request):
"""
......@@ -221,28 +246,27 @@ def pool(request):
to publication acceptance or rejection.
All members of the Editorial College have access.
"""
submissions_in_pool=Submission.objects.all().exclude(status__in=['decided'])
context = {'submissions_in_pool': submissions_in_pool}
submissions_in_pool=(Submission.objects.all()
.exclude(status__in=['decided'])
.order_by('-submission_date'))
contributor = Contributor.objects.get(user=request.user)
assignments_to_consider = EditorialAssignment.objects.filter(
to=contributor, accepted=None, deprecated=False)
form = ConsiderAssignmentForm()
context = {'submissions_in_pool': submissions_in_pool,
'assignments_to_consider': assignments_to_consider, 'form': form}
return render(request, 'submissions/pool.html', context)
@permission_required('scipost.can_assign_submissions', raise_exception=True)
def assign_submissions(request):
submission_to_assign = Submission.objects.filter(status='unassigned').first() # only handle one at at time
assignments_declined = None
if submission_to_assign is not None:
# form = AssignSubmissionForm(discipline=submission_to_assign.discipline, specialization=submission_to_assign.specialization) # reactivate later on
form = AssignSubmissionForm(discipline=submission_to_assign.discipline)
assignments_declined = (EditorialAssignment.objects
.filter(submission=submission_to_assign, accepted=False)
.order_by('date_created'))
else:
form = AssignSubmissionForm(discipline='physics')
def assign_submission(request, submission_id):
submission_to_assign = get_object_or_404 (Submission, pk=submission_id)
#form = AssignSubmissionForm(discipline=submission_to_assign.discipline, specialization=submission_to_assign.specialization) # reactivate later on
form = AssignSubmissionForm(discipline=submission_to_assign.discipline)
context = {'submission_to_assign': submission_to_assign,
'form': form,
'assignments_declined': assignments_declined}
return render(request, 'submissions/assign_submissions.html', context)
'form': form}
return render(request, 'submissions/assign_submission.html', context)
@permission_required('scipost.can_assign_submissions', raise_exception=True)
......@@ -256,14 +280,16 @@ def assign_submission_ack(request, submission_id):
to=suggested_editor_in_charge,
date_created=timezone.now())
ed_assignment.save()
# Email Fellow
email_text = ('Dear ' + title_dict[ed_assignment.to.title] + ' ' +
ed_assignment.to.user.last_name +
', \n\nWe have received a Submission to SciPost ' +
'for which we would like you to consider becoming Editor-in-charge:\n\n' +
submission.title + ' by ' + submission.author_list + '.' +
'\n\nPlease visit https://scipost.org/submissions/accept_or_decline_assignments \n' +
'in order to accept or decline. Many thanks in advance for your consideration. ' +
'\n\nPlease visit https://scipost.org/submissions/pool ' +
'in order to accept or decline (on a first come, first serve basis: '
'this assignment request is automatically deprecated if another Fellow '
'takes charge of this Submission or if the latter fails pre-screening). '
'\n\nMany thanks in advance for your collaboration,' +
'\n\nThe SciPost Team.')
emailmessage = EmailMessage(
'SciPost: potential Submission assignment', email_text,
......@@ -276,32 +302,21 @@ def assign_submission_ack(request, submission_id):
return render(request, 'submissions/assign_submission_ack.html', context)
@login_required
@permission_required('scipost.can_take_charge_of_submissions', raise_exception=True)
def accept_or_decline_assignments(request):
def accept_or_decline_assignment_ack(request, assignment_id):
contributor = Contributor.objects.get(user=request.user)
assignment = EditorialAssignment.objects.filter(to=contributor, accepted=None).first()
assignment = get_object_or_404 (EditorialAssignment, pk=assignment_id)
errormessage = None
if assignment.submission.statue == 'assignment_failed':
if assignment.submission.status == 'assignment_failed':
errormessage = 'This Submission has failed pre-screening and has been rejected.'
assignment.deprecated = True
assignment.save()
elif assignment.submission.status != 'unassigned': # already assigned, or deprecated
errormessage = (title_dict[assignment.submission.editor_in_charge.title] +
context = {'errormessage': errormessage}
return render(request, 'submissions/accept_or_decline_assignment_ack.html', context)
if assignment.submission.editor_in_charge:
errormessage = (title_dict[assignment.submission.editor_in_charge.title] + ' ' +
assignment.submission.editor_in_charge.user.last_name +
' has already agreed to be Editor-in-charge of this Submission.')
assignment.deprecated = True
assignment.save()
form = ConsiderAssignmentForm()
context = {'assignment_to_consider': assignment, 'form': form,
'errormessage': errormessage}
return render(request, 'submissions/accept_or_decline_assignments.html', context)
@permission_required('scipost.can_take_charge_of_submissions', raise_exception=True)
def accept_or_decline_assignment_ack(request, assignment_id):
contributor = Contributor.objects.get(user=request.user)
assignment = get_object_or_404 (EditorialAssignment, pk=assignment_id)
context = {'errormessage': errormessage}
return render(request, 'submissions/accept_or_decline_assignment_ack.html', context)
if request.method == 'POST':
form = ConsiderAssignmentForm(request.POST)
if form.is_valid():
......@@ -317,6 +332,28 @@ def accept_or_decline_assignment_ack(request, assignment_id):
deadline += datetime.timedelta(days=28)
assignment.submission.reporting_deadline = deadline
assignment.submission.open_for_commenting = True
# Deprecate all other assignments related to this submission
assignments_to_deprecate = EditorialAssignment.objects.filter(
submission=assignment.submission, accepted=None)
for atd in assignments_to_deprecate:
atd.deprecated = True
atd.save()
# Email EIC
email_text = ('Dear ' + title_dict[assignment.to.title] + ' ' +
assignment.to.user.last_name +
', \n\nThank you for accepting to become Editor-in-charge of the SciPost Submission\n\n' +
submission.title + ' by ' + submission.author_list + '.' +
'\n\nYou can take your editorial actions from the editorial page '
'https://scipost.org/submission/editorial_page/' + str(submission.id) +
' (also accessible from your personal page https://scipost.org/personal_page under the Editorial Actions tab).'
'\n\nMany thanks in advance for your collaboration,' +
'\n\nThe SciPost Team.')
emailmessage = EmailMessage(
'SciPost: assignment as EIC', email_text,
'SciPost Editorial Admin <submissions@scipost.org>',
[assignment.to.user.email, 'submissions@scipost.org'],
reply_to=['submissions@scipost.org'])
emailmessage.send(fail_silently=False)
else:
assignment.accepted = False
assignment.refusal_reason = form.cleaned_data['refusal_reason']
......@@ -335,6 +372,17 @@ def volunteer_as_EIC(request, submission_id):
This is an adapted version of the accept_or_decline_assignment_ack method.
"""
submission = get_object_or_404(Submission, pk=submission_id)
errormessage = None
if submission.status == 'assignment_failed':
errormessage = 'This Submission has failed pre-screening and has been rejected.'
context = {'errormessage': errormessage}
return render(request, 'submissions/accept_or_decline_assignment_ack.html', context)
if submission.editor_in_charge:
errormessage = (title_dict[submission.editor_in_charge.title] + ' ' +
submission.editor_in_charge.user.last_name +
' has already agreed to be Editor-in-charge of this Submission.')
context = {'errormessage': errormessage}
return render(request, 'submissions/accept_or_decline_assignment_ack.html', context)
contributor = Contributor.objects.get(user=request.user)
assignment = EditorialAssignment(submission=submission,
to=contributor,
......@@ -351,25 +399,59 @@ def volunteer_as_EIC(request, submission_id):
submission.open_for_commenting = True
assignment.save()
submission.save()
# Deactivate the other assignments
assignments_to_deactivate = EditorialAssignment.objects.filter(
submission=submission, accepted=None)
for a_to_deact in assignments_to_deactivate:
a_to_deact.deprecated = True
a_to_deact.save()
# Deprecate all other assignments related to this submission
assignments_to_deprecate = EditorialAssignment.objects.filter(
submission=assignment.submission, accepted=None)
for atd in assignments_to_deprecate:
atd.deprecated = True
atd.save()
# Email EIC
email_text = ('Dear ' + title_dict[assignment.to.title] + ' ' +
assignment.to.user.last_name +
', \n\nThank you for accepting to become Editor-in-charge of the SciPost Submission\n\n' +
submission.title + ' by ' + submission.author_list + '.' +
'\n\nYou can take your editorial actions from the editorial page '
'https://scipost.org/submission/editorial_page/' + submission.id +
' (also accessible from your personal page https://scipost.org/personal_page under the Editorial Actions tab).'
'\n\nMany thanks in advance for your collaboration,' +
'\n\nThe SciPost Team.')
emailmessage = EmailMessage(
'SciPost: assignment as EIC', email_text,
'SciPost Editorial Admin <submissions@scipost.org>',
[assignment.to.user.email, 'submissions@scipost.org'],
reply_to=['submissions@scipost.org'])
emailmessage.send(fail_silently=False)
context = {'assignment': assignment}
return render(request, 'submissions/accept_or_decline_assignment_ack.html', context)
@permission_required('scipost.can_take_charge_of_submissions', raise_exception=True)
@permission_required('scipost.can_assign_submissions', raise_exception=True)
def assignment_failed(request, submission_id):
"""
No Editorial Fellow has accepted or volunteered to become Editor-in-charge.
The submission is rejected.
This method is called from assign_submissions.html.
This method is called from pool.html.
"""
submission = get_object_or_404(Submission, pk=submission_id)
# TODO
submission.status = 'assignment_failed'
submission.save()
# Email author
email_text = ('Dear ' + title_dict[submission.submitted_by.title] + ' ' +
submission.submitted_by.user.last_name +
', \n\nYou recent Submission to SciPost,\n\n' +
submission.title + ' by ' + submission.author_list +
'\n\nhas unfortunately not passed the pre-screening stage. '
'We therefore regret to inform you that your paper will not be '
'processed further towards publication.'
'\n\nMany thanks in advance for your collaboration,' +
'\n\nThe SciPost Team.')
emailmessage = EmailMessage(
'SciPost: pre-screening not passed', email_text,
'SciPost Editorial Admin <submissions@scipost.org>',
[submission.submitted_by.user.email, 'submissions@scipost.org'],
reply_to=['submissions@scipost.org'])
emailmessage.send(fail_silently=False)
@permission_required('scipost.can_take_charge_of_submissions', raise_exception=True)
......@@ -402,8 +484,8 @@ def select_referee(request, submission_id):
def recruit_referee(request, submission_id):
"""
If the Editor-in-charge does not find the desired referee among Contributors,
he/she can invite somebody by providing some personal details.
This function sends a registration invitation to this person.
he/she can invite somebody by providing name + contact details.
This function emails a registration invitation to this person.
The pending refereeing invitation is then recognized upon registration,
using the invitation token.
"""
......@@ -420,15 +502,14 @@ def recruit_referee(request, submission_id):
date_invited=timezone.now(),
invited_by = request.user.contributor)
ref_invitation.save()
# Create and send a registration invitation
ref_inv_message_head = ('You have been invited to referee a Submission to SciPost Physics, namely\n' +
submission.title[:50] + '\nby ' + submission.author_list + '.')
ref_inv_message_head = ('You have been invited to referee a Submission to SciPost Physics, namely\n\n' +
submission.title + '\nby ' + submission.author_list + '.')
reg_invitation = RegistrationInvitation (
title = ref_recruit_form.cleaned_data['title'],
first_name = ref_recruit_form.cleaned_data['first_name'],
last_name = ref_recruit_form.cleaned_data['last_name'],
email_address = ref_recruit_form.cleaned_data['email_address'],
email = ref_recruit_form.cleaned_data['email_address'],
invitation_type = 'R',
invited_by = request.user.contributor,
message_style = 'F',
......@@ -446,6 +527,12 @@ def recruit_referee(request, submission_id):
@permission_required('scipost.can_take_charge_of_submissions', raise_exception=True)
def send_refereeing_invitation(request, submission_id, contributor_id):
"""
This method is called by the EIC from the submission's editorial_page,
in the case where the referee is an identified Contributor.
For a referee who isn't a Contributor yet, the method recruit_referee above
is called instead.
"""
submission = get_object_or_404(Submission, pk=submission_id)
contributor = get_object_or_404(Contributor, pk=contributor_id)
invitation = RefereeInvitation(submission=submission,
......@@ -464,7 +551,8 @@ def send_refereeing_invitation(request, submission_id, contributor_id):
submission.title + ' by ' + submission.author_list +
' (see https://scipost.org/submission/' + submission_id + ').'
'\n\nPlease visit https://scipost.org/submissions/accept_or_decline_ref_invitations '
'(login required) in order to accept or decline this invitation.'
'(login required) as soon as possible (ideally within the next 2 days) '
'in order to accept or decline this invitation.'
'\n\nIf you accept, your report can be submitted by simply clicking on the "Contribute a Report" link at '
'https://scipost.org/submission/' + submission_id + ' before the reporting deadline '
'(currently set at ' + datetime.datetime.strftime(submission.reporting_deadline, "%Y-%m-%d") +
......
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