Added a bit of statistics to consumers

This commit is contained in:
Sebastian Henschel 2016-11-18 10:04:06 +01:00
parent 2b2ff18ffd
commit c253f8f730
2 changed files with 7 additions and 0 deletions

View File

@ -28,10 +28,15 @@
{% include "consumers/includes/filter_apptype.html" %}
</div>
<h2>Statistics</h2>
<ul id="statistics">
<li>Total number of consumers: {{ consumers_num }}</li>
</ul>
<div class="table-responsive">
<table class="table table-hover" id="consumer-list">
<thead>
<th>No</th>
<th>Name</th>
<th>Developer Email</th>
<th>Created</th>
@ -40,6 +45,7 @@
<tbody>
{% for consumer in consumers %}
<tr class="consumer-row {% if consumer.enabled %}consumer-enabled{% else %}consumer-disabled{% endif %}" data-consumer-id="{{ consumer.id }}">
<td>{{ forloop.counter }}</td>
<td class="select">{{ consumer.name }}</td>
<td class="select">{{ consumer.developerEmail }}</td>
<td class="select">{{ consumer.created|naturaltime }}</td>

View File

@ -62,6 +62,7 @@ class IndexView(LoginRequiredMixin, TemplateView):
context.update({
'consumers': filtered,
'consumers_num': len(filtered),
'consumers_json': json.dumps(filtered, default=json_serial),
})
return context