Fix formatting in federation.tpl

This commit is contained in:
Hypolite Petovan 2018-01-18 11:24:56 -05:00
parent b963e7cc38
commit 910fda2383

View file

@ -6,7 +6,7 @@
{{if not $autoactive}}
<p class="error-message">{{$hint}}</p>
{{/if}}
<p>{{$legendtext}}
<p>{{$legendtext}}</p>
<ul>
{{foreach $counts as $c}}
{{if $c[0]['total'] > 0}}
@ -14,15 +14,14 @@
{{/if}}
{{/foreach}}
</ul>
</p>
</div>
<script>
var FedData = {
datasets: [{
data: [
{{foreach $counts as $c}}
{{foreach $counts as $c}}
{{$c[0]['total']}},
{{/foreach}}
{{/foreach}}
],
backgroundColor: [
{{foreach $counts as $c}}
@ -65,7 +64,7 @@ var myDoughnutChart = new Chart(ctx, {
<td colspan="3" class="federation-data">
<canvas id="{{$c[2]}}Chart" class="federation-network-graph" width="240" height="240"></canvas>
<script>
var {{$c[2]}}data = {
var {{$c[2]}}data = {
datasets: [{
data: [
{{foreach $c[1] as $v}}
@ -88,9 +87,9 @@ var myDoughnutChart = new Chart(ctx, {
'{{$v['version']}}',
{{/foreach}}
]
};
var ctx = document.getElementById("{{$c[2]}}Chart").getContext("2d");
var my{{$c[2]}}DoughnutChart = new Chart(ctx, {
};
var ctx = document.getElementById("{{$c[2]}}Chart").getContext("2d");
var my{{$c[2]}}DoughnutChart = new Chart(ctx, {
type: 'doughnut',
data: {{$c[2]}}data,
options: {
@ -98,11 +97,18 @@ var myDoughnutChart = new Chart(ctx, {
animation: {animateRotate: false},
responsive: false
}
});
});
</script>
<ul class="federation-stats">
{{foreach $c[1] as $v}}
<li>{{if ($c[0]['platform']==='Friendica' and $version===$v['version']) }}<span class="version-match">{{$v['version']}}</span>{{else}}{{$v['version']}}{{/if}} ({{$v['total']}})</li>
<li>
{{if ($c[0]['platform']==='Friendica' and $version===$v['version']) }}
<span class="version-match">{{$v['version']}}</span>
{{else}}
{{$v['version']}}
{{/if}}
({{$v['total']}})
</li>
{{/foreach}}
</ul>
</td>