Changeset 41f8b1e


Ignore:
Timestamp:
Feb 26, 2012, 2:49:19 AM (14 years ago)
Author:
Alex Dehnert <adehnert@…>
Branches:
master, space-access, stable, stage
Children:
00079cf
Parents:
ce5d021
git-author:
Alex Dehnert <adehnert@…> (02/26/12 02:49:19)
git-committer:
Alex Dehnert <adehnert@…> (02/26/12 02:49:19)
Message:

Show connection to group on detail page (Trac: #74)

Location:
asadb
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • asadb/groups/views.py

    rce5d021 r41f8b1e  
    9393            roles.append((role.display_name, role, group.officers(role=role), ))
    9494        context['roles'] = roles
     95        context['my_roles'] = group.officers(person=self.request.user.username).select_related('role')
    9596
    9697        return context
  • asadb/template/groups/group_detail.html

    r0270ed7 r41f8b1e  
    8989</table>
    9090
     91<h2>My Connection</h2>
     92
     93{% if my_roles %}
     94<p>You have the following connections to this group:</p>
     95<table class='pretty-table'>
     96<tr>
     97    <th>Connection</th>
     98    <th>Description</th>
     99</tr>
     100{% for holder in my_roles %}
     101<tr>
     102    <th>{{holder.role.display_name}}</th>
     103    <td>{{holder.role.description}}</td>
     104</tr>
     105{% endfor %}
     106</table>
     107{% else %}
     108<p>No roles in this group.</p>
     109{% endif %}
     110
    91111<h2>Notes</h2>
    92112
Note: See TracChangeset for help on using the changeset viewer.