Merge pull request #2264 from tobiasd/20160118-admin2

fed stats template beautification && doc strings for the mod/admin
This commit is contained in:
fabrixxm 2016-01-19 09:19:07 +01:00
commit f51535f38e
2 changed files with 40 additions and 35 deletions

View file

@ -114,7 +114,16 @@ function admin_post(&$a){
/** /**
* @brief Generates content of the admin panel pages * @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 * @param App $a
* @return string * @return string

View file

@ -23,40 +23,36 @@ var FedData = [
{{/foreach}} {{/foreach}}
]; ];
var ctx = document.getElementById("FederationChart").getContext("2d"); var ctx = document.getElementById("FederationChart").getContext("2d");
var myDoughnutChart = new Chart(ctx).Doughnut(FedData, var myDoughnutChart = new Chart(ctx).Doughnut(FedData, { animateRotate : false, });
{
animateRotate : false,
});
document.getElementById('FederationLegend').innerHTML = myDoughnutChart.generateLegend();
</script> </script>
<table id="federation-stats"> <table id="federation-stats">
{{foreach $counts as $c}} {{foreach $counts as $c}}
{{if $c[0]['total'] > 0}} {{if $c[0]['total'] > 0}}
<tr> <tr>
<th>{{$c[0]['platform']}}</th> <th>{{$c[0]['platform']}}</th>
<th><strong>{{$c[0]['total']}}</strong></td> <th><strong>{{$c[0]['total']}}</strong></td>
<td>{{$c[0]['network']}}</td> <td>{{$c[0]['network']}}</td>
</tr> </tr>
<tr> <tr>
<td colspan="3" class="federation-data"> <td colspan="3" class="federation-data">
<canvas id="{{$c[2]}}Chart" class="federation-network-graph"></canvas> <canvas id="{{$c[2]}}Chart" class="federation-network-graph"></canvas>
<script> <script>
var {{$c[2]}}data = [ var {{$c[2]}}data = [
{{foreach $c[1] as $v}} {{foreach $c[1] as $v}}
{ value: {{$v['total']}}, label: '{{$v['version']}}', color: "#90EE90", highlight: "#EE90A1",}, { value: {{$v['total']}}, label: '{{$v['version']}}', color: "#90EE90", highlight: "#EE90A1",},
{{/foreach}} {{/foreach}}
]; ];
var ctx = document.getElementById("{{$c[2]}}Chart").getContext("2d"); var ctx = document.getElementById("{{$c[2]}}Chart").getContext("2d");
var my{{$c[2]}}DoughnutChart = new Chart(ctx).Doughnut({{$c[2]}}data, {animateRotate : false,}); var my{{$c[2]}}DoughnutChart = new Chart(ctx).Doughnut({{$c[2]}}data, {animateRotate : false,});
</script> </script>
<ul class="federation-stats"> <ul class="federation-stats">
{{foreach $c[1] as $v}} {{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}} {{/foreach}}
</ul> </ul>
</td> </td>
</tr> </tr>
{{/if}} {{/if}}
{{/foreach}} {{/foreach}}
</table> </table>