datatracker/ietf/templates/stats/document_stats_authors.html
Lars Eggert f8c06fa5cf
fix: Use unique data-sort attributes (#3836)
* fix: Use unique `data-sort` attributes

So list.js properly sorts columns.

* Address @rjsparks' comments
2022-04-19 10:16:32 -05:00

69 lines
1.9 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: {
tickInterval: 1,
title: {
text: 'Number of authors'
}
},
yAxis: {
title: {
text: 'Percentage of {{ doc_label }}s'
},
labels: {
formatter: function () {
return this.value + '%';
}
}
},
tooltip: {
formatter: function () {
var s = '<b>' + this.x + ' ' + (this.x == 1 ? "author" : 'authors') + '</b>';
$.each(this.points, function () {
s += '<br>' + chartConf.yAxis.title.text + ': ' + this.y.toFixed(1) + '%';
});
return s;
},
shared: true
},
series: {{ chart_data }}
};
</script>
<h3>Data</h3>
<table class="table table-sm table-striped tablesorter stats-data">
<thead>
<tr>
<th scope="col" data-sort="num">Authors</th>
<th scope="col" data-sort="percent">Percentage of {{ doc_label }}s</th>
<th scope="col" data-sort="count">{{ doc_label|capfirst }}s</th>
</tr>
</thead>
{% if table_data %}
<tbody>
{% for author_count, percentage, count, names in table_data %}
<tr>
<td>{{ author_count }}</td>
<td>{{ percentage|floatformat:2 }}%</td>
<td>{% include "stats/includes/number_with_details_cell.html" %}</td>
</tr>
{% endfor %}
</tbody>
{% endif %}
</table>