Revision 01ac12d5 snf-astakos-app/astakos/im/templates/im/astakosgroup_list.html
b/snf-astakos-app/astakos/im/templates/im/astakosgroup_list.html | ||
---|---|---|
1 | 1 |
{% extends "im/account_base.html" %} |
2 | 2 |
|
3 |
{% load filters %} |
|
4 |
|
|
3 | 5 |
{% block page.body %} |
4 | 6 |
<div class="maincol {% block innerpage.class %}{% endblock %}"> |
7 |
{% if form %} |
|
8 |
<form action="{% url group_search %}" method="post" class="innerlabels signup">{% csrf_token %} |
|
9 |
<h2><span>Search group:</span></h2> |
|
10 |
{% include "im/form_render.html" %} |
|
11 |
<div class="form-row submit"> |
|
12 |
<input type="submit" class="submit altcol" value="SEARCH" /> |
|
13 |
</div> |
|
14 |
</form> |
|
15 |
{% else %} |
|
16 |
<p class="submit-rt"> |
|
17 |
<a href="{% url group_add %}" class="submit">Create a group</a> |
|
18 |
<a href="{% url group_search %}" class="submit">Join a group</a> |
|
19 |
</p> |
|
20 |
{% endif %} |
|
5 | 21 |
{% if object_list %} |
6 | 22 |
<h2>Groups:</h2> |
7 | 23 |
<table class="zebra-striped id-sorted"> |
8 | 24 |
<thead> |
9 | 25 |
<tr> |
10 | 26 |
<th>Name</th> |
27 |
<th>Type</th> |
|
28 |
<th>Issue date</th> |
|
29 |
<th>Expiration date</th> |
|
30 |
<th>Owner?</th> |
|
31 |
<th>Participants</th> |
|
32 |
<th>Enrollment status</th> |
|
11 | 33 |
</tr> |
12 | 34 |
</thead> |
13 | 35 |
<tbody> |
14 | 36 |
{% for o in object_list %} |
15 | 37 |
<tr> |
16 |
<td><a class="extra-link" href="{% url group_detail o.id %}">{{ o.name }}</a></td> |
|
38 |
<td><a class="extra-link" href="{% url group_detail o.id %}">{{o.name}}</a></td> |
|
39 |
<td>{{o.kind}}</td> |
|
40 |
<td>{{o.issue_date|date:"D d M Y"}}</td> |
|
41 |
<td>{{o.expiration_date|date:"D d M Y"}}</td> |
|
42 |
<td>{% if user in o.owner.all %}Yes{% else %}No{% endif %}</td> |
|
43 |
<td>{{ o.approved_members|length }}/{{ o.members|length }}</td> |
|
44 |
{% if user in o.approved_members %} |
|
45 |
<td>Active</td> |
|
46 |
{% if user not in o.owner.all %} |
|
47 |
<td> |
|
48 |
<form action="{% url group_leave o.id %}" method="post"class="login innerlabels">{% csrf_token %} |
|
49 |
<div class="form-row submit clearfix"> |
|
50 |
<input type="submit" class="submit altcol" value="LEAVE" /> |
|
51 |
</div> |
|
52 |
</form> |
|
53 |
</td> |
|
54 |
{% endif %} |
|
55 |
{% else %} |
|
56 |
{% if user in o.members %} |
|
57 |
<td>Pending</td> |
|
58 |
{% else %} |
|
59 |
<td>Not member</td> |
|
60 |
{% if join_forms %} |
|
61 |
<td> |
|
62 |
<form action="{% url group_join o.id %}" method="post"class="login innerlabels">{% csrf_token %} |
|
63 |
{% with join_forms|lookup:o.name as form %} |
|
64 |
{% include "im/form_render.html" %} |
|
65 |
{% endwith %} |
|
66 |
<div class="form-row submit clearfix"> |
|
67 |
<input type="submit" class="submit altcol" value="JOIN" /> |
|
68 |
</div> |
|
69 |
</form> |
|
70 |
</td> |
|
71 |
{% endif %} |
|
72 |
{% endif %} |
|
73 |
{% endif %} |
|
17 | 74 |
</tr> |
18 | 75 |
{% endfor %} |
19 | 76 |
</tbody> |
Also available in: Unified diff