mirror of
https://github.com/nikdoof/test-auth.git
synced 2025-12-14 14:52:15 +00:00
Reorganise the file structure into a project tree
This commit is contained in:
14
app/templates/groups/create_request.html
Normal file
14
app/templates/groups/create_request.html
Normal file
@@ -0,0 +1,14 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block title %}Create a Membership Request{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<p>Please fill in a reason why you like to be a member of this group and any supporting evidence as requested by the group adminship</p>
|
||||
|
||||
<form action="{% url groups.views.create_request groupid %}" method="post">
|
||||
<table>
|
||||
{{ form.as_table }}
|
||||
</table>
|
||||
<input type="submit" value="Create Request" />
|
||||
</form>
|
||||
{% endblock %}
|
||||
45
app/templates/groups/group_admin.html
Normal file
45
app/templates/groups/group_admin.html
Normal file
@@ -0,0 +1,45 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<h2>{{ group.name }}</h2>
|
||||
|
||||
<h3>Members</h3>
|
||||
|
||||
{% if group.user_set.all %}
|
||||
<table>
|
||||
<tr><th>Member Username</th><th>Characters</th><th>Status</th><th>Actions</th></tr>
|
||||
{% for user, chars, status in member_list %}
|
||||
<tr><td><a href="{% url sso.views.user_view user.username %}">{{ user.username }}</a></td>
|
||||
<td>{{ chars }}</td>
|
||||
<td>{{ status }}</td>
|
||||
<td><a href="{% url groups.views.kick_member group.id user.id %}">Kick Member</a>
|
||||
{% if request.user.is_superuser %} <a href="{% url groups.views.promote_member group.id user.id %}">Toggle Admin</a>{% endif %}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
{% else %}
|
||||
<b>This group has no members</b>
|
||||
{% endif %}
|
||||
|
||||
<h3>Membership Requests</h3>
|
||||
|
||||
{% if requests %}
|
||||
<table>
|
||||
<tr><th>Username</th><th>Reason</th><th>Status</th><th>Created Date</th><th>Actions</th></tr>
|
||||
{% for req in requests %}
|
||||
<tr><td><a href="{% url sso.views.user_view req.user.username %}">{{ req.user }}</a></td>
|
||||
<td>{{ req.reason }}</td>
|
||||
<td>{{ req.get_status_description }}</td>
|
||||
<td>{{ req.created_date }}</td>
|
||||
<td><a href="{% url groups.views.accept_request req.id %}">Accept</a>
|
||||
<a href="{% url groups.views.reject_request req.id %}">Reject</a></td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
{% else %}
|
||||
<b>This group has no outstanding requests</b>
|
||||
{% endif %}
|
||||
|
||||
|
||||
{% endblock %}
|
||||
26
app/templates/groups/group_list.html
Normal file
26
app/templates/groups/group_list.html
Normal file
@@ -0,0 +1,26 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<h1>Groups List</h1>
|
||||
|
||||
<p>This is the list of your current groups, and groups you can request to be a member of.</p>
|
||||
|
||||
<table>
|
||||
{% if group_list %}
|
||||
<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 %}
|
||||
<tr><td>{{ group }}</td>
|
||||
<td>{{ description }}</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 %}
|
||||
{% if not fixed and status %}<a href="{% url groups.views.kick_member id request.user.id %}">Leave</a> {% 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>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
{% else %}
|
||||
<b>No groups are available.</b>
|
||||
{% endif %}
|
||||
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user