Skip to content
395 changes: 389 additions & 6 deletions logic.py

Large diffs are not rendered by default.

94 changes: 94 additions & 0 deletions templates/reporting/articles_under_review.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
{% extends "admin/core/base.html" %}
{% load timedelta %}

{% block title %}Articles Under Review{% endblock %}
{% block title-section %}
Articles Under Review
{% endblock %}

{% block breadcrumbs %}
{{ block.super }}
<li><a href="{% url 'reporting_index' %}">Reporting Index</a></li>
<li>Articles Under Review</li>
{% endblock %}

{% block body %}
{% regroup review_assignments by article as article_list %}

<div class="row expanded">
<div class="large-7 columns end">
<div class="box">
<div class="title-area">
<h2>Context</h2>
</div>
<div class="content">
<p>Displays all of the articles currently under review for
this journal including their reviewers, recommendations
and due dates.</p>
</div>
</div>
</div>
</div>
<div class="large-12 columns end">
<div class="box">
<div class="title-area">
<h2>Articles Under Review
in {{ request.journal.name|safe }}</h2>
<a href="?csv" class="button">Export to CSV</a>
</div>
<div class="content">
<div>
{% regroup review_assignments by article as article_list %}
{% for article, review_assignments in article_list %}
<table class="small" id="article-{{ article.pk }}">
<thead>
<tr>
<th colspan="8">{{ article.safe_title }}</th>
</tr>
<tr>
<th>First Name</th>
<th>Last Name</th>
<th>Email Address</th>
<th>Reviewer Decision</th>
<th>Recommendation</th>
<th>Access Code</th>
<th>Due Date</th>
<th>Date Complete</th>
</tr>
</thead>
<tbody>
{% for review in review_assignments %}
<tr>
<td>{{ review.reviewer.first_name }}</td>
<td>{{ review.reviewer.last_name }}</td>
<td>{{ review.reviewer.email }}</td>
<td>{% if review.decision == 'withdrawn' %}
{% trans 'Withdrawn' %}
{{ review.date_complete|date:"Y-m-d" }}
{% elif review.date_accepted %}{% trans 'Accepted' %}
{{ review.date_accepted|date:"Y-m-d" }}
{% elif review.date_declined %}{% trans 'Declined' %}
{{ review.date_declined|date:"Y-m-d" }}
{% else %}
{% trans 'Awaiting acknowledgement' %}{% endif %}
</td>
<td>{{ review.get_decision_display }}</td>
<td>{% journal_url 'do_review' review.pk %}?access_code={{ review.access_code }}</td>
<td>{{ review.date_due|date:"Y-m-d" }}</td>
<td>{{ review.date_complete|date:"Y-m-d" }}</td>
</tr>
{% empty %}
<tr>
<td colspan="8">No review assignments</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endfor %}
</div>
</div>
</div>
</div>


{% endblock %}
32 changes: 32 additions & 0 deletions templates/reporting/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,38 @@
<p>Data is presented in a series of averages followed by a table of data.</p>
<a href="{% url 'reporting_workflow' %}">View Report</a>
</div>
</li>
<li class="accordion-item" data-accordion-item>
<a href="#" class="accordion-title">Experimental Reports</a>
<div class="accordion-content" data-tab-content>
<p>Listed below are some experimental reports intended to be fully released as part of v1.6.</p>
<ul>
<li>
<a href="{% url 'report_workflow_stages' %}">Workflow Stage Time to Completion</a>
<ul><li>Details how long an article took to complete each workflow stage.</li></ul>
</li>
<li>
<a href="{% url 'report_authors_data' %}">Journal Authors Report</a>
<ul><li>Shows users with the author role and statistics about their submissions.</li></ul>
</li>
<li>
<a href="{% url 'report_reviewers' %}">Peer Reviewers Data Report</a>
<ul><li>Shows statistics about each peer reviewer for this journal including total number of requests, accepted requests and declined requests.</li></ul>
</li>
<li>
<a href="{% url 'report_yearly_stats' %}">Journal Yearly Statistics</a>
<ul><li>For each year this journal has a published article this report shows the total number of submissions, acceptances, rejections, publications and the number of articles from that year that are still under review.</li></ul>
</li>
<li>
<a href="{% url 'report_articles_under_review' %}">Articles Under Review</a>
<ul><li>For each article lists the review assignments, reviewer information and status.</li></ul>
</li>
<li>
<a href="{% url 'report_time_to_first_decision' %}">Time to First Decision</a>
<ul><li>For each article submitted in a given time period displays a time to first decision.</li></ul>
</li>
</ul>
</div>
</li>
{% if request.repository %}
<li class="accordion-item" data-accordion-item>
Expand Down
77 changes: 77 additions & 0 deletions templates/reporting/report_authors_data.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
{% extends "admin/core/base.html" %}

{% block title %}Journal Author Data Report{% endblock %}
{% block title-section %}Journal Author Data Report{% endblock %}

{% block breadcrumbs %}
{{ block.super }}
<li><a href="{% url 'reporting_index' %}">Reporting Index</a></li>
<li>Journal Author Data Report</li>
{% endblock %}

