Changeset 21c6ad4
- Timestamp:
- Oct 21, 2012, 8:36:38 PM (13 years ago)
- Branches:
- master, space-access, stable, stage
- Children:
- ecb0997
- Parents:
- 670a2bd
- git-author:
- Alex Dehnert <adehnert@…> (10/21/12 20:36:38)
- git-committer:
- Alex Dehnert <adehnert@…> (10/21/12 20:36:38)
- Location:
- asadb
- Files:
-
- 2 edited
-
forms/views.py (modified) (3 diffs)
-
template/membership/confirm.html (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
asadb/forms/views.py
ra50f67b r21c6ad4 374 374 selected_groups = [] 375 375 376 # Determine whether the submitter is a student or not 376 377 accounts = groups.models.AthenaMoiraAccount 377 378 try: … … 387 388 update_obj.save() 388 389 390 # Find groups that list a role for the user 391 office_holders = groups.models.OfficeHolder.current_holders.filter(person=request.user.username) 392 role_groups = {} 393 for office_holder in office_holders: 394 if office_holder.group.pk not in role_groups: 395 role_groups[office_holder.group.pk] = (office_holder.group, set()) 396 role_groups[office_holder.group.pk][1].add(office_holder.role.display_name) 397 print role_groups 398 399 # Find groups the user searched for 389 400 filterset = groups.views.GroupFilter(request.GET, membership_update_qs) 390 401 filtered_groups = filterset.qs.all() … … 425 436 426 437 context = { 438 'role_groups':role_groups, 427 439 'form':form, 428 440 'filter':filterset, -
asadb/template/membership/confirm.html
r670a2bd r21c6ad4 46 46 {% endif %} 47 47 48 <h3>Option 1: Add or remove groups one at a time</h3> 48 <h3>Option 1: Add or remove groups that list a role for you</h3> 49 50 <table class='pretty-table'> 51 <thead> 52 <tr> 53 <th>Group</th> 54 <th>Roles</th> 55 <th>Add/Remove</th> 56 </tr> 57 </thead> 58 <tbody> 59 {% for group, roles in role_groups.values %} 60 <tr> 61 <th>{{group}}</th> 62 <td>{{roles|join:", "}}</td> 63 <td><form action="" method="post"> 64 <input type="hidden" name="group" value="{{group.pk}}"> 65 {% csrf_token %} 66 {% if group in member_groups %} 67 <input type="hidden" name="action" value="remove"> 68 <input type="submit" name="add-remove" value="Remove"> 69 {% else %} 70 <input type="hidden" name="action" value="add"> 71 <input type="submit" name="add-remove" value="Add"> 72 {% endif %} 73 </form></td> 74 </tr> 75 {% endfor %} 76 </tbody> 77 </table> 78 79 <h3>Option 2: Add or remove groups by searching</h3> 49 80 50 81 <form action="" method="get"> … … 96 127 97 128 98 <h3>Option 2: Select all your groups at once</h3>129 <h3>Option 3: Select all your groups at once</h3> 99 130 100 131 <p>Below is a list of all recognized groups. You can go through picking out the groups you are a member of. However, you should be careful not to deselect any groups (unless you aren't a member of them, of course).</p>
Note: See TracChangeset
for help on using the changeset viewer.