From 6f9749636cd7498cbd41270dc80e7c1046941ec0 Mon Sep 17 00:00:00 2001 From: Andrew Williams Date: Thu, 19 May 2011 11:39:39 +0100 Subject: [PATCH] Shows a different link if the group is moderated or not --- app/groups/views.py | 2 +- app/templates/groups/group_list.html | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/groups/views.py b/app/groups/views.py index 5a7c085..4c695c3 100644 --- a/app/groups/views.py +++ b/app/groups/views.py @@ -49,7 +49,7 @@ def group_list(request): fixed = not group.groupinformation.type == GROUP_TYPE_PERMISSION pending = group.requests.filter(status=REQUEST_PENDING,user=request.user).count() - group_list.append((group.id, group.name, group.groupinformation.description, status, requestable, fixed, pending)) + group_list.append((group.id, group.name, group.groupinformation.description, status, requestable, fixed, pending, group.groupinformation.moderated)) group_list = sorted(group_list, key=lambda name: name[1].lower()) diff --git a/app/templates/groups/group_list.html b/app/templates/groups/group_list.html index ebd0ae0..8638906 100644 --- a/app/templates/groups/group_list.html +++ b/app/templates/groups/group_list.html @@ -9,11 +9,11 @@ {% if group_list %} -{% for id, group, description, status, requestable, fixed, pending in group_list %} +{% for id, group, description, status, requestable, fixed, pending, moderated in group_list %} -
Group NameDescriptionStatusActions
{{ group }} {{ description }} {% if pending %}Request Pending{% else %}{% if status %}{{ status }}{% endif %}{% endif %}{% ifequal status None %}{% if requestable %}Request Membership{% endif %}{% endifequal %} + {% ifequal status None %}{% if requestable %}{% if moderated %}Request Membership{% else %}Join{% endif %}{% endif %}{% endifequal %} {% if not fixed and status %}Leave {% endif %} {% if status == 'Admin' or request.user.is_superuser %}{% if not fixed %}Admin{% endif %}{% endif %}