Changeset 52fb1d5


Ignore:
Timestamp:
May 6, 2013, 8:15:06 PM (13 years ago)
Author:
Alex Dehnert <adehnert@…>
Branches:
master, space-access, stable, stage
Children:
b4cc0cc
Parents:
83759bf
git-author:
Alex Dehnert <adehnert@…> (05/06/13 20:15:06)
git-committer:
Alex Dehnert <adehnert@…> (05/06/13 20:15:06)
Message:

Show group status on the non-student officers page

Location:
asadb
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • asadb/groups/views.py

    rb8172c8 r52fb1d5  
    12811281    office_holders = office_holders.filter(role__in=student_roles)
    12821282    office_holders = office_holders.exclude(person__in=students.values('username'))
    1283     office_holders = office_holders.select_related('group', 'role')
     1283    office_holders = office_holders.select_related('group', 'group__group_status', 'role')
    12841284
    12851285    msg = None
     
    12871287    if 'sort' in request.GET:
    12881288        if request.GET['sort'] == 'group':
    1289             office_holders = office_holders.order_by('group__name', 'role', 'person', )
     1289            office_holders = office_holders.order_by('group__name', 'group__group_status', 'role', 'person', )
     1290        elif request.GET['sort'] == 'status':
     1291            office_holders = office_holders.order_by('group__group_status', 'group__name', 'role', 'person', )
    12901292        elif request.GET['sort'] == 'role':
    1291             office_holders = office_holders.order_by('role', 'group__name', 'person', )
     1293            office_holders = office_holders.order_by('role', 'group__group_status', 'group__name', 'person', )
    12921294        elif request.GET['sort'] == 'person':
    1293             office_holders = office_holders.order_by('person', 'group__name', 'role', )
     1295            office_holders = office_holders.order_by('person', 'group__group_status', 'group__name', 'role', )
    12941296        else:
    12951297            msg = 'Unknown sort key "%s".' % (request.GET['sort'], )
  • asadb/template/groups/reporting/non-students.html

    r213dd57 r52fb1d5  
    3535<tr>
    3636    <th><a href='?sort=group'>Group</a></th>
     37    <th><a href='?sort=status'>Status</a></th>
    3738    <th><a href='?sort=role'>Role</a></th>
    3839    <th><a href='?sort=person'>Person</a></th>
     
    4142<tr>
    4243    <td><a href='{% url groups:group-detail holder.group.pk %}'>{{holder.group.name}}</a></td>
     44    <td>{{holder.group.group_status}}</td>
    4345    <td>{{holder.role.display_name}}</td>
    4446    <td>{{holder.person}}</td>
Note: See TracChangeset for help on using the changeset viewer.