SciPost Code Repository

Skip to content
Snippets Groups Projects
Commit 9a610111 authored by Jorran de Wit's avatar Jorran de Wit
Browse files

Add report drafts to personal page

parent ead1032d
No related branches found
No related tags found
No related merge requests found
......@@ -34,20 +34,18 @@
<a href="#account" class="nav-link active" data-toggle="tab">Account</a>
</li>
{% if 'SciPost Administrators' in user_groups or 'Editorial Administrators' in user_groups or 'Editorial College' in user_groups or 'Advisory Board' in user_groups or 'Vetting Editors' in user_groups or 'Ambassadors' in user_groups or 'Junior Ambassadors' in user_groups %}
<li class="nav-item btn btn-secondary">
<a href="#editorial-actions" class="nav-link" data-toggle="tab">Editorial Actions</a>
</li>
{% endif %}
{% if perms.scipost.can_view_production %}
<li class="nav-item btn btn-secondary">
<a href="#production" class="nav-link" data-toggle="tab">Production</a>
</li>
{% endif %}
<li class="nav-item btn btn-secondary">
<a href="#editorial-actions" class="nav-link" data-toggle="tab">Editorial Actions</a>
</li>
{% endif %}
{% if perms.scipost.can_view_production %}
<li class="nav-item btn btn-secondary">
<a href="#production" class="nav-link" data-toggle="tab">Production</a>
</li>
{% endif %}
{% if perms.scipost.can_referee %}
<li class="nav-item btn btn-secondary">
{% with pending_count=pending_ref_tasks|length %}
<a class="nav-link" data-toggle="tab" href="#refereeing">Refereeing {% if nr_ref_inv_to_consider|add:pending_count %}({{nr_ref_inv_to_consider|add:pending_count}}){% endif %}</a>
{% endwith %}
<a class="nav-link" data-toggle="tab" href="#refereeing">Refereeing {% if refereeing_tab_total_count %}({{refereeing_tab_total_count}}){% endif %}</a>
</li>
{% endif %}
<li class="nav-item btn btn-secondary">
......@@ -371,6 +369,24 @@
</ul>
</div>
</div>
{% if unfinished_reports %}
<div class="row">
<div class="col-12">
<h3>Unfinished reports:</h3>
</div>
<div class="col-12">
<ul class="list-group list-group-flush">
{% for report in unfinished_reports %}
<li class="list-group-item">
<div class="w-100">{% include 'submissions/_submission_card_content.html' with submission=report.submission %}</div>
<div class="px-2"><a class="px-1" href="{% url 'submissions:submit_report' report.submission.arxiv_identifier_w_vn_nr %}">Finish report</a></div>
</li>
{% endfor %}
</ul>
</div>
</div>
{% endif %}
</div><!-- End tab -->
{% endif %}
......
......@@ -806,8 +806,8 @@ def personal_page(request):
.count())
active_assignments = EditorialAssignment.objects.filter(
to=contributor, accepted=True, completed=False)
nr_reports_to_vet = Report.objects.filter(
status=0, submission__editor_in_charge=contributor).count()
nr_reports_to_vet = (Report.objects.awaiting_vetting()
.filter(submission__editor_in_charge=contributor).count())
nr_commentary_page_requests_to_vet = 0
nr_comments_to_vet = 0
nr_thesislink_requests_to_vet = 0
......@@ -818,10 +818,16 @@ def personal_page(request):
nr_comments_to_vet = Comment.objects.filter(status=0).count()
nr_thesislink_requests_to_vet = ThesisLink.objects.filter(vetted=False).count()
nr_authorship_claims_to_vet = AuthorshipClaim.objects.filter(status='0').count()
# Refereeing
nr_ref_inv_to_consider = RefereeInvitation.objects.filter(
referee=contributor, accepted=None, cancelled=False).count()
pending_ref_tasks = RefereeInvitation.objects.filter(
referee=contributor, accepted=True, fulfilled=False)
unfinished_reports = Report.objects.in_draft().filter(author=contributor)
refereeing_tab_total_count = nr_ref_inv_to_consider + len(pending_ref_tasks)
refereeing_tab_total_count += len(unfinished_reports)
# Verify if there exist objects authored by this contributor,
# whose authorship hasn't been claimed yet
own_submissions = (Submission.objects
......@@ -879,11 +885,14 @@ def personal_page(request):
'nr_thesis_authorships_to_claim': nr_thesis_authorships_to_claim,
'nr_ref_inv_to_consider': nr_ref_inv_to_consider,
'pending_ref_tasks': pending_ref_tasks,
'refereeing_tab_total_count': refereeing_tab_total_count,
'unfinished_reports': unfinished_reports,
'own_submissions': own_submissions,
'own_commentaries': own_commentaries,
'own_thesislinks': own_thesislinks,
'own_comments': own_comments, 'own_authorreplies': own_authorreplies,
}
return render(request, 'scipost/personal_page.html', context)
......
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