datatracker/ietf/templates/stats/document_stats_author_country.html
Lars Eggert 021ba39712 Reindent all templates with djhtml
- Legacy-Id: 19610
2021-11-10 09:41:11 +00:00

130 lines
4 KiB
HTML

{% load origin %}{% origin %}
<div id="chart"></div>
<script>
var chartConf = {
chart: {
type: 'column'
},
plotOptions: {
column: {
animation: false
}
},
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-sm stats-data">
<thead>
<tr>
<th>Country</th>
<th>Percentage of authors</th>
<th>Authors</th>
</tr>
</thead>
<tbody>
{% for country, percentage, count, 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
with 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>EU (European Union) is not a country, but has been added for reference, as the sum of
all current EU member countries:
{% 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-primary">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-sm">
<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-primary">Show generated aliases</a></p>
{% endif %}