Shows a different link if the group is moderated or not

This commit is contained in:
2011-05-19 11:39:39 +01:00
parent 7648c04fb2
commit 6f9749636c
2 changed files with 3 additions and 3 deletions

View File

@@ -49,7 +49,7 @@ def group_list(request):
fixed = not group.groupinformation.type == GROUP_TYPE_PERMISSION fixed = not group.groupinformation.type == GROUP_TYPE_PERMISSION
pending = group.requests.filter(status=REQUEST_PENDING,user=request.user).count() 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()) group_list = sorted(group_list, key=lambda name: name[1].lower())

View File

@@ -9,11 +9,11 @@
<table> <table>
{% if group_list %} {% if group_list %}
<tr><th>Group Name</th><th>Description</th><th>Status</th><th>Actions</th></tr> <tr><th>Group Name</th><th>Description</th><th>Status</th><th>Actions</th></tr>
{% for id, group, description, status, requestable, fixed, pending in group_list %} {% for id, group, description, status, requestable, fixed, pending, moderated in group_list %}
<tr><td>{{ group }}</td> <tr><td>{{ group }}</td>
<td>{{ description }}</td> <td>{{ description }}</td>
<td>{% if pending %}Request Pending{% else %}{% if status %}{{ status }}{% endif %}{% endif %}</td> <td>{% if pending %}Request Pending{% else %}{% if status %}{{ status }}{% endif %}{% endif %}</td>
<td>{% ifequal status None %}{% if requestable %}<a href="{% url groups.views.create_request id %}">Request Membership</a>{% endif %}{% endifequal %} <td>{% ifequal status None %}{% if requestable %}<a href="{% url groups.views.create_request id %}">{% if moderated %}Request Membership{% else %}Join{% endif %}</a>{% endif %}{% endifequal %}
{% if not fixed and status %}<a href="{% url groups.views.kick_member id request.user.id %}">Leave</a>&nbsp;{% endif %} {% if not fixed and status %}<a href="{% url groups.views.kick_member id request.user.id %}">Leave</a>&nbsp;{% endif %}
{% if status == 'Admin' or request.user.is_superuser %}{% if not fixed %}<a href="{% url groups.views.admin_group id %}">Admin</a>{% endif %}{% endif %}</td> {% if status == 'Admin' or request.user.is_superuser %}{% if not fixed %}<a href="{% url groups.views.admin_group id %}">Admin</a>{% endif %}{% endif %}</td>
</tr> </tr>