mirror of
https://github.com/correl/codereview.git
synced 2024-12-26 19:16:49 +00:00
Added reviews to the dashboard index view
This commit is contained in:
parent
95ff757050
commit
9213ecbf54
2 changed files with 26 additions and 0 deletions
|
@ -2,13 +2,16 @@ from django.shortcuts import render_to_response
|
|||
from django.template import RequestContext
|
||||
from django.contrib.auth.decorators import permission_required
|
||||
from codereview.dashboard.models import Repository
|
||||
from codereview.review.models import Review
|
||||
|
||||
@permission_required('dashboard.browse')
|
||||
def index(request):
|
||||
""" List available repositories
|
||||
"""
|
||||
repositories = Repository.objects.all()
|
||||
reviews = Review.objects.all().order_by('-created')
|
||||
data = RequestContext(request, {
|
||||
'repositories': repositories,
|
||||
'reviews': reviews,
|
||||
})
|
||||
return render_to_response('dashboard/index.html', data)
|
||||
|
|
|
@ -9,3 +9,26 @@
|
|||
{% endfor %}
|
||||
</ul>
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="section">
|
||||
<h2>Reviews</h2>
|
||||
<table class="reviews">
|
||||
<tr>
|
||||
<th>Review</th>
|
||||
<th>Created</th>
|
||||
<th>Comments</th>
|
||||
</tr>
|
||||
{% for review in reviews %}
|
||||
<tr>
|
||||
<td>
|
||||
#{{ review.pk }} -
|
||||
<a href="{% url codereview.review.views.edit review_id=review.pk %}">{{ review.description }}</a>
|
||||
</td>
|
||||
<td>{{ review.created }}</td>
|
||||
<td>{{ review.comment_set.count }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
|
Loading…
Reference in a new issue