{% block body %}
<div class="row expanded">
<div class="large-7 columns end">
<div class="box">
<div class="title-area">
<h2>Context</h2>
</div>
<div class="content">
<p>This report shows a journal's authors and their statistics.
Authors are limited to users with the author role on this
journal. Row totals may not add up where the author has
an article in workflow that is not accepted, rejected
or published.</p>
</div>
</div>
</div>
<div class="large-12 columns end">
<div class="box">
<div class="title-area">
<h2>Journal Author Data Report for {{ request.journal.name }}</h2>
<a href="?csv" class="button">Export to CSV</a>
</div>
<div class="content">
<div class="row expanded">
<table id="reviewers_report">
<thead>
<tr>
<th>ID</th>
<th>Salutation</th>
<th>First Name</th>
<th>Last Name</th>
<th>Username</th>
<th>Total Articles</th>
<th>Accepted Articles</th>
<th>Rejected Articles</th>
<th>Published Articles</th>
</tr>
</thead>
<tbody>
{% for author in authors %}
<tr>
<td>{{ author.id }}</td>
<td>
{{ author.salutation|default_if_none:"" }}
</td>
<td>{{ author.first_name }}</td>
<td>{{ author.last_name }}</td>
<td>{{ author.username }}</td>
<td>{{ author.total_articles }}</td>
<td>{{ author.accepted_articles }}</td>
<td>{{ author.declined_articles }}</td>
<td>{{ author.published_articles }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
{% endblock %}

{% block js %}
{% include "elements/datatables.html" with target="#reviewers_report" %}
{% endblock js %}
88 changes: 88 additions & 0 deletions templates/reporting/report_reviewers.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
{% extends "admin/core/base.html" %}

{% block title %}Peer Reviewers Data Report{% endblock %}
{% block title-section %}Peer Reviewers Data Report{% endblock %}

{% block breadcrumbs %}
{{ block.super }}
<li><a href="{% url 'reporting_index' %}">Reporting Index</a></li>
<li>Peer Reviewers Data Report</li>
{% endblock %}

{% block body %}
<div class="row expanded">
<div class="large-7 columns end">
<div class="box">
<div class="title-area">
<h2>Context</h2>
</div>
<div class="content">
<p>This report displays totals for each reviewer including
total request, accepted, declined and withdrawn
reviews. Note that for the <em>Average Time to
Completion</em> column all review assignments where
date_requested is greater than date_completed are
ignored. This is usually due to an import where the
date_requested is not actually known.
</p>
</div>
</div>
</div>
<div class="large-12 columns end">
<div class="box">
<div class="title-area">
<h2>Peer Reviewers Data Report for {{ request.journal.name }}</h2>
<a href="?csv" class="button">Export to CSV</a>
</div>
<div class="content">
<div class="row expanded">
<table id="reviewers_report">
<thead>
<tr>
<th>ID</th>
<th>First Name</th>
<th>Last Name</th>
<th>Total Requests</th>
<th>Accepted Requests</th>
<th>Declined Requests</th>
<th>Withdrawn Requests</th>
<th>Completed Requests</th>
<th>Requests Awaiting Response</th>
<th>Earliest Completed Review</th>
<th>Latest Completed Review</th>
<th>Average Time to Completion</th>
<th>Average Rating</th>
</tr>
</thead>
<tbody>
{% for reviewer in reviewers %}
<tr>
<td>{{ reviewer.reviewer }}</td>
<td>{{ reviewer.reviewer__first_name }}</td>
<td>{{ reviewer.reviewer__last_name }}</td>
<td>{{ reviewer.total_assignments }}</td>
<td>{{ reviewer.accepted_assignments }}</td>
<td>{{ reviewer.declined_assignments }}</td>
<td>{{ reviewer.withdrawn_assignments }}</td>
<td>{{ reviewer.completed_assignments }}</td>
<td>{{ reviewer.assignments_awaiting_response }}</td>
<td>
{{ reviewer.earliest_completed_review|date:"Y-m-d" }}</td>
<td>
{{ reviewer.latest_completed_review|date:"Y-m-d" }}</td>
<td>{{ reviewer.average_time_to_complete }}</td>
<td>{{ reviewer.average_rating }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
{% endblock %}

{% block js %}
{% include "elements/datatables.html" with target="#reviewers_report" %}
{% endblock js %}
71 changes: 71 additions & 0 deletions templates/reporting/report_time_to_first_decision.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
{% extends "admin/core/base.html" %}

{% block title %}Reports{% endblock %}
{% block title-section %}Time to First Decision{% endblock %}

{% block breadcrumbs %}
{{ block.super }}
<li><a href="{% url 'reporting_index' %}">Reporting Index</a></li>
<li>Time to First Decision</li>
{% endblock %}

{% block body %}

<div class="box">
<div class="title-area">
<h2>Filter by Dates</h2>
<form method="GET">{% csrf_token %}
<a href="?csv&{% if request.GET.start_date %}start_date={{ request.GET.start_date }}{% endif %}{% if request.GET.end_date and request.GET.end_date %}&{% endif %}{% if request.GET.end_date %}end_date={{ request.GET.end_date }}{% endif %}" class="button">Export to CSV</a>
</form>
</div>
<div class="content">
<div class="row expanded">
<form method="GET">
{{ date_form.errors|safe }}
<div class="large-2 columns">
{{ date_form.start_date }}
</div>
<div class="large-2 columns">
{{ date_form.end_date }}
</div>
<div class="large-1 columns end">
<button class="button">Submit</button>
</div>
</form>
</div>
</div>
</div>
<div class="box">
<div class="content">
<div class="row expanded">
<table id="first-decision-report">
<thead>
<tr>
<th>ID</th>
<th>Title</th>
<th>Date Submitted</th>
<th>First Decision Date</th>
<th>Decision</th>
</tr>
</thead>
<tbody>
{% for article in articles %}
<tr>
<td>{{ article.pk }}</td>
<td>{{ article.safe_title }}</td>
<td>{{ article.date_submitted }}</td>
<td>{{ article.first_decision_date }}</td>
<td>{{ article.decision_type }}</td>
</tr>

{% endfor %}
</tbody>
</table>
</div>
</div>
</div>
{% endblock %}

{% block js %}
{% include "elements/datatables.html" with target="#first-decision-report" %}
{% endblock js %}
Loading