Changeset f6982d4


Ignore:
Timestamp:
Jan 29, 2013, 8:15:17 PM (13 years ago)
Author:
Alex Dehnert <adehnert@…>
Branches:
master, space-access, stable, stage
Children:
1484698
Parents:
e2ceffa
git-author:
Alex Dehnert <adehnert@…> (01/29/13 20:14:13)
git-committer:
Alex Dehnert <adehnert@…> (01/29/13 20:15:17)
Message:

Describe the lock types and list on space summary

  • Create a page that displays the list of lock types, their descriptions, whether the DB handles them, etc.
  • List the lock type next to each office on the space assignments page
  • Link the lock types list from the homepage and the space assignments page
Location:
asadb
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • asadb/space/views.py

    r67dd640 rf6982d4  
    112112        'locker_num',
    113113        'group__name',
    114     ).select_related('space', 'group')
     114    ).select_related('space', 'space__lock_type', 'group')
    115115    office_assignments = assignments.filter(locker_num='')
    116116
     
    130130    }
    131131    return render_to_response('space/summary.html', context, context_instance=RequestContext(request), )
     132
     133def lock_types(request, ):
     134    lock_types = space.models.LockType.objects.order_by('name')
     135    context = {
     136        'lock_types': lock_types,
     137        'pagename': 'groups',
     138    }
     139    return render_to_response('space/lock_types.html', context, context_instance=RequestContext(request), )
  • asadb/template/index.html

    rde2f0ac rf6982d4  
    5757    </ul></li>
    5858    <li><a href='{% url space-summary %}'>Space assignments</a>
     59        <ul>
     60        <li><a href='{% url space-lock-type %}'>Lock Types</a></li>
    5961        {% if perms.groups.view_group_private_info %}
    60         <ul>
    6162        <li><a href='{% url space-dump-locker-access %}'>Locker access (CSV)</a></li>
    6263        <li><a href='{% url space-dump-office-access %}'>Office access (CSV)</a></li>
     64        {% endif %}
    6365        </ul>
    64         {% endif %}
    6566    </li>
    6667    <li><a href='{% url about %}'>About the ASA Database</a><ul>
  • asadb/template/space/summary.html

    rde2f0ac rf6982d4  
    2727    <th>Room</th>
    2828    <th>Group</th>
     29    <th><a href='{% url space-lock-type %}'>Lock Type</a></th>
    2930    <th>Access</th>
    3031</tr>
     
    3334    <td>{{office.space.number}}</td>
    3435    <td><a href='{% url groups:group-detail office.group.pk %}'>{{office.group}}</a></td>
     36    <td>{{office.space.lock_type.name}}</td>
    3537    <td><a href='{% url groups:group-space-access office.group.pk %}'>Access</a></td>
    3638</tr>
  • asadb/urls.py

    rde2f0ac rf6982d4  
    8181    url(r'^space/dump/office-access.csv$', space.views.dump_office_access, name='space-dump-office-access', ),
    8282    url(r'^space/$', space.views.summary, name='space-summary', ),
     83    url(r'^space/lock_types.html$', space.views.lock_types, name='space-lock-type', ),
    8384
    8485    # Uncomment the admin/doc line below and add 'django.contrib.admindocs'
Note: See TracChangeset for help on using the changeset viewer.