astakosgroup_detail.html 5.85 KB
Newer Older
Sofia Papagiannaki's avatar
Sofia Papagiannaki committed
1
2
{% extends "im/account_base.html" %}

Sofia Papagiannaki's avatar
Sofia Papagiannaki committed
3
4
{% load filters %}

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