diff --git a/groups/views.py b/groups/views.py index dbf6616..86d20d2 100644 --- a/groups/views.py +++ b/groups/views.py @@ -51,7 +51,9 @@ def group_list(request): requestable = False fixed = not group.groupinformation.type == GROUP_TYPE_PERMISSION - group_list.append((group.id, group.name, status, requestable, fixed)) + pending = group.requests.filter(status=REQUEST_PENDING,user=request.user).count() + + group_list.append((group.id, group.name, status, requestable, fixed, pending)) return render_to_response('groups/group_list.html', locals(), context_instance=RequestContext(request)) diff --git a/templates/groups/group_list.html b/templates/groups/group_list.html index a5bb8f2..10c0a7f 100644 --- a/templates/groups/group_list.html +++ b/templates/groups/group_list.html @@ -9,9 +9,9 @@
| Group Name | Status | Actions | |
|---|---|---|---|
| {{ group }} | -{% if status %}{{ status }}{% endif %} | +{% if pending %}Request Pending{% else %}{% if status %}{{ status }}{% endif %}{% endif %} | {% ifequal status None %}{% if requestable %}Request Membership{% endif %}{% endifequal %} {% if not fixed and status %}Leave {% endif %} {% if status == 'Admin' or request.user.is_superuser %}{% if not fixed %}Admin{% endif %}{% endif %} |