2010-11-19 05:12:29 +00:00
|
|
|
from django.shortcuts import render_to_response
|
2010-12-08 22:01:09 +00:00
|
|
|
from django.template import RequestContext
|
2010-12-08 22:04:26 +00:00
|
|
|
from django.contrib.auth.decorators import permission_required
|
2010-11-19 05:12:29 +00:00
|
|
|
from codereview.dashboard.models import Repository
|
2010-12-14 22:55:30 +00:00
|
|
|
from codereview.review.models import Review
|
2010-11-19 05:12:29 +00:00
|
|
|
|
2010-12-08 22:04:26 +00:00
|
|
|
@permission_required('dashboard.browse')
|
2010-11-19 05:12:29 +00:00
|
|
|
def index(request):
|
|
|
|
""" List available repositories
|
|
|
|
"""
|
|
|
|
repositories = Repository.objects.all()
|
2010-12-14 22:55:30 +00:00
|
|
|
reviews = Review.objects.all().order_by('-created')
|
2010-12-08 22:01:09 +00:00
|
|
|
data = RequestContext(request, {
|
|
|
|
'repositories': repositories,
|
2010-12-14 22:55:30 +00:00
|
|
|
'reviews': reviews,
|
2010-12-08 22:01:09 +00:00
|
|
|
})
|
|
|
|
return render_to_response('dashboard/index.html', data)
|