Statistics
| Branch: | Tag: | Revision:

root / snf-astakos-app / astakos / im / templates / im / astakosgroup_list.html @ 207de855

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