SciPost Code Repository

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

refactor refereeing invitations into partials

add complete table of profile emails in refereeing invitations
parent d312a704
No related branches found
No related tags found
No related merge requests found
<table class="table align-center">
<thead class="table-light align-top">
<tr>
<th>
Name
<br />
<small class="text-muted">Click to add emails etc.</small>
</th>
<th>Registered</th>
<th>
Emails
<br />
<small class="text-muted">Primary, Valid, Verified, Address</small>
</th>
<th>
Accepts
<br />
requests?
</th>
<th>Action</th>
</tr>
</thead>
<tbody>
{% for profile in profiles_found %}
{% include "submissions/_hx_select_referee_table_row.html" %}
{% empty %}
<tr>
<td>No Profiles found</td>
<td></td>
</tr>
{% endfor %}
</tbody>
</table>
<tr>
<td>
<a href="{{ profile.get_absolute_url }}">{{ profile }}</a>
</td>
<td>
{% if profile.contributor %}
<span class="text-success">{% include "bi/check-circle-fill.html" %}</span>
{% else %}
<span class="text-danger">{% include "bi/x-circle-fill.html" %}</span>
{% endif %}
</td>
<td>
{% comment %} {% if profile.email %}
<span class="text-success">{% include "bi/check-circle-fill.html" %}</span> <span class="text-muted">{{ profile.email }}</span>
{% else %}
<span class="text-danger">{% include "bi/x-circle-fill.html" %}</span>
{% endif %} {% endcomment %}
{% if profile.email %}
<table>
{% for email in profile.emails.all %}
<tr>
<td>
{% if email.primary %}
<span class="text-primary" title="Primary">{% include "bi/check-circle-fill.html" %}</span>
{% endif %}
</td>
<td>
{% if email.still_valid %}
<span class="text-success" title="Valid">{% include "bi/check-circle-fill.html" %}</span>
{% else %}
<span class="text-danger" title="Deprecated">{% include "bi/x-circle-fill.html" %}</span>
{% endif %}
</td>
<td>
{% if email.verified %}
<span class="text-success" title="Verified">{% include "bi/check-circle-fill.html" %}</span>
{% else %}
<span class="text-warning" title="Unverified">{% include "bi/question-circle-fill.html" %}</span>
{% endif %}
</td>
<td>{{ email.email }}</td>
{% endfor %}
</table>
{% endif %}
</td>
<td>
{% if profile.accepts_refereeing_requests %}
<span class="text-success">{% include "bi/check-circle-fill.html" %}</span>
{% else %}
<span class="text-danger">{% include "bi/x-circle-fill.html" %}</span>
{% endif %}
</td>
<td>
{% if profile.accepts_refereeing_requests %}
{% if profile.email %}
Send refereeing invitation <a href="{% url 'submissions:invite_referee' identifier_w_vn_nr=submission.preprint.identifier_w_vn_nr profile_id=profile.id auto_reminders_allowed=1 %}">with</a> or <a href="{% url 'submissions:invite_referee' identifier_w_vn_nr=submission.preprint.identifier_w_vn_nr profile_id=profile.id auto_reminders_allowed=0 %}">without</a> auto-reminders.
{% include "submissions/_refinv_auto_reminders_tooltip.html" %}
{% else %}
<span class="text-danger">Cannot send an invitation without an email.</span>
<a href="{{ profile.get_absolute_url }}">Add one here!</a>
{% endif %}
{% else %}
<span class="text-danger">This person does not accept refereeing requests</span>
{% endif %}
</td>
</tr>
{% with profile.responsiveness_as_referee as stats %}
{% if stats.sent %}
<tr>
<td colspan="5">
<em class="ms-4">
{% include "bi/arrow-return-right.html" %}
&nbsp;
Responsiveness (last 5 years) --
Sent: {{ stats.sent }},&nbsp;
Accepted: {{ stats.accepted }},&nbsp;
Declined: {{ stats.declined }},&nbsp;
Cancelled: {{ stats.cancelled }},&nbsp;
Fulfilled: {{ stats.fulfilled }}
</em>
</td>
</tr>
{% endif %}
{% endwith %}
</tr>
<button type="button" class="btn btn-link p-0" data-bs-toggle="tooltip" data-bs-html="true" title="In case of no response to initial invitation, reminders will be sent automatically after 2, then 4 weekdays (with cc to EIC).<br>If there is no response after a week, you (as EIC) will be notified.<br>If accepted, a reminder will be sent to the referee 1 week before deadline.">
<button type="button" class="btn btn-link p-0" data-bs-toggle="tooltip" data-bs-html="true" title="In case of no response to initial invitation, reminders will be sent automatically after 2, then 4 weekdays (with cc to EIC).<br>
If there is no response after a week, you (as EIC) will be notified.<br>
If accepted, a reminder will be sent to the referee 1 week before deadline.">
{% include 'bi/info-circle-fill.html' %}
</button>
......@@ -41,6 +41,19 @@
<div class="col-12">
<h2 class="highlight" id="form">Select an additional Referee</h2>
{% if workdays_left_to_report < 15 %}
<div class="mb-3 p-3 border border-danger border-2">
<span class="text-warning">{% include 'bi/exclamation-triangle-fill.html' %}</span>
<strong class="text-danger">
Warning: there are {{ workdays_left_to_report }} working days left before the refereeing deadline.
</strong>
<div class="my-2">Standard refereeing period for {{ submission.submitted_to }}: <strong>{{ submission.submitted_to.refereeing_period.days }} days</strong>.</div>
Consider resetting the refereeing deadline at the <a href="{% url 'submissions:editorial_page' identifier_w_vn_nr=submission.preprint.identifier_w_vn_nr %}">Editorial Page</a> before inviting a referee.
</div>
{% endif %}
<form action="{% url 'submissions:select_referee' identifier_w_vn_nr=submission.preprint.identifier_w_vn_nr %}" method="get">
{{ referee_search_form|bootstrap }}
<input class="btn btn-primary" type="submit" value="Find referee">
......@@ -72,81 +85,10 @@
<div class="row">
<div class="col-12">
{% if workdays_left_to_report < 15 %}
<div class="my-5 p-3 border border-danger" style="border-width: 2px !important;">
<span class="text-warning">{% include 'bi/exclamation-triangle-fill.html' %}</span>
<strong class="text-danger">
Warning: there are {{ workdays_left_to_report }} working days left before the refereeing deadline.
</strong>
<div class="my-2">Standard refereeing period for {{ submission.submitted_to }}: <strong>{{ submission.submitted_to.refereeing_period.days }} days</strong>.</div>
Consider resetting the refereeing deadline at the <a href="{% url 'submissions:editorial_page' identifier_w_vn_nr=submission.preprint.identifier_w_vn_nr %}">Editorial Page</a> before inviting a referee.
</div>
{% endif %}
{% if profiles_found %}
<h3 class="mt-4">Matching people in our database:</h3>
<table class="table table-light table-hover v-center">
<thead class="table-light">
<tr>
<th>Name<br/><br/></th>
<th>Registered<br>Contributor?<br/><br/></th>
<th>Email<br>known?<br/><br/></th>
<th>Accepts<br/>requests?</th>
<th>Action<br/><span class="text-muted fw-normal">(Unregistered people will also automatically receive a registration invitation)</span></th>
</tr>
</thead>
<tbody>
{% for profile in profiles_found %}
<tr>
<td><a href="{{ profile.get_absolute_url }}">{{ profile }}</a></td>
<td>{% if profile.contributor %}<span class="text-success">{% include 'bi/check-circle-fill.html' %}</span>{% else %}<span class="text-danger">{% include 'bi/x-circle-fill.html' %}</span>{% endif %}</td>
<td>{% if profile.email %}<span class="text-success">{% include 'bi/check-circle-fill.html' %}</span> <span class="text-muted">{{ profile.email }}</span>{% else %}<span class="text-danger">{% include 'bi/x-circle-fill.html' %}</span>{% endif %}</td>
<td>
{% if profile.accepts_refereeing_requests %}
<span class="text-success">{% include 'bi/check-circle-fill.html' %}</span>{% else %}<span class="text-danger">{% include 'bi/x-circle-fill.html' %}</span>
{% endif %}
</td>
<td>
{% if profile.accepts_refereeing_requests %}
{% if profile.email %}
Send refereeing invitation <a href="{% url 'submissions:invite_referee' identifier_w_vn_nr=submission.preprint.identifier_w_vn_nr profile_id=profile.id auto_reminders_allowed=1 %}">with</a> or <a href="{% url 'submissions:invite_referee' identifier_w_vn_nr=submission.preprint.identifier_w_vn_nr profile_id=profile.id auto_reminders_allowed=0 %}">without</a> auto-reminders. {% include 'submissions/_refinv_auto_reminders_tooltip.html' %}
{% else %}
<span class="text-danger">Cannot send an invitation without an email</span>
{% endif %}
{% else %}
<span class="text-danger">This person does not accept refereeing requests</span>
{% endif %}
</td>
</tr>
{% with profile.responsiveness_as_referee as stats %}
{% if stats.sent %}
<tr>
<td colspan="5">
<em class="ms-4">
{% include "bi/arrow-return-right.html" %}&nbsp;
Responsiveness (last 5 years) --
Sent: {{ stats.sent }},&nbsp;
Accepted: {{ stats.accepted }},&nbsp;
Declined: {{ stats.declined }},&nbsp;
Cancelled: {{ stats.cancelled }},&nbsp;
Fulfilled: {{ stats.fulfilled }}
</em>
</td>
</tr>
{% endif %}
{% endwith %}
{% empty %}
<tr>
<td>No Profiles found</td>
<td></td>
</tr>
{% endfor %}
</tbody>
</table>
<h3 class="mt-4">Matching Profiles in our database:</h3>
{% include "submissions/_hx_select_referee_table.html" %}
{% endif %}
{% if profile_form %}
<h3 class="mb-3 mt-5">Not found? Then add to our database by filling this form:</h3>
<form action="{% url 'submissions:add_referee_profile' identifier_w_vn_nr=submission.preprint.identifier_w_vn_nr %}" method="post">
......
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