Merge pull request #2264 from tobiasd/20160118-admin2
fed stats template beautification && doc strings for the mod/admin
This commit is contained in:
commit
f51535f38e
2 changed files with 40 additions and 35 deletions
|
@ -114,7 +114,16 @@ function admin_post(&$a){
|
|||
/**
|
||||
* @brief Generates content of the admin panel pages
|
||||
*
|
||||
* This function generates the content for the admin panel.
|
||||
* This function generates the content for the admin panel. It consists of the
|
||||
* aside menu (same for the entire admin panel) and the code for the soecified
|
||||
* subpage of the panel.
|
||||
*
|
||||
* The structure of the adress is: /admin/subpage/details though "details" is
|
||||
* only necessary for some subpages, like themes or addons where it is the name
|
||||
* of one theme resp. addon from which the details should be shown. Content for
|
||||
* the subpages is generated in separate functions for each of the subpages.
|
||||
*
|
||||
* The returned string hold the generated HTML code of the page.
|
||||
*
|
||||
* @param App $a
|
||||
* @return string
|
||||
|
|
|
@ -9,9 +9,9 @@
|
|||
<p>{{$legendtext}}
|
||||
<ul>
|
||||
{{foreach $counts as $c}}
|
||||
{{if $c[0]['total'] > 0}}
|
||||
<li>{{$c[0]['platform']}} ({{$c[0]['total']}})</li>
|
||||
{{/if}}
|
||||
{{if $c[0]['total'] > 0}}
|
||||
<li>{{$c[0]['platform']}} ({{$c[0]['total']}})</li>
|
||||
{{/if}}
|
||||
{{/foreach}}
|
||||
</ul>
|
||||
</p>
|
||||
|
@ -23,40 +23,36 @@ var FedData = [
|
|||
{{/foreach}}
|
||||
];
|
||||
var ctx = document.getElementById("FederationChart").getContext("2d");
|
||||
var myDoughnutChart = new Chart(ctx).Doughnut(FedData,
|
||||
{
|
||||
animateRotate : false,
|
||||
});
|
||||
document.getElementById('FederationLegend').innerHTML = myDoughnutChart.generateLegend();
|
||||
var myDoughnutChart = new Chart(ctx).Doughnut(FedData, { animateRotate : false, });
|
||||
</script>
|
||||
|
||||
<table id="federation-stats">
|
||||
{{foreach $counts as $c}}
|
||||
{{if $c[0]['total'] > 0}}
|
||||
<tr>
|
||||
<th>{{$c[0]['platform']}}</th>
|
||||
<th><strong>{{$c[0]['total']}}</strong></td>
|
||||
<td>{{$c[0]['network']}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="3" class="federation-data">
|
||||
<canvas id="{{$c[2]}}Chart" class="federation-network-graph"></canvas>
|
||||
<script>
|
||||
var {{$c[2]}}data = [
|
||||
{{foreach $c[1] as $v}}
|
||||
{ value: {{$v['total']}}, label: '{{$v['version']}}', color: "#90EE90", highlight: "#EE90A1",},
|
||||
{{/foreach}}
|
||||
];
|
||||
var ctx = document.getElementById("{{$c[2]}}Chart").getContext("2d");
|
||||
var my{{$c[2]}}DoughnutChart = new Chart(ctx).Doughnut({{$c[2]}}data, {animateRotate : 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>
|
||||
{{/foreach}}
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
{{/if}}
|
||||
{{if $c[0]['total'] > 0}}
|
||||
<tr>
|
||||
<th>{{$c[0]['platform']}}</th>
|
||||
<th><strong>{{$c[0]['total']}}</strong></td>
|
||||
<td>{{$c[0]['network']}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="3" class="federation-data">
|
||||
<canvas id="{{$c[2]}}Chart" class="federation-network-graph"></canvas>
|
||||
<script>
|
||||
var {{$c[2]}}data = [
|
||||
{{foreach $c[1] as $v}}
|
||||
{ value: {{$v['total']}}, label: '{{$v['version']}}', color: "#90EE90", highlight: "#EE90A1",},
|
||||
{{/foreach}}
|
||||
];
|
||||
var ctx = document.getElementById("{{$c[2]}}Chart").getContext("2d");
|
||||
var my{{$c[2]}}DoughnutChart = new Chart(ctx).Doughnut({{$c[2]}}data, {animateRotate : 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>
|
||||
{{/foreach}}
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
{{/if}}
|
||||
{{/foreach}}
|
||||
</table>
|
||||
|
|
Loading…
Reference in a new issue