127 lines
3.5 KiB
HTML
127 lines
3.5 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: 'Country'
|
|
}
|
|
},
|
|
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>Country</th>
|
|
<th>Percentage of authors</th>
|
|
<th>Authors</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for country, percentage, names in table_data %}
|
|
<tr>
|
|
<td>{{ country|default:"(unknown)" }}</td>
|
|
<td>{{ percentage|floatformat:2 }}%</td>
|
|
<td>{% include "stats/includes/number_with_details_cell.html" %}</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
|
|
<p>The statistics are based entirely on the author addresses provided
|
|
in each draft. Since this varies across documents, a travelling
|
|
author may be counted in more than country, making the total sum
|
|
more than 100%.</p>
|
|
|
|
<p>In case no country information is found for an author in the time
|
|
period, the author is counted as (unknown).</p>
|
|
|
|
<p>An author is counted in EU if the country is a member of the EU
|
|
now, even if that was not the case at publication.
|
|
EU members:
|
|
{% for c in eu_countries %}{{ c.name }}{% if not forloop.last %}, {% endif %}{% endfor %}.</p>
|
|
|
|
<h3>Country Aliases</h3>
|
|
|
|
<p>In generating the above statistics, some heuristics have been
|
|
applied to figure out which country each author is from.</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, some extra links are visible. You
|
|
can either correct a document author entry directly in case the
|
|
information is obviously missing or add an alias if an unknown
|
|
<a href="{% url "admin:name_countryname_changelist" %}">country name</a>
|
|
is being used.
|
|
</p>
|
|
|
|
{% endif %}
|
|
|
|
{% if alias_data %}
|
|
<table class="table table-condensed">
|
|
<thead>
|
|
<th>Country</th>
|
|
<th>Alias</th>
|
|
<th></th>
|
|
</thead>
|
|
|
|
{% for name, alias, country in alias_data %}
|
|
<tr>
|
|
<td>
|
|
{% ifchanged %}
|
|
{% if country and request.user.is_staff %}
|
|
<a href="{% url "admin:name_countryname_change" country.pk %}">
|
|
{% endif %}
|
|
{{ name|default:"(unknown)" }}
|
|
{% if country and request.user.is_staff %}
|
|
</a>
|
|
{% endif %}
|
|
{% endifchanged %}
|
|
</td>
|
|
<td>{{ alias }}</td>
|
|
<td>
|
|
{% if request.user.is_staff and name != "EU" %}
|
|
<a href="{% url "admin:doc_documentauthor_changelist" %}?country={{ alias|urlencode }}">Matching authors</a>
|
|
{% endif %}
|
|
</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</table>
|
|
{% endif %}
|
|
|
|
{% else %}
|
|
<p><a href="{{ show_aliases_url }}" class="btn btn-default">Show generated aliases</a></p>
|
|
{% endif %}
|