Statistics
| Branch: | Tag: | Revision:

root / snf-astakos-app / astakos / im / templates / im / astakosgroup_detail.html @ 51c57c9c

History | View | Annotate | Download (4.1 kB)

1
{% extends "im/account_base.html" %}
2

    
3
{% load filters %}
4

    
5
{% block page.body %}
6
<div class="projects">
7
        
8
        <h2>
9
                 {% if request.user in object.members %}
10
                        <em>
11
                                {% if request.user in object.owner.all %}
12
                                        [ADMINISTRATOR]
13
                                {%  else %}
14
                                        [ ENROLLED ]
15
                                {% endif %}
16
                        </em>                
17
                {% endif %}
18
                 <span>[ {{object.kind|upper}} ]</span>  
19
         </h2>
20
         
21
         <div class="details">
22
                 {% if request.user in object.owner.all %}
23
                         <a href="#" class="edit">[ EDIT GROUP INFO ]</a>
24
                 {% endif %}
25
                 <div class="data">
26
                         <p>{{ object.desc }}</p>
27
                         <dl class="alt-style">
28
                                 <dt>Homepage url</dt>
29
                                 <dd>
30
                                         {% if object.homepage%}
31
                                                 <a href="{{ object.homepage }}">{{ object.homepage }}</a>
32
                                         {% else %}
33
                                                 Not set yet
34
                                         {% endif %}
35
                                 </dd>
36
                         </dl>
37
                </div>
38
                <div class="editable" style="display:none;">
39
                <form action="{% url astakos.im.views.group_update object.id %}" method="post"
40
                    class="withlabels">{% csrf_token %}
41
                    {% include "im/form_render.html" %}
42
                    <div class="form-row submit">
43
                        <input type="submit" class="submit altcol" value="SUBMIT" />
44
                    </div>
45
            </form>
46
                </div>
47
         </div>
48
         <div class="full-dotted">
49
                 <h3>DETAILS:</h3>
50
                 <dl class="alt-style">
51
                         <dt>Name</dt>
52
                         <dd>{{object.name}}&nbsp;</dd>
53
                         <dt>Type</dt>
54
                         <dd>{{object.kind|capfirst}}&nbsp;</dd>
55
                         <dt>Issue date:</dt>
56
                         <dd>{{object.issue_date|date:"d/m/Y"}}&nbsp;</dd>
57
                         <dt>Expiration Date</dt>
58
                         <dd>{{object.expiration_date|date:"d/m/Y"}}&nbsp;</dd>
59
                         <dt>Modaration</dt>
60
                         <dd>{% if object.moderation_enabled%}Yes{% else %}No{% endif %}</dd>
61
                         <dt>Activated</dt>
62
                         <dd>{% if object.is_enabled %}Yes{% else %}No{% endif %}</dd>
63
                         <dt>Owner</dt>
64
                         <dd>{% for o in object.owner.all %}
65
                    {% if user == o %}
66
                        Me
67
                    {% else%}
68
                        {{o.realname}} ({{o.email}})
69
                    
70
                    {% endif %}
71
                {% endfor %}&nbsp;
72
            </dd>
73
                 </dl>
74
         </div>
75
         
76
     <div class="full-dotted">
77
                 <h3>RESOURCES:</h3>
78
                 {% if quota %}
79
                 <dl class="alt-style">
80
                          
81
                         {% for k in quota|dkeys %}
82
                
83
                <dt>{{ k }}</dt>
84
                <dd>{{ quota|lookup:k }}&nbsp;</dd>
85
                  
86
            {% endfor %}
87
                </dl>
88
                {% else %}
89
            <p>No policies</p>
90
        {% endif %} 
91
         </div>
92
         <div class="full-dotted">
93
                 {% if object.members %}
94
                 <table class="alt-style table_sorting">
95
                         <caption>MEMBERS:</caption>
96
                         <thead>
97
                                 <tr>
98
                                         <th>User Id</th>
99
                                         <th>Name</th>
100
                                         <th>Status</th>
101
                                 </tr>
102
                         </thead>
103
                         <tbody>
104
                         {% for m in object.membership_set.all %}
105
              <tr>
106
                <td>{{m.person.email}}</td>
107
                <td>{{m.person.realname}}</td>
108
                {% if m.person in m.group.owner.all %}
109
                <td>Owner</td>
110
                {% else %}
111
                    {% if m.is_approved %}
112
                    <td>Approved</td>
113
                    {% else %}
114
                    <td>Pending 
115
                        {% if user in m.group.owner.all %}
116
                            <a href="{% url approve_member m.group.id m.person.id %}">Accept</a>
117
                            <a href="{% url disapprove_member m.group.id m.person.id  %}">Reject</a>
118
                        {% endif %}
119
                    </td>    
120
                    {% endif %}
121
                {% endif %}
122
              </tr>
123
            {% endfor %}
124
            </tbody>
125
                 </table>
126
                 {% else %}
127
            <p>No members yet!</p>
128
        {% endif %}
129
         </div>
130
     
131
     
132
    {% if user in object.owner.all and more_policies %}
133
    <div class="full-dotted">
134
        <form action="{% url group_policies_add object.id %}" method="post" class="withlabels">{% csrf_token %}
135
            <h2>NEW POLICY</h2>
136
                {% include "im/form_render.html" %}
137
                <div class="form-row submit">
138
                    <input type="submit" class="submit altcol" value="ADD POLICY" />
139
                </div>
140
        </form>
141
    </div>
142
    {% endif %}
143
     
144
    
145
</div>
146
{% endblock %}