to the draft parser (incorporating patch from trunk), store the extracted country instead of trying to turn it into an ISO country code, add country and continent name models and add initial data for those, add helper function for cleaning the countries, add author country and continent charts, move the affiliation models to stats/models.py, fix a bunch of bugs. - Legacy-Id: 12846
101 lines
2.6 KiB
HTML
101 lines
2.6 KiB
HTML
<h3>{{ stats_title }}</h3>
|
|
|
|
<div id="chart"></div>
|
|
|
|
<script>
|
|
var chartConf = {
|
|
chart: {
|
|
type: 'column'
|
|
},
|
|
title: {
|
|
text: '{{ stats_title|escapejs }}'
|
|
},
|
|
xAxis: {
|
|
type: "category",
|
|
title: {
|
|
text: 'Affiliation'
|
|
}
|
|
},
|
|
yAxis: {
|
|
title: {
|
|
text: 'Number of authors'
|
|
}
|
|
},
|
|
tooltip: {
|
|
formatter: function () {
|
|
var s = '<b>' + this.points[0].key + '</b>';
|
|
|
|
$.each(this.points, function () {
|
|
s += '<br/>' + chartConf.yAxis.title.text + ': ' + this.y;
|
|
});
|
|
|
|
return s;
|
|
},
|
|
shared: true
|
|
},
|
|
series: {{ chart_data }}
|
|
};
|
|
</script>
|
|
|
|
<h3>Data</h3>
|
|
|
|
<table class="table table-condensed stats-data">
|
|
<thead>
|
|
<tr>
|
|
<th>Affiliation</th>
|
|
<th>Percentage of authors</th>
|
|
<th>Authors</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for affiliation, percentage, names in table_data %}
|
|
<tr>
|
|
<td>{{ affiliation|default:"(unknown)" }}</td>
|
|
<td>{{ percentage|floatformat:2 }}%</td>
|
|
<td>{% include "stats/includes/number_with_details_cell.html" %}</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
|
|
<p>Some authors are authors of multiple documents with different
|
|
affiliation information associated, so the sum of multiple rows in the
|
|
table can be more than 100%.</p>
|
|
|
|
|
|
|
|
<h3>Affiliation Aliases</h3>
|
|
|
|
<p>In generating the above statistics, some heuristics have been applied to determine the affiliation of each author.</p>
|
|
|
|
{% if request.GET.showaliases %}
|
|
<p><a href="{{ hide_aliases_url }}" class="btn btn-default">Hide generated aliases</a></p>
|
|
|
|
{% if request.user.is_staff %}
|
|
<p>Note: since you're an admin, you can <a href="{% url "admin:stats_affiliationalias_add" %}">add an extra known alias</a> or see the <a href="{% url "admin:stats_affiliationalias_changelist" %}">existing known aliases</a> and <a href="{% url "admin:stats_affiliationignoredending_changelist" %}">generally ignored endings</a>.</p>
|
|
{% endif %}
|
|
|
|
{% if alias_data %}
|
|
<table class="table table-condensed">
|
|
<thead>
|
|
<th>Affiliation</th>
|
|
<th>Alias</th>
|
|
</thead>
|
|
|
|
{% for name, alias in alias_data %}
|
|
<tr>
|
|
<td>
|
|
{% ifchanged %}
|
|
{{ name|default:"(unknown)" }}
|
|
{% endifchanged %}
|
|
</td>
|
|
<td>{{ alias }}</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</table>
|
|
{% endif %}
|
|
|
|
{% else %}
|
|
<p><a href="{{ show_aliases_url }}" class="btn btn-default">Show generated aliases</a></p>
|
|
{% endif %}
|