Statistics
| Branch: | Tag: | Revision:

root / snf-astakos-app / astakos / im / templates / im / astakosgroup_list.html @ 01ac12d5

History | View | Annotate | Download (3.3 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
            <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 %}
21
      {% if object_list %}
22
      <h2>Groups:</h2>
23
      <table class="zebra-striped id-sorted">
24
            <thead>
25
              <tr>
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>
33
              </tr>
34
            </thead>
35
            <tbody>
36
              {% for o in object_list %}
37
              <tr>
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 %}
74
              </tr>
75
              {% endfor %}
76
            </tbody>
77
        </table>
78
        {% else %}
79
            <h2>No groups found!</h2>
80
        {% endif %}
81
</div>
82
{% endblock %}