add more info to admin overview

This commit is contained in:
Jens Langhammer 2018-11-16 11:40:24 +01:00
parent a2904d3ade
commit de7a2fa034
3 changed files with 17 additions and 1 deletions

View File

@ -20,5 +20,8 @@
<li>
<a href="#">{% trans 'Users' %}</a>
</li>
<li class="{% is_active_app 'admin' %}">
<a href="{% url 'admin:index' %}">{% trans 'Django' %}</a>
</li>
</ul>
{% endblock %}

View File

@ -15,6 +15,18 @@
</div>
</div>
</div>
<div class="col-xs-6 col-sm-2 col-md-2">
<div class="card-pf card-pf-accented card-pf-aggregate-status">
<h2 class="card-pf-title">
<a href="#"><span class="fa fa-shield"></span><span class="card-pf-aggregate-status-count"></span> {% trans 'Providers' %}</a>
</h2>
<div class="card-pf-body">
<p class="card-pf-aggregate-status-notifications">
<span class="card-pf-aggregate-status-notification"><a href="#"><span class="pficon pficon-ok"></span>{{ provider_count }}</a></span>
</p>
</div>
</div>
</div>
<div class="col-xs-6 col-sm-2 col-md-2">
<div class="card-pf card-pf-accented card-pf-aggregate-status">
<h2 class="card-pf-title">

View File

@ -2,7 +2,7 @@ from django.contrib.auth.mixins import LoginRequiredMixin
from django.views.generic import TemplateView
from passbook.admin.mixins import AdminRequiredMixin
from passbook.core.models import Application, Rule, User
from passbook.core.models import Application, Rule, User, Provider
class AdministrationOverviewView(AdminRequiredMixin, TemplateView):
@ -13,4 +13,5 @@ class AdministrationOverviewView(AdminRequiredMixin, TemplateView):
kwargs['application_count'] = len(Application.objects.all())
kwargs['rule_count'] = len(Rule.objects.all())
kwargs['user_count'] = len(User.objects.all())
kwargs['provider_count'] = len(Provider.objects.all())
return super().get_context_data(**kwargs)