diff --git a/scipost_django/scipost/templates/scipost/portal/_hx_tasklist.html b/scipost_django/scipost/templates/scipost/portal/_hx_tasklist.html index 670c9ef42a84d7d73d108d7a7ed954b2c4f8b958..95e5cd5d5d6f6ee8221813138aae0cbf96d90cc1 100644 --- a/scipost_django/scipost/templates/scipost/portal/_hx_tasklist.html +++ b/scipost_django/scipost/templates/scipost/portal/_hx_tasklist.html @@ -1,117 +1,158 @@ <h1>Tasklist</h1> <p>Fellows: below you will find a list of pending tasks, with quick links to facilitate your work.</p> -<p><span class="text-warning border border-danger p-2">{% include 'bi/cone-striped.html' %} in construction!</span> <em>This might not contain all your todo items.</em></p> +<p> + <span class="text-warning border border-danger p-2"> + {% include 'bi/cone-striped.html' %} + in construction!</span> <em>This might not contain all your todo items.</em> + </p> -{% if assignments_to_consider or assignments_ongoing %} - <div class="mt-5 p-4 border border-primary"> - <h2>Assignments</h2> - {% if assignments_to_consider %} - <h3 class="highlight">Assignments for you to consider <span class="text-warning">{% include 'bi/exclamation-circle-fill.html' %}</span></h3> + {% if assignments_to_consider or assignments_ongoing %} + <div class="mt-5 p-4 border border-primary"> + <h2>Assignments</h2> + + {% if assignments_to_consider %} + <h3 class="highlight"> + Assignments for you to consider <span class="text-warning">{% include 'bi/exclamation-circle-fill.html' %}</span> + </h3> <ul> - {% for assignment in assignments_to_consider %} - <li>On submission: {{ assignment.submission }}<br> - <a class="btn btn-sm btn-primary" href="{% url 'submissions:pool:assignment_request' assignment.id %}">Accept or decline here</a> - </li> - {% endfor %} + + {% for assignment in assignments_to_consider %} + <li> + On submission: {{ assignment.submission }} + <br /> + <a class="btn btn-sm btn-primary" + href="{% url 'submissions:pool:assignment_request' assignment.id %}">Accept or decline here</a> + </li> + {% endfor %} + </ul> {% endif %} {% if assignments_ongoing %} <h3 class="highlight">Ongoing assignments (you are Editor-in-charge)</h3> - <table class="table"> - <thead> - <tr> - <th>Submission</th> - <th>Refereeing deadline</th> - <th>Required actions</th> - <th></th> - </tr> - </thead> - <tbody> - {% for assignment in assignments_ongoing %} - <tr{% if assignment.submission.cycle.required_actions %} class="bg-warning"{% endif %}> - <td> - {{ assignment.submission.title }}<br> - <em>by {{ assignment.submission.author_list }}</em> - </td> - <td>{{ assignment.submission.reporting_deadline|date:"Y-m-d" }}</td> - <td> - <ul> - {% for code, action in assignment.submission.cycle.required_actions.items %} - <li>{{ action|safe }}</li> - {% empty %} - <li>No action required. Great job!</li> - {% endfor %} - </ul> - </td> - <td> - <a class="btn btn-sm btn-primary" href="{% url 'submissions:editorial_page' assignment.submission.preprint.identifier_w_vn_nr %}">{% include "bi/arrow-right.html" %}Editorial page</a> - </td> - </tr> - {% endfor %} - </tbody> + <table class="table table-borderless"> + <thead> + <tr> + <th>Submission</th> + <th>Refereeing deadline</th> + <th>Required actions</th> + </tr> + </thead> + <tbody> + + {% for assignment in assignments_ongoing %} + <tr class="bg-info bg-opacity-50 border-top border-dark overflow-hidden align-middle"> + <td class="p-2" colspan="20"> + <span class="fw-semibold fs-6">{{ assignment.submission.title }}</span> + <br /> + <span class="fs-6 text-muted">by {{ assignment.submission.author_list|truncatechars:150 }}</span> + </td> + </tr> + {% for submission in assignment.submission.thread_full %} + <tr class="align-middle {% if submission.cycle.required_actions %}bg-warning {% if submission == assignment.submission %}bg-opacity-25{% else %}bg-opacity-10{% endif %}{% endif %}"> + <td> + <a href="{% url "submissions:submission" submission.preprint.identifier_w_vn_nr %}"> + Version {{ submission.thread_sequence_order }} + </a> + <a class="text-nowrap" + href="{% url 'submissions:editorial_page' submission.preprint.identifier_w_vn_nr %}">Editorial page</a> + </td> + <td class="text-nowrap">{{ submission.reporting_deadline|date:"Y-m-d" }}</td> + <td> + <ul class="m-0"> + + {% for code, action in submission.cycle.required_actions.items %} + <li>{{ action|safe }}</li> + {% empty %} + <li>No action required. Great job!</li> + {% endfor %} + + </ul> + </td> + </tr> + {% endfor %} + {% endfor %} + + </tbody> </table> - {% endif %} + {% endif %} </div> - {% endif %} +{% endif %} - <div class="mt-5 p-4 border border-primary"> - <h2>Voting</h2> - <h3 class="mt-5 highlight">Recommendations to vote on <span class="text-warning">{% include 'bi/exclamation-circle-fill.html' %}</span></h3> - <table class="table"> - <thead> - <tr> - <th>Submission</th> - <th>Recommendation</th> - <th>Voting deadline</th> - <th></th> - </tr> - </thead> - <tbody> - {% for rec in recs_to_vote_on.all %} - <tr> - <td>{{ rec.submission }}</td> - <td>{{ rec.get_recommendation_display }}</td> - <td>{{ rec.voting_deadline|date:"Y-m-d" }}</td> - <td><a class="btn btn-primary" href="{% url 'submissions:vote_on_rec' rec_id=rec.id %}" target="_blank">Vote</a></td> - </tr> - {% empty %} - <tr> - <td colspan="4">You have no recommendations to vote on at the moment</td> - </tr> - {% endfor %} - </tbody> - </table> +<div class="mt-5 p-4 border border-primary"> + <h2>Voting</h2> + <h3 class="mt-5 highlight"> + Recommendations to vote on <span class="text-warning">{% include 'bi/exclamation-circle-fill.html' %}</span> +</h3> +<table class="table"> + <thead> + <tr> + <th>Submission</th> + <th>Recommendation</th> + <th>Voting deadline</th> + <th></th> + </tr> + </thead> + <tbody> + + {% for rec in recs_to_vote_on.all %} + <tr> + <td>{{ rec.submission }}</td> + <td>{{ rec.get_recommendation_display }}</td> + <td>{{ rec.voting_deadline|date:"Y-m-d" }}</td> + <td> + <a class="btn btn-primary" + href="{% url 'submissions:vote_on_rec' rec_id=rec.id %}" + target="_blank">Vote</a> + </td> + </tr> + {% empty %} + <tr> + <td colspan="4">You have no recommendations to vote on at the moment</td> + </tr> + {% endfor %} + + </tbody> +</table> + +<h3 class="mt-5 highlight">Recommendations in voting (for which you have recently voted)</h3> +<table class="table"> + <thead> + <tr> + <th>Submission</th> + <th>Recommendation</th> + <th>Voting deadline</th> + <th></th> + </tr> + </thead> + <tbody> + + {% for rec in recs_current_voted.all %} + <tr> + <td> + {{ rec.submission.title }} + <br /> + <em>by {{ rec.submission.author_list }}</em> + </td> + </td> + <td>{{ rec.get_recommendation_display }}</td> + <td>{{ rec.voting_deadline|date:"Y-m-d" }}</td> + <td> + <a class="btn btn-sm btn-primary" + href="{% url 'submissions:vote_on_rec' rec_id=rec.id %}" + target="_blank"> + {% include "bi/arrow-right.html" %} + View/revise your vote</a> + </td> + </tr> + {% empty %} + <tr> + <td colspan="4">None found</td> + </tr> + {% endfor %} - <h3 class="mt-5 highlight">Recommendations in voting (for which you have recently voted)</h3> - <table class="table"> - <thead> - <tr> - <th>Submission</th> - <th>Recommendation</th> - <th>Voting deadline</th> - <th></th> - </tr> - </thead> - <tbody> - {% for rec in recs_current_voted.all %} - <tr> - <td> - {{ rec.submission.title }}<br> - <em>by {{ rec.submission.author_list }}</em> - </td> - </td> - <td>{{ rec.get_recommendation_display }}</td> - <td>{{ rec.voting_deadline|date:"Y-m-d" }}</td> - <td><a class="btn btn-sm btn-primary" href="{% url 'submissions:vote_on_rec' rec_id=rec.id %}" target="_blank">{% include "bi/arrow-right.html" %}View/revise your vote</a></td> - </tr> - {% empty %} - <tr> - <td colspan="4">None found</td> - </tr> - {% endfor %} - </tbody> - </table> +</tbody> +</table> </div> diff --git a/scipost_django/submissions/refereeing_cycles.py b/scipost_django/submissions/refereeing_cycles.py index d78f78818e5c03e574cbbdad7f1490731e65bbbe..f41a124f524e7eb57810776def956077ebaa5e9c 100644 --- a/scipost_django/submissions/refereeing_cycles.py +++ b/scipost_django/submissions/refereeing_cycles.py @@ -130,12 +130,18 @@ class VettingAction(BaseAction): @property def url(self): - return "{}#current-contributions".format( - reverse( - "submissions:editorial_page", - args=(self.submission.preprint.identifier_w_vn_nr,), - ) - ) + match self.id.split("."): + case "Comment", comment_id: + return reverse("comments:vet_submitted_comment", args=[comment_id]) + case "Report", report_id: + return reverse("submissions:vet_submitted_report", args=[report_id]) + case _: + return "{}#current-contributions".format( + reverse( + "submissions:editorial_page", + args=(self.submission.preprint.identifier_w_vn_nr,), + ) + ) class NoRefereeResponseAction(BaseAction):