]> git.mxchange.org Git - friendica.git/blob - view/templates/admin_federation.tpl
added Chart.js 1.0.2 to friendica library and use it instead of CDN version for graphs
[friendica.git] / view / templates / admin_federation.tpl
1 <script src="{{$baseurl}}/library/Chart.js-1.0.2/Chart.min.js"></script>
2 <canvas id="FederationChart" style="width: 400px; height: 400px; float: right; margin: 20px;"></canvas>
3 <div id="adminpage">
4     <h1>{{$title}} - {{$page}}</h1>
5     <p>{{$intro}}</p>
6     {{if not $autoactive}}
7         <p class="error-message">{{$hint}}</p>
8     {{/if}}
9     <p>{{$legendtext}}
10     <ul>
11     {{foreach $counts as $c}}
12     <li>{{$c[0]['platform']}} ({{$c[0]['count(*)']}})</li>
13     {{/foreach}}
14     </ul>
15     </p>
16 </div>
17 <script>
18 var FedData = [
19 {{foreach $counts as $c}}
20     { value: {{$c[0]['count(*)']}}, label: "{{$c[0]['platform']}}", color: "#90EE90", highlight: "#EE90A1", },
21 {{/foreach}}
22 ];
23 var ctx = document.getElementById("FederationChart").getContext("2d");
24 var myDoughnutChart = new Chart(ctx).Doughnut(FedData, 
25   {
26         animateRotate : false,
27   });
28 document.getElementById('FederationLegend').innerHTML = myDoughnutChart.generateLegend();
29 </script>
30
31 <table style="width: 100%">
32 {{foreach $counts as $c}}
33 <tr>
34         <th>{{$c[0]['platform']}}</th>
35         <th><strong>{{$c[0]['count(*)']}}</strong></td>
36         <td>{{$c[0]['network']}}</td>
37 </tr>
38 <tr>
39 <td colspan="3" style="border-bottom: 1px solid #000;">
40 <canvas id="{{$c[2]}}Chart" style="width: 240px; height: 240px; float: left;
41 margin: 20px;"></canvas>
42 <script>
43 var {{$c[2]}}data = [
44 {{foreach $c[1] as $v}}
45     { value: {{$v['count(*)']}}, label: '{{$v['version']}}', color: "#90EE90", highlight: "#EE90A1",},
46 {{/foreach}}
47 ];
48 var ctx = document.getElementById("{{$c[2]}}Chart").getContext("2d");
49 var my{{$c[2]}}DoughnutChart = new Chart(ctx).Doughnut({{$c[2]}}data,
50 {animateRotate : false,});
51 </script>
52 <ul class="federation-stats">
53 {{foreach $c[1] as $v}}
54 <li>{{if ($c[0]['platform']==='Friendica' and  $version===$v['version']) }}<span class="version-match">{{$v['version']}}</span>{{else}}{{$v['version']}}{{/if}} ({{$v['count(*)']}})</li>
55 {{/foreach}}
56 </ul>
57 </td>
58 </tr>
59 {{/foreach}}
60 </table>