summaryrefslogtreecommitdiff
path: root/devel/views.py
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2013-04-21 20:29:17 -0500
committerDan McGee <dan@archlinux.org>2013-04-21 20:29:17 -0500
commit66412aa1037befef0b579c7df73656dc3b8b9804 (patch)
treed47fd7081159a54acb870a6eecc7b605022d5121 /devel/views.py
parentecf57207c0a5f90d51b6be551158ce7a0f82c9cb (diff)
Move stats portion of developer dashboard to separate view
This stuff is all below the fold when the page first loads, and adds a good amount of loading time to the developer dashboard. Split it out, where it will be wired back and hooked up via an AJAX insertion in a future commit. Both parts work standalone as is in this commit. Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'devel/views.py')
-rw-r--r--devel/views.py21
1 files changed, 15 insertions, 6 deletions
diff --git a/devel/views.py b/devel/views.py
index 4258ea7f..378d6d57 100644
--- a/devel/views.py
+++ b/devel/views.py
@@ -33,7 +33,7 @@ from .utils import get_annotated_maintainers
@login_required
def index(request):
- '''the developer dashboard'''
+ """The developer dashboard."""
if request.user.is_authenticated():
inner_q = PackageRelation.objects.filter(user=request.user)
else:
@@ -54,6 +54,19 @@ def index(request):
signoffs = sorted(get_signoff_groups(user=request.user),
key=operator.attrgetter('pkgbase'))
+ page_dict = {
+ 'todos': todolists,
+ 'flagged': flagged,
+ 'todopkgs': todopkgs,
+ 'signoffs': signoffs
+ }
+
+ return render(request, 'devel/index.html', page_dict)
+
+
+@login_required
+def stats(request):
+ """The second half of the dev dashboard."""
arches = Arch.objects.all().annotate(
total_ct=Count('packages'), flagged_ct=Count('packages__flag_date'))
repos = Repo.objects.all().annotate(
@@ -80,17 +93,13 @@ def index(request):
}
page_dict = {
- 'todos': todolists,
'arches': arches,
'repos': repos,
'maintainers': maintainers,
'orphan': orphan,
- 'flagged': flagged,
- 'todopkgs': todopkgs,
- 'signoffs': signoffs
}
- return render(request, 'devel/index.html', page_dict)
+ return render(request, 'devel/stats.html', page_dict)
@login_required