Added monthly stats.

This commit is contained in:
A. Svensson 2015-03-08 14:25:43 +01:00
parent a64f842b83
commit 8d98476a4b
2 changed files with 11 additions and 0 deletions

View File

@ -24,5 +24,10 @@ class ServerDetailView(generic.DetailView):
context['weekly_average'] = avg context['weekly_average'] = avg
context['weekly_min'] = min context['weekly_min'] = min
context['weekly_max'] = max context['weekly_max'] = max
avg, min, max = server.calc_player_stats(days=31)
context['monthly_average'] = avg
context['monthly_min'] = min
context['monthly_max'] = max
return context return context

View File

@ -45,6 +45,12 @@
<th>{{weekly_min}}</th> <th>{{weekly_min}}</th>
<th>{{weekly_max}}</th> <th>{{weekly_max}}</th>
</tr> </tr>
<tr>
<th>Last month</th>
<th>{{monthly_average|floatformat}}</th>
<th>{{monthly_min}}</th>
<th>{{monthly_max}}</th>
</tr>
</table> </table>
<div id="chart"></div> <div id="chart"></div>