detail: ensure machine list is sorted by name

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
This commit is contained in:
Paul Eggleton 2013-04-05 18:35:35 +01:00
parent b3a8b19eb4
commit c257348c5a
2 changed files with 5 additions and 3 deletions

View File

@ -235,7 +235,9 @@ class LayerDetailView(DetailView):
context = super(LayerDetailView, self).get_context_data(**kwargs)
layer = context['layeritem']
context['useredit'] = layer.user_can_edit(self.user)
context['layerbranch'] = layer.get_layerbranch(self.request.session.get('branch', 'master'))
layerbranch = layer.get_layerbranch(self.request.session.get('branch', 'master'))
context['layerbranch'] = layerbranch
context['machines'] = layerbranch.machine_set.order_by('name')
return context
class LayerReviewDetailView(LayerDetailView):

View File

@ -150,7 +150,7 @@
</div> <!-- end of row-fluid -->
</div> <!-- end of container-fluid -->
{% if layerbranch.machine_set.count > 0 %}
{% if machines.count > 0 %}
<div class="container-fluid" style="margin-bottom:1em;">
<div class="row-fluid">
<div class="navbar">
@ -161,7 +161,7 @@
<table class="table table-bordered">
<tbody>
{% for machine in layerbranch.machine_set.all %}
{% for machine in machines %}
<tr>
<td><a href="{{ machine.vcs_web_url }}">{{ machine.name }}</a></td>
<td>{{ machine.description }}</td>