root / snf-astakos-app / astakos / im / templates / im / astakosgroup_list.html @ 0f4fa26d
History | View | Annotate | Download (3.9 kB)
1 |
{% extends "im/account_base.html" %} |
---|---|
2 |
|
3 |
{% load filters %} |
4 |
|
5 |
{% block page.body %} |
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 |
{% for gname in group_kinds %} |
18 |
<a href="{% url group_add gname %}" class="submit">Create {{gname}}</a> |
19 |
{% endfor %} |
20 |
<a href="{% url group_search %}" class="submit">Join group</a> |
21 |
</p>
|
22 |
{% endif %} |
23 |
{% if object_list %} |
24 |
<h2>Groups:</h2> |
25 |
<table class="zebra-striped id-sorted"> |
26 |
<thead>
|
27 |
<tr>
|
28 |
<th>Name</th> |
29 |
<th>Type</th> |
30 |
<th>Issue date</th> |
31 |
<th>Expiration date</th> |
32 |
<th>Owner?</th> |
33 |
<th>Participants</th> |
34 |
<th>Enabled?</th> |
35 |
<th>Moderation?</th> |
36 |
<th>Enrollment status</th> |
37 |
</tr>
|
38 |
</thead>
|
39 |
<tbody>
|
40 |
{% for o in object_list %} |
41 |
{% with o.owner.all as owners %} |
42 |
{% with o.members as members %} |
43 |
{% with o.approved_members as approved_members %} |
44 |
<tr>
|
45 |
<td><a class="extra-link" href="{% url group_detail o.id %}">{{o.name}}</a></td> |
46 |
<td>{{o.kind}}</td> |
47 |
<td>{{o.issue_date|date:"d/m/Y"}}</td> |
48 |
<td>{{o.expiration_date|date:"d/m/Y"}}</td> |
49 |
<td>{% if user in owners %}Yes{% else %}No{% endif %}</td> |
50 |
<td>{{ approved_members|length }}/{{ members|length }}</td> |
51 |
<td>{% if o.is_enabled %}Yes{% else %}No{% endif %}</td> |
52 |
<td>{% if o.moderation_enabled%}Yes{% else %}No{% endif %}</td> |
53 |
{% if user in approved_members %} |
54 |
<td>Active</td> |
55 |
{% if user not in owners %} |
56 |
<td>
|
57 |
<form action="{% url group_leave o.id %}" method="post"class="login innerlabels">{% csrf_token %} |
58 |
<div class="form-row submit clearfix"> |
59 |
<input type="submit" class="submit altcol" value="LEAVE" /> |
60 |
</div>
|
61 |
</form>
|
62 |
</td>
|
63 |
{% endif %} |
64 |
{% else %} |
65 |
{% if user in members %} |
66 |
<td>Pending</td> |
67 |
{% else %} |
68 |
<td>Not member</td> |
69 |
{% if join_forms %} |
70 |
<td>
|
71 |
<form action="{% url group_join o.id %}" method="post"class="login innerlabels">{% csrf_token %} |
72 |
{% with join_forms|lookup:o.name as form %} |
73 |
{% include "im/form_render.html" %} |
74 |
{% endwith %} |
75 |
<div class="form-row submit clearfix"> |
76 |
<input type="submit" class="submit altcol" value="JOIN" /> |
77 |
</div>
|
78 |
</form>
|
79 |
</td>
|
80 |
{% endif %} |
81 |
{% endif %} |
82 |
{% endif %} |
83 |
</tr>
|
84 |
{% endwith %} |
85 |
{% endwith %} |
86 |
{% endwith %} |
87 |
{% endfor %} |
88 |
</tbody>
|
89 |
</table>
|
90 |
{% else %} |
91 |
{% if is_search %} |
92 |
<h2>No groups found!</h2> |
93 |
{% endif %} |
94 |
{% endif %} |
95 |
</div>
|
96 |
{% endblock %} |