root / snf-astakos-app / astakos / im / templates / im / astakosgroup_detail.html @ 5841646f
History | View | Annotate | Download (7.1 kB)
1 |
{% extends "im/account_base.html" %} |
---|---|
2 |
|
3 |
{% load filters %} |
4 |
|
5 |
{% block page.body %} |
6 |
{% with object.owners as owners %} |
7 |
{% with object.quota as quota %} |
8 |
<div class="projects"> |
9 |
|
10 |
<h2>
|
11 |
{% if object.is_member %} |
12 |
<em>
|
13 |
{% if object.is_owner %} |
14 |
[ ADMINISTRATOR ] |
15 |
{% else %} |
16 |
[ ENROLLED ] |
17 |
{% endif %} |
18 |
</em>
|
19 |
{% endif %} |
20 |
<span>{{ object.name|strip_http|upper }}</span> |
21 |
</h2>
|
22 |
|
23 |
<div class="details"> |
24 |
{% if object.is_owner %} |
25 |
<a href="#" class="edit">EDIT GROUP INFO</a> |
26 |
{% endif %} |
27 |
<div class="data"> |
28 |
<p>{{ object.desc }}</p> |
29 |
<dl class="alt-style"> |
30 |
<dt>Homepage url</dt> |
31 |
<dd>
|
32 |
{% if object.homepage%} |
33 |
<a href="{{ object.homepage }}">{{ object.homepage }}</a> |
34 |
{% else %} |
35 |
Not set yet |
36 |
{% endif %} |
37 |
</dd>
|
38 |
</dl>
|
39 |
</div>
|
40 |
<div class="editable" style="display:none;"> |
41 |
<form action="" method="post" |
42 |
class="withlabels">{% csrf_token %} |
43 |
{% with update_form as form %} |
44 |
{% include "im/form_render.html" %} |
45 |
<div class="form-row submit"> |
46 |
<input type="submit" class="submit altcol" value="FINISHED EDITING" /> |
47 |
</div>
|
48 |
{% endwith %} |
49 |
</form>
|
50 |
</div>
|
51 |
</div>
|
52 |
<div class="full-dotted"> |
53 |
<h3>DETAILS:</h3> |
54 |
<dl class="alt-style"> |
55 |
<dt>Name</dt> |
56 |
<dd>{{ object.name|strip_http }} </dd> |
57 |
<!--<dt>Type</dt>
|
58 |
<dd>{{object.kindname|capfirst}} </dd>-->
|
59 |
<dt>Issue date:</dt> |
60 |
<dd>{{object.issue_date|date:"d/m/Y"}} </dd> |
61 |
<dt>Expiration Date</dt> |
62 |
<dd>{{object.expiration_date|date:"d/m/Y"}} </dd> |
63 |
<dt>Modaration</dt> |
64 |
<dd>{% if object.moderation_enabled%}Yes{% else %}No{% endif %}</dd> |
65 |
<dt>Activated</dt> |
66 |
<dd>{% if object.is_enabled %}Yes{% else %}No{% endif %}</dd> |
67 |
<dt>Owner</dt> |
68 |
{{ o.owners }} |
69 |
<dd>{% for o in owners %}
|
70 |
{% if object.is_owner %} |
71 |
Me |
72 |
{% else%} |
73 |
{{o.realname}} ({{o.email}}) |
74 |
|
75 |
{% endif %} |
76 |
{% endfor %}
|
77 |
</dd>
|
78 |
<dt>Max participants</dt> |
79 |
<dd>{% if object.max_participants%}{{object.max_participants}}{% else %} {% endif %}</dd> |
80 |
</dl>
|
81 |
</div>
|
82 |
|
83 |
<div class="full-dotted"> |
84 |
<h3>RESOURCES:</h3> |
85 |
{% if quota %} |
86 |
<dl class="alt-style"> |
87 |
{% for k in quota|dkeys %} |
88 |
{% with resource_catalog|lookup:'resources' as resources %} |
89 |
{% with resources|lookup_uni:k as info %} |
90 |
{% with resource_presentation|lookup_uni:k as resource_info %} |
91 |
<dt>
|
92 |
Max {% if resource_info.is_abbreviation %}{{ info.name|upper }}{% else %}{{ info.name }}{% endif %}{% if not info.unit %}s {% endif %} per user |
93 |
</dt>
|
94 |
<dd>
|
95 |
{% with quota|lookup:k as uplimit%} |
96 |
{% if uplimit %} |
97 |
{% if info.unit %} |
98 |
{{ uplimit|sizeof_fmt }} |
99 |
{% else %} |
100 |
{{ uplimit|isinf }} |
101 |
{% endif %} |
102 |
|
103 |
{% endif %} |
104 |
|
105 |
{% endwith%} |
106 |
</dd>
|
107 |
|
108 |
{% endwith%} |
109 |
{% endwith %} |
110 |
{% endwith %} |
111 |
{% endfor %} |
112 |
</dl>
|
113 |
{% else %} |
114 |
<p>No policies</p> |
115 |
{% endif %} |
116 |
</div>
|
117 |
<div class="full-dotted"> |
118 |
{% with page|concat:sorting as args %} |
119 |
{% with object.membership_set.select_related.all|paginate:args as membership %} |
120 |
{% if membership %} |
121 |
<form method="GET" class="minimal" action=""> |
122 |
<div class="form-row"> |
123 |
<select name="sorting" onchange="this.form.submit();" class="dropkicked"> |
124 |
<option value="">Sort by</option> |
125 |
<option value="person__email" {% if == 'person__email' %}selected{% endif %}>User Id</option> |
126 |
<option value="person__first_name" {% if == 'person__first_name' %}selected{% endif %}>Name</option> |
127 |
<option value="date_joined" {% if == 'date_joined' %}selected{% endif %}>Status</option> |
128 |
</select>
|
129 |
</div>
|
130 |
</form>
|
131 |
<table class="alt-style"> |
132 |
<caption>MEMBERS:</caption> |
133 |
<thead>
|
134 |
<tr>
|
135 |
<th>User Id</th> |
136 |
<th>Name</th> |
137 |
<th>Status</th> |
138 |
</tr>
|
139 |
</thead>
|
140 |
<tbody>
|
141 |
{% for m in membership.object_list %} |
142 |
<tr>
|
143 |
<td>{{m.person.email}}</td> |
144 |
<td>{{m.person.realname}}</td> |
145 |
{% if m.person in owners %} |
146 |
<td>Owner</td> |
147 |
{% else %} |
148 |
{% if m.is_approved %} |
149 |
<td>Approved</td> |
150 |
{% else %} |
151 |
<td>Pending
|
152 |
{% if object.is_owner %} |
153 |
<a href="{% url approve_member object.id m.person.id %}?{% if page %}page={{ page }}{% endif %}{% if sorting %}&sorting={{sorting}}{% endif %}">Accept</a> |
154 |
<a href="{% url disapprove_member object.id m.person.id %}?{% if page %}page={{ page }}{% endif %}{% if sorting %}&sorting={{sorting}}{% endif %}">Reject</a> |
155 |
{% endif %} |
156 |
</td>
|
157 |
{% endif %} |
158 |
{% endif %} |
159 |
</tr>
|
160 |
{% endfor %} |
161 |
</tbody>
|
162 |
</table>
|
163 |
<div class="pagination"> |
164 |
<p class="next-prev"> |
165 |
{% if membership.has_previous %} |
166 |
<a href="?page={{ membership.previous_page_number }}{% if sorting %}&sorting={{sorting}}{% endif %}">previous</a> |
167 |
{% endif %} |
168 |
{% if membership.has_next %} |
169 |
<a href="?page={{ membership.next_page_number }}{% if sorting %}&sorting={{sorting}}{% endif %}">next</a> |
170 |
{% endif %} |
171 |
</p>
|
172 |
<p class="nums"> |
173 |
<span class="current"> |
174 |
Page {{ membership.number }} of {{ membership.paginator.num_pages }} |
175 |
</span>
|
176 |
</p>
|
177 |
</div>
|
178 |
{% else %} |
179 |
<p>No members yet!</p> |
180 |
{% endif %} |
181 |
{% endwith %} |
182 |
{% endwith %} |
183 |
</div>
|
184 |
|
185 |
|
186 |
{% if object.is_owner %} |
187 |
<div class="full-dotted"> |
188 |
<form action="" method="post" class="withlabels">{% csrf_token %} |
189 |
<h2>Enroll more members</h2> |
190 |
{% with addmembers_form as form %} |
191 |
{% include "im/form_render.html" %} |
192 |
{% endwith %} |
193 |
<div class="form-row submit"> |
194 |
<input type="submit" class="submit altcol" value="ADD MEMBERS" /> |
195 |
</div>
|
196 |
</form>
|
197 |
</div>
|
198 |
{% endif %} |
199 |
|
200 |
|
201 |
</div>
|
202 |
{% endwith %} |
203 |
{% endwith %} |
204 |
{% endblock %} |