Basraah 918ecf812c Publically joinable Groups (#697)
* Add public field to AuthGroup

* Add permission for users to join non-public groups

By default this permission will be applied to the "Member" group to
maintain the current behaviour.

* Allow users to join public groups

Users without the 'groupmanagement.request_groups' permission will be
able to join groups marked as public but will not be able to see or join
any other groups.

* Prevent None state change from purging groups

Currently when a user drops from Blue or Member state all groups and
permissions are discarded. This softens that approach by not removing
public groups and creates a distinction between the two activities. An
argument could maybe be made for not removing permissions on a state
change, but that is beyond the scope of this change.

* Correct syntax for removing filtered groups

* Add unit tests for disable user and member

* Update services signals tests

* Correct mocking call

* Remove permissions checking from menu item
2017-02-11 22:03:39 -05:00

55 lines
2.2 KiB
HTML

{% extends "public/base.html" %}
{% load staticfiles %}
{% load i18n %}
{% block title %}Alliance Auth{% endblock %}
{% block page_title %}{% trans "Available" %}{% endblock page_title %}
{% block extra_css %}{% endblock extra_css %}
{% block content %}
<div class="col-lg-12">
<h1 class="page-header text-center">{% trans "Available Groups" %}</h1>
{% if groups %}
<table class="table">
<tr>
<th class="text-center">{% trans "Name" %}</th>
<th class="text-center">{% trans "Description" %}</th>
<th class="text-center">{% trans "Action" %}</th>
</tr>
{% for g in groups %}
<tr>
<td class="text-center">{{ g.group.name }}</td>
<td class="text-center">{{ g.group.authgroup.description }}</td>
<td class="text-center">
{% if g.group in user.groups.all %}
{% if not g.request %}
<a href="{% url 'auth_group_request_leave' g.group.id %}" class="btn btn-danger">
{% trans "Leave" %}
</a>
{% else %}
<button type="button" class="btn btn-primary" disabled>
{{ g.request.status }}
</button>
{% endif %}
{% elif not g.request %}
<a href="{% url 'auth_group_request_add' g.group.id %}" class="btn btn-success">
{% trans "Request" %}
</a>
{% else %}
<button type="button" class="btn btn-primary" disabled>
{{ g.request.status }}
</button>
{% endif %}
</td>
</tr>
{% endfor %}
</table>
{% else %}
<div class="alert alert-warning text-center">No groups available.</div>
{% endif %}
</div>
{% endblock content %}