SciPost Code Repository

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

Fix templatetag outdated after volumes/issues recontruction

parent aef2bbfd
No related branches found
No related tags found
No related merge requests found
...@@ -21,141 +21,141 @@ ...@@ -21,141 +21,141 @@
<p>Clicking on a Journal/Volume/Issue gives aggregates for all publications in that object.</p> <p>Clicking on a Journal/Volume/Issue gives aggregates for all publications in that object.</p>
<ul> <ul>
{% for journal in journals|dictsort:"doi_label" %} {% for journal in journals|dictsort:"doi_label" %}
<li><a href="{% url 'stats:statistics' journal_doi_label=journal.doi_label %}">{{ journal }}</a></li> <li><a href="{% url 'stats:statistics' journal_doi_label=journal.doi_label %}">{{ journal }}</a></li>
<ul> <ul>
{% for year in journal|journal_publication_years %} {% for year in journal|journal_publication_years %}
<li><a href="{% url 'stats:statistics' journal_doi_label=journal.doi_label year=year %}">{{ year }}</a></li> <li><a href="{% url 'stats:statistics' journal_doi_label=journal.doi_label year=year %}">{{ year }}</a></li>
{% endfor %} {% endfor %}
</ul> </ul>
<ul> <ul>
{% for volume in journal.volume_set.all|dictsort:"number" %} {% for volume in journal.volumes.all|dictsort:"number" %}
<li><a href="{% url 'stats:statistics' journal_doi_label=journal.doi_label volume_nr=volume.number %}">{{ volume }}</a></li> <li><a href="{% url 'stats:statistics' journal_doi_label=journal.doi_label volume_nr=volume.number %}">{{ volume }}</a></li>
<ul> <ul>
{% for issue in volume.issue_set.all|dictsort:"number" %} {% for issue in volume.issues.all|dictsort:"number" %}
<li><a href="{% url 'stats:statistics' journal_doi_label=journal.doi_label volume_nr=volume.number issue_nr=issue.number %}">{{ issue }}</a></li> <li><a href="{% url 'stats:statistics' journal_doi_label=journal.doi_label volume_nr=volume.number issue_nr=issue.number %}">{{ issue }}</a></li>
{% endfor %} {% endfor %}
</ul> </ul>
{% endfor %} {% endfor %}
</ul> </ul>
{% endfor %} {% endfor %}
</ul> </ul>
{% if journal %} {% if journal %}
<h2>Results:</h2> <h2>Results:</h2>
<table class="table"> <table class="table">
<tr> <tr>
<th>DOI label</th> <th>DOI label</th>
{% if year %} {% if year %}
<th>Year</th> <th>Year</th>
<th>Nr submissions<br/>(distinct)</th> <th>Nr submissions<br/>(distinct)</th>
<th>Nr submissions<br/>(including resubmissions)</th> <th>Nr submissions<br/>(including resubmissions)</th>
<th>Nr assignment failed</th> <th>Nr assignment failed</th>
<th>Nr accepted/<br/>published</th> <th>Nr accepted/<br/>published</th>
<th>Nr rejected</th> <th>Nr rejected</th>
<th>Nr withdrawn</th> <th>Nr withdrawn</th>
{% else %} {% else %}
<th>Nr publications</th> <th>Nr publications</th>
<th>Duration average</th> <th>Duration average</th>
<th>Citation rate (per paper per year)</th> <th>Citation rate (per paper per year)</th>
{% endif %} {% endif %}
</tr> </tr>
<tr> <tr>
{% if issue %} {% if issue %}
<td>{{ issue.doi_label }}</td> <td>{{ issue.doi_label }}</td>
<td>{% nr_publications issue %}</td> <td>{% nr_publications issue %}</td>
<td>{% avg_processing_duration issue as avg %}{{ avg|floatformat:2 }} days</td> <td>{% avg_processing_duration issue as avg %}{{ avg|floatformat:2 }} days</td>
<td>{% citation_rate issue as cr %}{{ cr|floatformat:2 }}</td> <td>{% citation_rate issue as cr %}{{ cr|floatformat:2 }}</td>
{% elif volume %} {% elif volume %}
<td>{{ volume.doi_label }}</td> <td>{{ volume.doi_label }}</td>
<td>{% nr_publications volume %}</td> <td>{% nr_publications volume %}</td>
<td>{% avg_processing_duration volume as avg %}{{ avg|floatformat:2 }} days</td> <td>{% avg_processing_duration volume as avg %}{{ avg|floatformat:2 }} days</td>
<td>{% citation_rate volume as cr %}{{ cr|floatformat:2 }}</td> <td>{% citation_rate volume as cr %}{{ cr|floatformat:2 }}</td>
{% else %} {% else %}
<td>{{ journal.doi_label }}</td> <td>{{ journal.doi_label }}</td>
{% if year %} {% if year %}
<td>{{ year }}</td> <td>{{ year }}</td>
<td>{{ submissions|submissions_count_distinct }}</td> <td>{{ submissions|submissions_count_distinct }}</td>
<td>{{ submissions|length }}</td> <td>{{ submissions|length }}</td>
<td>{{ submissions.assignment_failed.count }}</td> <td>{{ submissions.assignment_failed.count }}</td>
<td>{{ submissions.accepted.count|add:submissions.published.count }}</td> <td>{{ submissions.accepted.count|add:submissions.published.count }}</td>
<td>{{ submissions.rejected.count }}</td> <td>{{ submissions.rejected.count }}</td>
<td>{{ submissions.withdrawn.count }}</td> <td>{{ submissions.withdrawn.count }}</td>
{% else %} {% else %}
<td>{% nr_publications journal %}</td> <td>{% nr_publications journal %}</td>
<td>{% avg_processing_duration journal as avg %}{{ avg|floatformat:2 }} days</td> <td>{% avg_processing_duration journal as avg %}{{ avg|floatformat:2 }} days</td>
<td>{% citation_rate journal as cr %}{{ cr|floatformat:2 }}</td> <td>{% citation_rate journal as cr %}{{ cr|floatformat:2 }}</td>
{% endif %} {% endif %}
{% endif %} {% endif %}
</tr> </tr>
</table> </table>
<table class="table"> <table class="table">
<tr> <tr>
<th>DOI label</th> <th>DOI label</th>
<th colspan="3">Nr per Tier</th> <th colspan="3">Nr per Tier</th>
<th colspan="3">Citation rate (per paper per year)</th> <th colspan="3">Citation rate (per paper per year)</th>
</tr> </tr>
<tr> <tr>
<th></th> <th></th>
<th>I</th> <th>I</th>
<th>II</th> <th>II</th>
<th>IIII</th> <th>IIII</th>
<th>I</th> <th>I</th>
<th>II</th> <th>II</th>
<th>IIII</th> <th>IIII</th>
</tr> </tr>
<tr> <tr>
{% if issue %} {% if issue %}
<td>{{ issue.doi_label }}</td> <td>{{ issue.doi_label }}</td>
<td>{% nr_publications issue tier=1 %}</td> <td>{% nr_publications issue tier=1 %}</td>
<td>{% nr_publications issue tier=2 %}</td> <td>{% nr_publications issue tier=2 %}</td>
<td>{% nr_publications issue tier=3 %}</td> <td>{% nr_publications issue tier=3 %}</td>
<td>{% citation_rate issue tier=1 as cr %}{{ cr|floatformat:2 }}</td> <td>{% citation_rate issue tier=1 as cr %}{{ cr|floatformat:2 }}</td>
<td>{% citation_rate issue tier=2 as cr %}{{ cr|floatformat:2 }}</td> <td>{% citation_rate issue tier=2 as cr %}{{ cr|floatformat:2 }}</td>
<td>{% citation_rate issue tier=3 as cr %}{{ cr|floatformat:2 }}</td> <td>{% citation_rate issue tier=3 as cr %}{{ cr|floatformat:2 }}</td>
{% elif volume %} {% elif volume %}
<td>{{ volume.doi_label }}</td> <td>{{ volume.doi_label }}</td>
<td>{% nr_publications volume tier=1 %}</td> <td>{% nr_publications volume tier=1 %}</td>
<td>{% nr_publications volume tier=2 %}</td> <td>{% nr_publications volume tier=2 %}</td>
<td>{% nr_publications volume tier=3 %}</td> <td>{% nr_publications volume tier=3 %}</td>
<td>{% citation_rate volume tier=1 as cr %}{{ cr|floatformat:2 }}</td> <td>{% citation_rate volume tier=1 as cr %}{{ cr|floatformat:2 }}</td>
<td>{% citation_rate volume tier=2 as cr %}{{ cr|floatformat:2 }}</td> <td>{% citation_rate volume tier=2 as cr %}{{ cr|floatformat:2 }}</td>
<td>{% citation_rate volume tier=3 as cr %}{{ cr|floatformat:2 }}</td> <td>{% citation_rate volume tier=3 as cr %}{{ cr|floatformat:2 }}</td>
{% else %} {% else %}
<td>{{ journal.doi_label }}</td> <td>{{ journal.doi_label }}</td>
<td>{% nr_publications journal tier=1 %}</td> <td>{% nr_publications journal tier=1 %}</td>
<td>{% nr_publications journal tier=2 %}</td> <td>{% nr_publications journal tier=2 %}</td>
<td>{% nr_publications journal tier=3 %}</td> <td>{% nr_publications journal tier=3 %}</td>
<td>{% citation_rate journal tier=1 as cr %}{{ cr|floatformat:2 }}</td> <td>{% citation_rate journal tier=1 as cr %}{{ cr|floatformat:2 }}</td>
<td>{% citation_rate journal tier=2 as cr %}{{ cr|floatformat:2 }}</td> <td>{% citation_rate journal tier=2 as cr %}{{ cr|floatformat:2 }}</td>
<td>{% citation_rate journal tier=3 as cr %}{{ cr|floatformat:2 }}</td> <td>{% citation_rate journal tier=3 as cr %}{{ cr|floatformat:2 }}</td>
{% endif %} {% endif %}
</tr> </tr>
</table> </table>
{% endif %} {% endif %}
{% if year %} {% if year %}
<h2>Refereeing stats for {{ year }}</h2> <h2>Refereeing stats for {{ year }}</h2>
<table class="table"> <table class="table">
<tr> <tr>
<th>Nr refereeing<br/>invitations</th> <th>Nr refereeing<br/>invitations</th>
<th>Nr accepted</th> <th>Nr accepted</th>
<th>Nr declined</th> <th>Nr declined</th>
<th>Nr pending</th> <th>Nr pending</th>
<th>Nr reports<br/>obtained</th> <th>Nr reports<br/>obtained</th>
<th>Nr obtained<br/>(invited)</th> <th>Nr obtained<br/>(invited)</th>
<th>Nr obtained<br/>(contributed)</th> <th>Nr obtained<br/>(contributed)</th>
</tr> </tr>
<tr> <tr>
<td>{{ nr_ref_inv }}</td> <td>{{ nr_ref_inv }}</td>
<td>{{ nr_acc }} ({% widthratio nr_acc nr_ref_inv 100 %}&#37;)</td> <td>{{ nr_acc }} ({% widthratio nr_acc nr_ref_inv 100 %}&#37;)</td>
<td>{{ nr_dec }} ({% widthratio nr_dec nr_ref_inv 100 %}&#37;)</td> <td>{{ nr_dec }} ({% widthratio nr_dec nr_ref_inv 100 %}&#37;)</td>
<td>{{ nr_pen }} ({% widthratio nr_pen nr_ref_inv 100 %}&#37;)</td> <td>{{ nr_pen }} ({% widthratio nr_pen nr_ref_inv 100 %}&#37;)</td>
<td>{{ nr_rep_obt }}</td> <td>{{ nr_rep_obt }}</td>
<td>{{ nr_rep_obt_inv }} ({% widthratio nr_rep_obt_inv nr_rep_obt 100 %}&#37;)</td> <td>{{ nr_rep_obt_inv }} ({% widthratio nr_rep_obt_inv nr_rep_obt 100 %}&#37;)</td>
<td>{{ nr_rep_obt_con }} ({% widthratio nr_rep_obt_con nr_rep_obt 100 %}&#37;)</td> <td>{{ nr_rep_obt_con }} ({% widthratio nr_rep_obt_con nr_rep_obt 100 %}&#37;)</td>
</tr> </tr>
</table> </table>
{% endif %} {% endif %}
......
...@@ -33,8 +33,10 @@ def submissions_count_distinct(submissions): ...@@ -33,8 +33,10 @@ def submissions_count_distinct(submissions):
@register.filter(name='journal_publication_years') @register.filter(name='journal_publication_years')
def journal_publication_years(journal): def journal_publication_years(journal):
"""Return a sorted list of active years of the Journal."""
years = [] years = []
for volume in journal.volume_set.all(): if journal.has_volumes:
if volume.until_date.year not in years: years = journal.volumes.dates('until_date', 'year')
years.append(volume.until_date.year) else:
return sorted(years) years = journal.publications.dates('publication_date', 'year')
return [x.year for x in years]
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