aboutsummaryrefslogtreecommitdiff
path: root/templates/report_downloads.html
blob: 649b53cd9a4af57d6ae40ebe6ad35c52af925f3e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
{% extends base_page %}

{% block content %}

<script language="javascript" type="text/javascript">
var dataset = [
{% for download in downloads %}
  ["{{download.name}}", {{download.count}}],
{% endfor %}
]
$(document).ready(function() {
  $('#reports_table').DataTable({
    order: [[ 1, "desc" ]],
    aLengthMenu: [
      [25, 50, 75, 100, -1],
      [25, 50, 75, 100, "All"]
    ],
    iDisplayLength: 50,
    data: dataset,
    columnDefs: [{
      render: function ( data, type, row ) {
        return '<a href=".' + data + '">' + data + '</a>';
      },
      'targets': 0
    }],
  });
} );
</script>

<h2>{{year_month}} Downloads by {{label}}</h2>
<table id="reports_table" width="100%">
  <thead>
    <tr><th>Name</th><th>Count</th></tr>
  </thead>
</table>
{% endblock %}