SciPost Code Repository

Skip to content
Snippets Groups Projects
Commit 6b4546af authored by George Katsikas's avatar George Katsikas :goat:
Browse files

add manual EIC invitation mail to sub pool

fixes #137
parent b38f83ff
No related branches found
No related tags found
No related merge requests found
{% load crispy_forms_tags %} {% load crispy_forms_tags %}
<td colspan="7"> <td colspan="8">
<form hx-post="{% url "ethics:_hx_submission_competing_interest_create" identifier_w_vn_nr fellowship_id %}" <form hx-post="{% url "ethics:_hx_submission_competing_interest_create" identifier_w_vn_nr fellowship_id %}"
hx-target="closest tr" hx-target="closest tr"
hx-swap="outerHTML"> hx-swap="outerHTML">
......
{% load submissions_pool %} {% load submissions_pool %}
{% load ethics_extras %} {% load ethics_extras %}
{% get_fellow_readiness submission fellowship as readiness %}
<tr> <tr>
<td> <td>
<a href="{{ fellowship.get_absolute_url }}">{{ fellowship.contributor }}</a> <a href="{{ fellowship.get_absolute_url }}">{{ fellowship.contributor }}</a>
...@@ -85,9 +87,17 @@ ...@@ -85,9 +87,17 @@
hx-get="{% url 'colleges:_hx_submission_remove_fellowship' submission.preprint.identifier_w_vn_nr fellowship.id %}" hx-get="{% url 'colleges:_hx_submission_remove_fellowship' submission.preprint.identifier_w_vn_nr fellowship.id %}"
hx-confirm="Remove this Fellow from this Submission's Fellowship?" hx-confirm="Remove this Fellow from this Submission's Fellowship?"
hx-target="#submission-{{ submission.pk }}-fellows-details">{% include "bi/trash-fill.html" %}</a> hx-target="#submission-{{ submission.pk }}-fellows-details">{% include "bi/trash-fill.html" %}</a>
{% if readiness.status != 'desk_reject' %}
<a class="btn btn-sm btn-primary px-1 py-0"
href="{% url "submissions:pool:manual_EIC_invitation" submission.preprint.identifier_w_vn_nr fellowship.id %}">
{% include "bi/envelope-fill.html" %}
</a>
{% endif %}
</td> </td>
{% endif %} {% endif %}
{% endif %} {% endif %}
<td>{% get_fellow_readiness_status_display submission fellowship %}</td> <td>{{ readiness.get_status_display }}</td>
</tr> </tr>
...@@ -74,6 +74,11 @@ urlpatterns = [ # building on /submissions/pool/ ...@@ -74,6 +74,11 @@ urlpatterns = [ # building on /submissions/pool/
] ]
), ),
), ),
path(
"manual_EIC_invitation/<int:pk>",
views_base.EICManualEICInvitationEmailView.as_view(),
name="manual_EIC_invitation",
),
] ]
), ),
), ),
......
...@@ -7,7 +7,9 @@ from django.contrib.auth.decorators import login_required ...@@ -7,7 +7,9 @@ from django.contrib.auth.decorators import login_required
from django.core.paginator import Paginator from django.core.paginator import Paginator
from django.db import transaction from django.db import transaction
from django.shortcuts import get_object_or_404, render, redirect from django.shortcuts import get_object_or_404, render, redirect
from django.urls import reverse from django.urls import reverse, reverse_lazy
from mails.views import MailView
from scipost.mixins import PermissionsMixin
from scipost.models import Remark from scipost.models import Remark
from scipost.forms import RemarkForm from scipost.forms import RemarkForm
...@@ -249,3 +251,30 @@ def editorial_assignment(request, identifier_w_vn_nr, assignment_id=None): ...@@ -249,3 +251,30 @@ def editorial_assignment(request, identifier_w_vn_nr, assignment_id=None):
"assignment": assignment, "assignment": assignment,
} }
return render(request, "submissions/pool/editorial_assignment.html", context) return render(request, "submissions/pool/editorial_assignment.html", context)
class EICManualEICInvitationEmailView(PermissionsMixin, MailView):
"""Send a templated email to a Potential Fellow."""
permission_required = "scipost.can_manage_college_composition"
mail_code = "eic/manual_EIC_invitation"
success_url = reverse_lazy("submissions:pool:pool")
def get_queryset(self):
"""Return the fellows of this submission."""
self.fellowship = get_object_or_404(Fellowship, pk=self.kwargs["pk"])
self.submission = get_object_or_404(
Submission.objects.in_pool(self.fellowship.contributor.user),
preprint__identifier_w_vn_nr=self.kwargs["identifier_w_vn_nr"],
)
return self.submission.fellows.all()
def get_mail_config(self):
config = super().get_mail_config()
config["fellowship"] = self.fellowship
config["submission"] = self.submission
config["signee"] = self.request.user.contributor.profile
return config
<svg xmlns="http://www.w3.org/2000/svg"
width="16"
height="16"
fill="currentColor"
class="bi bi-envelope-fill"
viewBox="0 0 16 16">
<path d="M.05 3.555A2 2 0 0 1 2 2h12a2 2 0 0 1 1.95 1.555L8 8.414.05 3.555ZM0 4.697v7.104l5.803-3.558L0 4.697ZM6.761 8.83l-6.57 4.027A2 2 0 0 0 2 14h12a2 2 0 0 0 1.808-1.144l-6.57-4.027L8 9.586l-1.239-.757Zm3.436-.586L16 11.801V4.697l-5.803 3.546Z" />
</svg>
{% load submissions_pool %}
{% load ethics_extras %}
{% get_fellow_qualification submission fellowship as qualification %}
{% get_fellow_readiness submission fellowship as readiness %}
{% get_profile_clearance submission.clearances fellowship.contributor.profile as clearance %}
<p>Dear {{ fellowship.contributor.profile.get_title_display }} {{ fellowship.contributor.profile.last_name }},</p>
<p>
We are writing this email to point your attention to the following SciPost submission entitled <a href="https://{{ domain }}{{ submission.get_absolute_url }}">{{ submission.title }}</a> by {{ submission.author_list }}. This submission has been waiting for an Editor in Charge (EIC) for some time now, prompting us to help guide the process along.
</p>
<p>
{% if not qualification or not readiness %}
{% comment %} For fellows who haven't yet appraised {% endcomment %}
Based on your previous commitments as EIC, we believe that you might be well suited to take charge of this submission. Considering the time that has passed since the paper was initially submitted, we would like to ask you to consider supervising the submission via the <a href="https://{{ domain }}{% url 'submissions:pool:pool' %}">Submissions Pool</a>. Please also indicate in the pool if you are unable to take on this task, be it due to qualifications or possible competing interests, as this will help us accelerate the process and find a suitable EIC.
{% else %}
{% comment %} For fellows who have appraised {% endcomment %}
We noticed that, at the time of submission, you mentioned that
{% if readiness.status == "perhaps_later" and qualification.expertise_level == "marginally_qualified" %}
you were interested but (only) marginally qualified to supervise refereeing on the subject matter.
{% elif readiness.status == "perhaps_later" or readiness.status == "too_busy" %}
you were interested but did not have the time to take charge at that moment.
{% elif readiness.status == "could_if_transferred" or readiness.status == "not_interested" %}
you were not very interested in it given its state.
{% endif %}
Considering the time that has passed since then, we would like to ask you to reconsider taking charge of the submission.
{% endif %}
</p>
<p>
If you are unavailable or believe that you are not really qualified to take charge of this submission, do you perhaps have any recommendations for other fellows that might be interested in this submission?
</p>
<p>
Finally, we would also like to thank you for your continued efforts for SciPost, and we hope to hear back from you.
</p>
<p>
With kind regards,
<br />
{{ signee.first_name }} {{ signee.last_name }}, on behalf of the SciPost EdAdmin Team.
</p>
{% include 'email/_footer.html' %}
{% include 'email/_submission_thread_uuid.html' with submission=submission %}
{
"subject": "SciPost: Invitation to take charge of a Submission",
"recipient_list": [
"contributor.user.email"
],
"bcc": [
"submissions@"
],
"from_name": "SciPost Editorial Admin",
"from_email": "submissions@"
}
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