SciPost Code Repository

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

Improve email fellow tasklist

parent 19641cd3
No related branches found
No related tags found
No related merge requests found
......@@ -14,12 +14,16 @@ class Command(BaseCommand):
).order_by('user__last_name')
for fellow in fellows:
submissions_as_eic = Submission.objects.filter_for_eic(
fellow.user).order_by('submission_date')
assignments_to_consider = EditorialAssignment.objects.open().filter(
to=fellow)
if submissions_as_eic or assignments_to_consider:
SubmissionUtils.load({'fellow': fellow,
'submissions_as_eic': submissions_as_eic,
'assignments_to_consider': assignments_to_consider,})
assignments_ongoing = fellow.editorial_assignments.ongoing()
assignments_to_consider = fellow.editorial_assignments.open()
assignments_upcoming_deadline = fellow.editorial_assignments_deadline_within(days=7)
if assignments_ongoing or assignments_to_consider or assignments_upcoming_deadline:
SubmissionUtils.load(
{
'fellow': fellow,
'assignments_ongoing': assignments_ongoing,
'assignments_to_consider': assignments_to_consider,
'assignments_upcoming_deadline': assignments_upcoming_deadline,
}
)
SubmissionUtils.email_Fellow_tasklist()
......@@ -50,7 +50,7 @@ class SubmissionQuerySet(models.QuerySet):
def _pool(self, user):
"""
This filter creates 'the complete pool' for an user. This new-style pool does
This filter creates 'the complete pool' for a user. This new-style pool does
explicitly not have the author filter anymore, but registered pools for every Submission.
!!! IMPORTANT SECURITY NOTICE !!!
......@@ -256,6 +256,11 @@ class EditorialAssignmentQuerySet(models.QuerySet):
def open(self):
return self.filter(accepted=None, deprecated=False)
def refereeing_deadline_within(self, days=7):
return self.exclude(
submission__reporting_deadline_gt=timezone.now() + timezone.timedelta(days=days)
).exclude(submission__reporting_deadline_lt=timezone.now())
class EICRecommendationQuerySet(models.QuerySet):
def get_for_user_in_pool(self, user):
......
{% load bootstrap %}
{% load submissions_extras %}
<p>Dear {{ fellow.get_title_display }} {{ fellow.user.last_name }},</p>
<p>Please find below a digest of your pending and upcoming required actions as SciPost Fellow. Many thanks in advance for your timely invervention.</p>
<p>Please find below a digest of your current assignments, with pending and upcoming required actions. Many thanks in advance for your timely invervention.</p>
{% if assignments_to_consider %}
<h3>Assignments for you to consider:</h3>
<ul>
......@@ -11,21 +12,38 @@
{% endfor %}
</ul>
{% endif %}
{% if submissions_as_eic %}
<h3>Submissions for which you are Editor-in-charge:</h3>
{% if assignments_ongoing %}
<h3>Current assignments (Submissions for which you are Editor-in-charge):</h3>
<ul>
{% for submission in submissions_as_eic %}
<li>
<div class="pool-item">
<p class="mb-1">
<a href="{% url 'submissions:pool' submission.arxiv_identifier_w_vn_nr %}">{{ submission.title }}</a><br>
<em>by {{ submission.author_list }}</em>
</p>
<p><a href="{% url 'submissions:editorial_page' submission.arxiv_identifier_w_vn_nr %}">Go to this Submission's Editorial page</a></p>
{% include 'submissions/_required_actions_block.html' with submission=submission %}
</div>
</li>
{% endfor %}
{% for assignment in assignments_ongoing %}
<li>
<div class="pool-item">
<p class="mb-1">
<a href="{% url 'submissions:pool' assignment.submission.arxiv_identifier_w_vn_nr %}">{{ assignment.submission.title }}</a><br>
<em>by {{ assignment.submission.author_list }}</em>
</p>
<p><a href="{% url 'submissions:editorial_page' assignment.submission.arxiv_identifier_w_vn_nr %}">Go to this Submission's Editorial page</a></p>
{% include 'submissions/_required_actions_block.html' with submission=assignment.submission %}
</div>
</li>
{% endfor %}
</ul>
{% endif %}
{% if assignments_upcoming_deadline %}
<h3>Upcoming refereeing deadlines:</h3>
<ul>
{% for assignment in assignments_upcoming_deadline %}
<li>
<div class="pool-item">
<p class="mb-1">
<a href="{% url 'submissions:pool' assignment.submission.arxiv_identifier_w_vn_nr %}">{{ assignment.submission.title }}</a><br>
<em>by {{ assignment.submission.author_list }}</em>
</p>
<p>Refereeing deadline: {{ assignment.submission.reporting_deadline|date:"Y-m-d" }}.</p>
<p><a href="{% url 'submissions:editorial_page' assignment.submission.arxiv_identifier_w_vn_nr %}">Go to this Submission's Editorial page</a></p>
</div>
</li>
{% endfor %}
</ul>
{% endif %}
<p>
......
{% load submissions_extras %}
Dear {{ fellow.get_title_display }} {{ fellow.user.last_name }},\n\n
Please find below a digest of your pending and upcoming required actions as SciPost Fellow. Many thanks in advance for your timely invervention.\n\n
Please find below a digest of your current assignments, with pending and upcoming required actions. Many thanks in advance for your timely invervention.\n\n
{% if assignments_to_consider %}
Assignments for you to consider:\n\n
{% for assignment in assignments_to_consider %}
......@@ -8,14 +8,14 @@ On submission: {{ assignment.submission }}\n
Accept or decline at {% url 'submissions:assignment_request' assignment.id %}"
{% endfor %}
{% endif %}
{% if submissions_as_eic %}
Submissions for which you are Editor-in-charge:\n\n
{% for submission in submissions_as_eic %}
{{ submission.title }}\n
by {{ submission.author_list }}\n\n
{% if submission.cycle.has_required_actions %}
{% if assignments_ongoing %}
Current assignments (Submissions for which you are Editor-in-charge):\n\n
{% for assignment in assignments_ongoing %}
{{ assignment.submission.title }}\n
by {{ assignment.submission.author_list }}\n\n
{% if assignment.submission.cycle.has_required_actions %}
Required actions:\n
{% for action in submission.cycle.get_required_actions %}
{% for action in assignment.submission.cycle.get_required_actions %}
{{action.1}}\n
{% empty %}
No actions required\n
......@@ -24,6 +24,15 @@ No actions required\n
{% endfor %}
{% endif %}
\n
{% if assignments_upcoming_deadline %}
Upcoming refereeing deadlines:\n\n
{% for assignment in assignments_upcoming_deadline %}
{{ assignment.submission.title }}\n
by {{ assignment.submission.author_list }}\n
Refereeing deadline: {{ assignment.submission.reporting_deadline|date:"Y-m-d" }}.\n
{% endfor %}
{% endif %}
\n
You can take action on all of these starting from your personal page at https://scipost.org/personal_page. Don't hesitate to email the editorial administration at edadmin@scipost.org if you need any assistance.\n\n
Many thanks,\n
The SciPost Team.
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