Statistics
| Branch: | Tag: | Revision:

root / snf-astakos-app / astakos / im / templates / im / astakosgroup_list.html @ 28252c7f

History | View | Annotate | Download (3.4 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>Moderation?</th>
33
                <th>Enrollment status</th>
34
              </tr>
35
            </thead>
36
            <tbody>
37
              {% for o in object_list %}
38
              <tr>
39
                <td><a class="extra-link" href="{% url group_detail o.id %}">{{o.name}}</a></td>
40
                <td>{{o.kind}}</td>
41
                <td>{{o.issue_date|date:"D d M Y"}}</td>
42
                <td>{{o.expiration_date|date:"D d M Y"}}</td>
43
                <td>{% if user in o.owner.all %}Yes{% else %}No{% endif %}</td>
44
                <td>{{ o.approved_members|length }}/{{ o.members|length }}</td>
45
                <td>{% if o.moderation_enabled%}Yes{% else %}No{% endif %}</td>
46
                {% if user in o.approved_members %}
47
                    <td>Active</td>
48
                    {% if user not in o.owner.all %}
49
                    <td>
50
                        <form action="{% url group_leave o.id %}" method="post"class="login innerlabels">{% csrf_token %}
51
                            <div class="form-row submit clearfix">
52
                                <input type="submit" class="submit altcol" value="LEAVE" />
53
                            </div>
54
                        </form>
55
                    </td>
56
                    {% endif %}
57
                {% else %}
58
                    {% if user in o.members %}
59
                        <td>Pending</td>
60
                    {% else %}
61
                        <td>Not member</td>
62
                        {% if join_forms %}
63
                        <td>
64
                            <form action="{% url group_join o.id %}" method="post"class="login innerlabels">{% csrf_token %}
65
                                {% with join_forms|lookup:o.name as form %}
66
                                    {% include "im/form_render.html" %}
67
                                {% endwith %}
68
                                <div class="form-row submit clearfix">
69
                                    <input type="submit" class="submit altcol" value="JOIN" />
70
                                </div>
71
                            </form>
72
                        </td>
73
                        {% endif %}
74
                    {% endif %}
75
                {% endif %}
76
              </tr>
77
              {% endfor %}
78
            </tbody>
79
        </table>
80
        {% else %}
81
            <h2>No groups found!</h2>
82
        {% endif %}
83
</div>
84
{% endblock %}