diff --git a/scipost_django/scipost/templates/scipost/personal_page/_hx_refereeing.html b/scipost_django/scipost/templates/scipost/personal_page/_hx_refereeing.html index 5de492e1acfd4e11090c2639d9c8893ec246d4aa..b1c9f56283b9d0eefadf5ada16ebc94a1e47b642 100644 --- a/scipost_django/scipost/templates/scipost/personal_page/_hx_refereeing.html +++ b/scipost_django/scipost/templates/scipost/personal_page/_hx_refereeing.html @@ -1,110 +1,49 @@ {% include 'scipost/personal_page/_hx_tablist.html' with selected='refereeing' %} - -<div class="row"> - <div class="col-12"> - <div class="card bg-light"> - <div class="card-body"> - <h2 class="card-title">Refereeing Tasks</h2> - <ul class="mb-0"> - <li><a href="{% url 'submissions:accept_or_decline_ref_invitations' %}">Accept/decline refereeing invitations</a> ({{ contributor.referee_invitations.open.count }})</li> - </ul> - </div> - </div> - </div> -</div> - -{% if contributor.reports.in_draft.all %} - <div class="row"> - <div class="col-12"> - <h3 class="highlight">Unfinished reports:</h3> - <ul class="list-group list-group-flush"> - {% for report in contributor.reports.in_draft.all %} - <li class="list-group-item"> - <div class="card-body px-0"> - {% include 'submissions/_submission_li.html' with submission=report.submission %} - <a class="btn btn-outline-primary my-2" href="{% url 'submissions:submit_report' report.submission.preprint.identifier_w_vn_nr %}">Finish report</a> - </div> - </li> - {% endfor %} - </ul> - </div> - </div> -{% endif %} - +{% include 'submissions/_refereeing_invitations_ongoing.html' with contributor=request.user.contributor %} <div class="row"> <div class="col-12"> <h3 class="highlight">Refereeing Invitations</h3> {% if contributor.referee_invitations.all %} - <h3 class="mt-4">Pending Refereeing Invitations</h3> - {% if contributor.referee_invitations.in_process.all %} - <ul class="list-group list-group-flush"> - {% for invitation in contributor.referee_invitations.in_process.all %} + <details class="p-2"> + <summary>See all your refereeing invitations ({{ contributor.referee_invitations.all|length }})</summary> + <ul class="list-group list-group-flush ms-md-4"> + {% for invitation in contributor.referee_invitations.all %} <li class="list-group-item py-2"> {% include 'submissions/_submission_li.html' with submission=invitation.submission %} <table> - <tr> - <th style='min-width: 100px;'>Due:</th> - <td>{{ invitation.submission.reporting_deadline|date:'d F Y' }}{% if invitation.submission.reporting_deadline_has_passed %} <span class="label label-sm label-danger ms-2 px-3">overdue</span> {% endif %}<td> - </tr> - <tr> - <th>Status:</th> + <tr> + <th style='min-width: 100px;'>Status:</th> <td>{{ invitation.get_status_display }}</td> - </tr> - {% if invitation.accepted is not None %} + </tr> + {% if invitation.accepted is not None %} <tr> <th>{{ invitation.accepted|yesno:'Accepted,Declined' }}:</th> <td>{{ invitation.date_responded }}</td> </tr> - {% endif %} - <tr> - <td colspan="2"> - <a class="d-inline-block" href="{% url 'submissions:submit_report' identifier_w_vn_nr=invitation.submission.preprint.identifier_w_vn_nr %}">Submit your Report</a> <span class="text-blue">|</span> - <a class="d-inline-block" href="{% url 'submissions:communication' identifier_w_vn_nr=invitation.submission.preprint.identifier_w_vn_nr comtype='RtoE' referee_id=request.user.contributor.id %}">Write to the Editor-in-charge</a> - </td> - </tr> + {% endif %} + {% if invitation.related_report %} + <tr> + <th>Report:</th> + <td><a href="{{ invitation.related_report.get_absolute_url }}">{{ invitation.related_report.citation|default:'Link' }}</a></td> + </tr> + {% endif %} </table> </li> + {% empty %} + <li>None found</li> {% endfor %} - </ul> - {% else %} - <p><em>You do not have any pending refereeing task</em></p> - {% endif %} - - <br> - <h3><button type="button" class="btn btn-link p-0" data-bs-toggle="toggle" data-bs-target="#all-invitations"><small>+ See all Refereeing Invitations ({{ contributor.referee_invitations.all|length }})</small></button></h3> - <ul class="list-group list-group-flush ms-md-4" id="all-invitations" style="display: none;"> - {% for invitation in contributor.referee_invitations.all %} - <li class="list-group-item py-2"> - {% include 'submissions/_submission_li.html' with submission=invitation.submission %} - <table> - <tr> - <th style='min-width: 100px;'>Status:</th> - <td>{{ invitation.get_status_display }}</td> - </tr> - {% if invitation.accepted is not None %} - <tr> - <th>{{ invitation.accepted|yesno:'Accepted,Declined' }}:</th> - <td>{{ invitation.date_responded }}</td> - </tr> - {% endif %} - {% if invitation.related_report %} - <tr> - <th>Report:</th> - <td><a href="{{ invitation.related_report.get_absolute_url }}">{{ invitation.related_report.citation|default:'Link' }}</a></td> - </tr> - {% endif %} - </table> - </li> - {% endfor %} - </ul> + </ul> + </details> {% else %} - <p><em>You do not have any refereeing invitation</em></p> + <p><em>No refereeing invitation found</em></p> {% endif %} </div> </div> + + {% if contributor.reports.non_draft.all %} <div class="row"> <div class="col-12"> @@ -113,9 +52,6 @@ <ul class="list-group list-group-flush"> {% for report in contributor.reports.non_draft.all %} <li class="list-group-item"> - {% comment %} - Temporary: There is already a template for a "Report summary" in a parallel (unmerged) branch. Awaiting merge to use that template. - {% endcomment %} <div class="card-body px-0 {% block cardblock_class_block %}{% endblock %}"> <h3>Report on Submission <a href="{{ report.submission.get_absolute_url }}">{{ report.submission.title }}</a></h3> <table> diff --git a/scipost_django/scipost/templates/scipost/portal/_hx_submissions_base.html b/scipost_django/scipost/templates/scipost/portal/_hx_submissions_base.html index b97791602e9b533784439ac37c4beafadbd207ee..891d741732ce2d60ad9b8000ccbb77db056148b5 100644 --- a/scipost_django/scipost/templates/scipost/portal/_hx_submissions_base.html +++ b/scipost_django/scipost/templates/scipost/portal/_hx_submissions_base.html @@ -2,6 +2,14 @@ {% load crispy_forms_tags %} + +{% if name == 'reports_needed' %} + {% if request.user.contributor %} +{% include 'submissions/_refereeing_invitations_ongoing.html' with contributor=request.user.contributor %} + {% endif %} +{% endif %} + + <div class="d-flex justify-content-between"> <button class="btn btn-outline-primary" data-bs-toggle="collapse" data-bs-target="#{{ name }}Search" aria-expanded="false" aria-controls="{{ name }}Search"> {% include 'bi/search.html' %} Simple search / filter diff --git a/scipost_django/submissions/templates/submissions/_refereeing_invitations_ongoing.html b/scipost_django/submissions/templates/submissions/_refereeing_invitations_ongoing.html new file mode 100644 index 0000000000000000000000000000000000000000..aa8e42ab20f0577a9678f1b97a33a040409f51ed --- /dev/null +++ b/scipost_django/submissions/templates/submissions/_refereeing_invitations_ongoing.html @@ -0,0 +1,58 @@ +{% if contributor.referee_invitations.awaiting_response %} + <div class="border border-2 border-danger m-2 mb-4"> + <h3 class="highlight mt-0">Refereeing invitations awaiting your response</h3> + <ul> + <li><a href="{% url 'submissions:accept_or_decline_ref_invitations' %}">Accept/decline refereeing invitations</a> ({{ contributor.referee_invitations.awaiting_response|length }})</li> + </ul> + </div> +{% endif %} +{% if contributor.reports.in_draft.all %} + <div class="border border-2 border-danger p-0 m-2"> + <h3 class="highlight mt-0">Your unfinished Reports</h3> + <ul class="list-group m-2"> + {% for report in contributor.reports.in_draft.all %} + <li class="list-group-item"> + <div class="card-body"> + {% include 'submissions/_submission_li.html' with submission=report.submission %} + <a class="btn btn-outline-primary my-2" href="{% url 'submissions:submit_report' report.submission.preprint.identifier_w_vn_nr %}">Finish Report</a> + </div> + </li> + {% endfor %} + </ul> + </div> +{% endif %} + +{% if contributor.referee_invitations.in_process.all %} + <div class="border border-2 border-warning m-2 mb-4"> + <h3 class="highlight mt-0">Your pending refereeing invitations</h3> + <ul class="list-group m-2"> + {% for invitation in contributor.referee_invitations.in_process.all %} + <li class="list-group-item p-2"> + {% include 'submissions/_submission_li.html' with submission=invitation.submission %} + <table> + <tr> + <th style='min-width: 100px;'>Due:</th> + <td>{{ invitation.submission.reporting_deadline|date:'d F Y' }}{% if invitation.submission.reporting_deadline_has_passed %} <span class="label label-sm label-danger ms-2 px-3">overdue</span> {% endif %}<td> + </tr> + <tr> + <th>Status:</th> + <td>{{ invitation.get_status_display }}</td> + </tr> + {% if invitation.accepted is not None %} + <tr> + <th>{{ invitation.accepted|yesno:'Accepted,Declined' }}:</th> + <td>{{ invitation.date_responded }}</td> + </tr> + {% endif %} + <tr> + <td colspan="2"> + <a class="d-inline-block" href="{% url 'submissions:submit_report' identifier_w_vn_nr=invitation.submission.preprint.identifier_w_vn_nr %}">Submit your Report</a> <span class="text-blue">|</span> + <a class="d-inline-block" href="{% url 'submissions:communication' identifier_w_vn_nr=invitation.submission.preprint.identifier_w_vn_nr comtype='RtoE' referee_id=contributor.id %}">Write to the Editor-in-charge</a> + </td> + </tr> + </table> + </li> + {% endfor %} + </ul> + </div> +{% endif %}