SciPost Code Repository

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

Add assignments page, required_actions for submissions

parent ed9fd142
No related branches found
No related tags found
No related merge requests found
......@@ -15,5 +15,6 @@ UPLOADS
docs/_build
local_files
static/
whoosh_index
\ No newline at end of file
......@@ -299,6 +299,7 @@
<h3>Submissions assignments</h3>
<ul>
{% if perms.scipost.can_view_pool %}
<li><a href="{% url 'submissions:assignments' %}">Your assignments</a></li>
<li><a href="{% url 'scipost:Fellow_activity_overview' %}">View assignments overview</a></li>
{% endif %}
{% if perms.scipost.can_assign_submissions %}
......
{% extends 'scipost/base.html' %}
{% block pagetitle %}: 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();
}
});
$(".submitRemarkForm").hide();
$(".submitRemarkButton").click( function() {
$(this).next("div").toggle();
});
});
</script>
{% load guardian_tags %}
{% load scipost_extras %}
{% load submissions_extras %}
{% if assignments_to_consider %}
<section>
{% 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 %}
{{ consider_assignment_form.accept }}
<div id="ref_reason">
<p>Please select a reason for declining this assignment:</p>
{{ consider_assignment_form.refusal_reason }}
</div>
<input type="submit" value="Submit" />
</form>
<hr class="hr6"/>
{% endfor %}
</section>
<hr class="hr12"/>
{% endif %}
{% if current_assignments %}
<section>
<div class="flex-container">
<div class="flex-greybox">
<h1>Your current assignments:</h1>
</div>
</div>
<ul>
{% for assignment in current_assignments %}
{{ assignment.submission.header_as_li_for_Fellows }}
<div class="flex-container">
<div class-"flex-whitebox" style="background-color: #ffaaaa;">
<h3>Required actions:</h3>
<ul>
{% for todoitem in assignment.submission|required_actions %}
<li>{{ todoitem }}</li>
{% endfor %}
</ul>
</div>
</div>
<h4><a href="{% url 'submissions:editorial_page' arxiv_identifier_w_vn_nr=assignment.submission.arxiv_identifier_w_vn_nr %}">
Go to this Submission's Editorial Page</a></h4>
{% endfor %}
</ul>
</section>
{% else %}
<section>
<p>You currently have no assignments to take care of.</p>
</section>
{% endif %}
{% endblock bodysup %}
......@@ -252,6 +252,17 @@ $(document).ready(function(){
</div>
{% get_obj_perms request.user for sub as "sub_perms" %}
{% if "can_take_editorial_actions" in sub_perms or request.user|is_in_group:'Editorial Administrators' %}
<br/>
<div class="flex-container">
<div class-"flex-whitebox" style="background-color: #ffaaaa;">
<h3>Required actions:</h3>
<ul>
{% for todoitem in sub|required_actions %}
<li>{{ todoitem }}</li>
{% endfor %}
</ul>
</div>
</div>
<h4><a href="{% url 'submissions:editorial_page' arxiv_identifier_w_vn_nr=sub.arxiv_identifier_w_vn_nr %}">
Go to this Submission's Editorial Page</a></h4>
{% endif %}
......
from django import template
from django.utils import timezone
from submissions.models import Submission
......@@ -19,3 +20,39 @@ def is_viewable_by_authors(recommendation):
return recommendation.submission.status in ['revision_requested', 'resubmitted',
'accepted', 'rejected',
'published', 'withdrawn']
@register.filter(name='required_actions')
def required_actions(submission):
"""
This method returns a list of required actions on a Submission.
Each list element is a textual statement.
"""
todo = []
for comment in submission.comment_set.all():
if comment.status == 0:
todo.append('A Comment from %s has been delivered but is not yet vetted. '
'Please vet it.' % comment.author)
nr_ref_inv = submission.refereeinvitation_set.count()
if nr_ref_inv == 0:
todo.append('No Referees have yet been invited. '
'At least 3 should be.')
elif nr_ref_inv < 3:
todo.append('Only %s Referees have been invited. '
'At least 3 should be.' % nr_ref_inv)
for ref_inv in submission.refereeinvitation_set.all():
if ref_inv.accepted is None:
todo.append('Referee %s has not yet responded. Consider sending a reminder '
'or cancelling the invitation.' % ref_inv.referee)
if ref_inv.accepted and not ref_inv.fulfilled and not ref_inv.cancelled:
todo.append('Referee %s has accepted to send a Report, '
'but not yet delivered it. Consider sending a '
'reminder.' % ref_inv.referee)
if submission.reporting_deadline > timezone.now():
todo.append('The refereeing deadline has passed. Please either extend it, '
'or formulate your Editorial Recommendation.')
reports = submission.report_set.all()
for report in reports:
if report.status == 0:
todo.append('The Report from %s has been delivered but is not yet vetted. '
'Please vet it.' % report.author)
return todo
......@@ -39,6 +39,7 @@ urlpatterns = [
views.assignment_failed, name='assignment_failed'),
# Editorial workflow and refereeing
url(r'^editorial_workflow$', views.editorial_workflow, name='editorial_workflow'),
url(r'^assignments$', views.assignments, name='assignments'),
url(r'^editorial_page/(?P<arxiv_identifier_w_vn_nr>[0-9]{4,}.[0-9]{5,}v[0-9]{1,2})$',
views.editorial_page, name='editorial_page'),
url(r'^select_referee/(?P<arxiv_identifier_w_vn_nr>[0-9]{4,}.[0-9]{5,}v[0-9]{1,2})$',
......
......@@ -708,6 +708,28 @@ def assignment_failed(request, arxiv_identifier_w_vn_nr):
return render(request, 'submissions/assignment_failed.html', context)
@login_required
@permission_required('scipost.can_take_charge_of_submissions', raise_exception=True)
def assignments(request):
"""
This page provides a Fellow with an explicit task list
of editorial actions which should be undertaken.
"""
assignments = EditorialAssignment.objects.filter(
to=request.user.contributor).order_by('-date_created')
assignments_to_consider = assignments.filter(accepted=None,
deprecated=False)
current_assignments = assignments.filter(accepted=True,
deprecated=False,
completed=False)
consider_assignment_form = ConsiderAssignmentForm()
context = {'assignments_to_consider': assignments_to_consider,
'consider_assignment_form': consider_assignment_form,
'current_assignments': current_assignments,
}
return render(request, 'submissions/assignments.html', context)
@login_required
@permission_required_or_403('can_take_editorial_actions',
(Submission, 'arxiv_identifier_w_vn_nr', 'arxiv_identifier_w_vn_nr'))
......
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