Statistics
| Branch: | Tag: | Revision:

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

History | View | Annotate | Download (18.1 kB)

1
{% extends "im/account_base.html" %}
2
{% load astakos_tags %}
3
{% load filters %}
4

    
5
{% block page.body %}
6
<div class="maincol {% block innerpage.class %}{% endblock %}">
7
    <div class="projects">
8
            <h2>PROJECTS</h2>
9
            {% if form %}
10
                    <p>Search for existing Projects and join the ones you like. Please search by Project name. </p>
11
                    <form action="{% url group_search %}" method="post" class="withlabels signup submit-inline">{% csrf_token %}
12
                            {% include "im/form_render.html" %}
13
                        <div class="form-row submit">
14
                                <input type="submit" class="submit altcol" value="SEARCH" />
15
                                {% if q %}<a href="{% url group_all %}">clear</a>{% endif %}
16
                        </div>
17
                    </form>
18
                    
19
                    <!--<form action="{% url group_all %}" method="post" class="link-like alone">{% csrf_token %}
20
                        <div class="form-row submit">
21
                            <input type="submit" class="submit altcol" value="clear" />
22
                        </div>
23
                    </form>
24
                   <-->
25
            {% else %}
26
            <div class="two-cols clearfix">
27
                        <div class="rt">
28
                                 &nbsp;
29
                        </div>
30
                        <div class="lt">
31
                                 <p>~okeanos gives the opportunity to Greek Academic or Research Organizations/Institutions/Faculty to run their own projects remotely on virtual infrastructure. Simple, fast and with minimal to no cost at all.</p>
32
                                 <p><a href="{% url how_it_works %}" style="font-size:1.154em;">How it works ></a></p>
33
                        </div>
34
                </div>
35
                
36
                
37
                <div class="widjets"> 
38
                        <!--<a href="#" class="widjet-x" title="remove boxes">X</a>-->
39
                        <ul class="clearfix">        
40
                                <li class="create">
41
                                        <div>
42
                                                <div class="wrap">
43

    
44
                                                        <p class="centered"><a href="{% url group_add 'project' %}"><img alt="THINK ABOUT IT" src="/static/im/images/create.png"></a></p>
45
                                                        <p class="txt">Create a new Project in seconds. Specify how many members it will have, which and how many virtual resources it will provide to its members. Describe its purpose. Submit your request and if accepted, you and your colleagues are ready to deploy!<br><br> </p>
46
                                                        <p><a href="{% url group_add 'project' %}">create a project ></a></p>
47
                                                        <!--<p class="btn"><a href="{% url group_create_list %}" class="submit">CREATE</a></p>-->
48
                                                </div>
49
                                        </div>
50
                                </li>
51
                                <li class="join">
52
                                        <div>
53
                                                <div class="wrap">
54
                                                        <p class="centered"><a href="{% url group_all %}"><img alt="THINK ABOUT IT" src="/static/im/images/join.png"></a></p>
55
                                                        <p class="txt">Become a member of an existing Project and instantly gain access to the resources it has to offer you. Search for open Projects and join for free. Contact the closed Projects administrators, if you think they will accept you. In two words: try to Join now. </p>
56
                                                        
57
                                                        <p><a href="{% url group_all %}">join a project ></a></p>
58
                                                </div>
59
                                        </div>
60
                                </li>
61
                        </ul>
62
                </div>
63
        
64
    {% endif %}
65
    {% with page_obj.object_list as object_list %}
66
    <!-- Search group -->
67
    {% if object_list %}
68
        <div class="full-dotted">
69
                {% comment %}
70
                <form method="GET" class="minimal" action="#searchResults"> 
71
                                <div class="form-row">
72
                                        <select name="sorting" onchange="this.form.submit();" class="dropkicked" tabindex="1">
73
                                            <option value="groupname">Sort by Name</option>
74
                                    <option value="issue_date" {% if  == 'issue_date' %}selected{% endif %}>Sort by Issue date</option>                        
75
                                    <option value="expiration_date" {% if  == 'expiration_date' %}selected{% endif %}>Sort by Expiration Date</option>
76
                                    <option value="approved_members_num" {% if  == 'approved_members_num' %}selected{% endif %}>Sort by Participants</option> 
77
                                    <option value="moderation_enabled" {% if  == 'moderation_enabled' %}selected{% endif %}>Sort by Moderation</option> 
78
                                        </select>
79
                                        <input type="hidden" name="q" value="{{q}}"/>
80
                                </div>
81
                        </form>
82
                        {% endcomment %}
83
            <table class="alt-style complex" id="searchResults">
84
                <caption>
85
                    {% if q %}SEARCH RESULTS{% else %}ALL PROJECTS{% endif %}
86
                </caption>
87
                <thead>
88
                      <tr>
89
                        <th><a href="?{% if q %}q={{q}}&{% endif %}sorting=groupname&ordering={% if ordering == 'ASC' and sorting == 'groupname' %}DESC{% else %}ASC{% endif %}#allGroups">Name</a></th>
90
                        <!--th>Type</th-->
91
                        <th><a href="?{% if q %}q={{q}}&{% endif %}sorting=issue_date&ordering={% if ordering == 'ASC' and sorting == 'issue_date' %}DESC{% else %}ASC{% endif %}#allGroups">Start date</a></th>
92
                        <th><a href="?{% if q %}q={{q}}&{% endif %}sorting=expiration_date&ordering={% if ordering == 'ASC' %}DESC{% else %}ASC{% endif %}#allGroups">End date</a></th>
93
                        <th><a href="?{% if q %}q={{q}}&{% endif %}sorting=approved_members_num&ordering={% if ordering == 'ASC' %}DESC{% else %}ASC{% endif %}#allGroups">Members</a></th>
94
                        <th><a href="javascript:void(0)">Status</a></th>
95
                        <th>&nbsp;</th>
96
                        <th class="centered"><a href="?{% if q %}q={{q}}&{% endif %}sorting=moderation_enabled&ordering={% if ordering == 'ASC' %}DESC{% else %}ASC{% endif %}#allGroups">Moderated</a></th>
97
                       <!-- <th>&nbsp;</th>-->
98
                        
99
                      </tr>
100
                                    </thead>
101
                <tbody>
102
                  {% for o in object_list %}
103
                   <tr class="{% cycle 'tr1' 'tr2' %}">
104
                            <td style="width:22%"><a href="{% url group_detail o.id %}" title="visit group page">{{o.groupname|truncatename}}</a></td>
105
                            <!--td>{{o.kindname|capfirst}}</td-->
106
                            <td style="width:13%">{{o.issue_date|date:"d/m/Y"}}</td>
107
                            <td style="width:13%">{{o.expiration_date|date:"d/m/Y"}}</td>
108
                            <td style="width:11%">{{o.approved_members_num}}</td>
109
                            
110
                            <td style="width:17%">
111
                                    <div class="msg-wrap">
112
                                             
113
                                    {% if o.is_member %}
114
                                        {% if o.membership_approval_date %}
115
                    
116
                                        
117
                                                       {% if not o.is_owner %}
118
                                                    Registered
119
                                                     
120
                                                {% else %}
121
                                                        Owner
122
                                                {% endif %}
123
                                        
124
                                            
125
                
126
                                        {% else %}
127
                                            Activation pending
128
                                        {% endif %}
129
                                    {% else %}
130
                                            Not member 
131
                                                 
132
                                            
133
                                    {% endif %}
134
                                    </div>
135
                            </td>
136
                            <td style="width:15%">
137
                                    <div class="msg-wrap">
138
                                             
139
                                    {% if o.is_member %}
140
                                        {% if o.membership_approval_date %}
141
                    
142
                                        
143
                                                       {% if not o.is_owner %}
144
                                                     
145
                                                    <form action="{% url group_leave o.id %}" method="post" class="link-like">{% csrf_token %}
146
                                                         <input type="submit"  value="x leave group" class="leave"/>
147
                                                    </form>
148
                                                    <div class="dialog">
149
                                                                        Are you sure you what to leave this group?<br>
150
                                                                        Name: <a  href="{% url group_detail o.id %}" title="visit group page">{{o.groupname}}</a><br>
151
                                                                        {% if o.desc %}Description:{{o.desc|truncatewords:30}}{% endif %}<br><br>
152
                                                                        
153
                                                                        <a href="#" class="yes submit">Yes</a>&nbsp;&nbsp;&nbsp;<a href="#" class="no submit">No</a>
154
                                                                </div>
155
                                                {% else %}
156
                                                         &nbsp;
157
                                                {% endif %}
158
                                        
159
                                            
160
                
161
                                        {% else %}
162
                                            &nbsp;
163
                                        {% endif %}
164
                                    {% else %}
165
                                             
166
                                                <form action="{% url group_join o.id %}" method="post" class="link-like">{% csrf_token %}
167
                                                    <input type="submit"   value="+ join group" class="join_group join" />
168
                                                </form>
169
                                                <div class="dialog">
170
                                                                        Are you sure you what to join this group?<br>
171
                                                                        Name: <a  href="{% url group_detail o.id %}" title="visit group page">{{o.groupname}}</a><br>
172
                                                                        {% if o.desc %}Description:{{o.desc|truncatewords:30}}{% endif %}<br><br>
173
                                                                        
174
                                                                        <a href="#" class="yes submit">Yes</a>&nbsp;&nbsp;&nbsp;<a href="#" class="no submit">No</a>
175
                                                                </div>
176
                                            
177
                                    {% endif %}
178
                                    </div>
179
                            </td>
180
                                    <td class="centered" style="width:9%">{% if o.moderation_enabled%}Yes{% else %}No{% endif %}</td>
181
                            <!--td><a href="#" class="more-info" title="more info">+ more info</a></td-->
182
                  </tr>
183
                  <tr class="{% cycle 'tmore1' 'tmore2' %}" style="display:none">
184
                    <td colspan="7" class="info-td">
185
                        <div>
186
                            <p>{{o.desc}}</p>
187
                            <p>{% if o.homepage%}
188
                                Group's home page: <a target="_blank" href="{{ o.homepage }}">{{ o.homepage }}</a>
189
                            
190
                            {% endif %}
191
                            </p>
192
                        </div>        
193
                    </td>
194
                  </tr>
195
                  {% endfor %}
196
                </tbody>
197
            </table>
198
           
199
        </div>
200
        
201
     
202
            <div class="pagination">
203
                        <p class="next-prev">
204
                        {% if page_obj.has_previous %}
205
                        <a href="?page={{ page_obj.previous_page_number }}{% if q %}&q={{q}}{% endif %}{% if sorting %}&sorting={{sorting}}{% endif %}">< previous</a>
206
                    {% else  %}
207
                                <a href="javascript:void()" class="disabled">< previous</a>    
208
                    {% endif %}
209
                    {% if page_obj.has_next %}
210
                        <a href="?page={{ page_obj.next_page_number }}{% if q %}&q={{q}}{% endif %}{% if sorting %}&sorting={{sorting}}{% endif %}">next ></a>
211
                    {% else  %}
212
                                <a href="javascript:void()" class="disabled">next ></a>
213
                    {% endif %}
214
                    </p>
215
                        <p class="nums">
216
                                <span class="current">
217
                        Page {{ page_obj.number }} of {{ paginator.num_pages }}
218
                    </span>
219
                        </p>
220
           </div>
221
      <!-- Group listing -->
222
       {% else %}
223
                       {% if not form %}
224
            {% with page|concat:sorting as args %}
225
            {% with q|paginate:args as page_obj %}
226
                         {% if page_obj.object_list  %}
227
                          <div>
228
                    {% comment %}
229
                                        <form method="GET" class="minimal" action="#allGroups" id="mygroups">
230
                                                <div class="form-row">
231
                                                    <select name="sorting"  class="dropkicked"  tabindex="1">
232
                                                            <option value="groupname">Sort by Name</option>
233
                                                    <!--<option value="kindname" {% if sorting == 'kindname' %}selected{% endif %}>Type</option>-->                        
234
                                                    <option value="issue_date" {% if  == 'issue_date' %}selected{% endif %}>Sort by Issue date</option>                        
235
                                                    <option value="expiration_date" {% if  == 'expiration_date' %}selected{% endif %}>Sort by Expiration Date</option>
236
                                                    <option value="approved_members_num" {% if  == 'approved_members_num' %}selected{% endif %}>Sort by Participants</option>
237
                                                    <option value="moderation_enabled" {% if  == 'moderation_enabled' %}selected{% endif %}>Sort by Moderation</option>                
238
                                                        </select>
239
                                                </div>
240
                                        </form>
241
                    {% endcomment %}
242
                                        <table class="alt-style complex" id="allGroups">
243
                                    <caption>MY PROJECTS</caption>
244
                                    <thead>
245
                                      <tr>
246
                                        <th><a href="{% url group_list %}?sorting=groupname&ordering={% if ordering == 'ASC' and sorting == 'groupname' %}DESC{% else %}ASC{% endif %}#allGroups">Name</a></th>
247
                                        <!--th>Type</th-->
248
                                        <th><a href="{% url group_list %}?sorting=issue_date&ordering={% if ordering == 'ASC' and sorting == 'issue_date' %}DESC{% else %}ASC{% endif %}#allGroups">Start date</a></th>
249
                                        <th><a href="{% url group_list %}?sorting=expiration_date&ordering={% if ordering == 'ASC' %}DESC{% else %}ASC{% endif %}#allGroups">End date</a></th>
250
                                        <th><a href="{% url group_list %}?sorting=approved_members_num&ordering={% if ordering == 'ASC' %}DESC{% else %}ASC{% endif %}#allGroups">Members</a></th>
251
                                        <th><a href="javascript:void(0)">Status</a></th>
252
                                        <th>&nbsp;</th>
253
                                        <th class="centered"><a href="{% url group_list %}?sorting=moderation_enabled&ordering={% if ordering == 'ASC' %}DESC{% else %}ASC{% endif %}#allGroups">Moderated</a></th>
254
                                       <!-- <th>&nbsp;</th>-->
255
                                        
256
                                      </tr>
257
                                    </thead>
258
                                    <tbody>
259
                                      {% for o in page_obj.object_list %}
260
                                      <tr class="{% cycle 'tr1' 'tr2' %}">
261
                                        <td style="width:22%"><a  href="{% url group_detail o.id %}" title="visit group page">{{o.groupname|truncatename }}</a></td>
262
                                        <!--td>{{o.kindname|capfirst}}</td-->
263
                                        <td style="width:13%">{{o.issue_date|date:"d/m/Y"}}</td>
264
                                        <td style="width:13%">{{o.expiration_date|date:"d/m/Y"}}</td>
265
                                        <td style="width:11%">{{ o.approved_members_num }}</td>
266
                                        <td style="width:17%">
267
                                                <div class="msg-wrap">
268
                                                {% if user.email = o.groupowner %}
269
                                                        {% if o.is_enabled %}
270
                                                                Active (Owner)
271
                                                        {% else %}
272
                                                                Pending
273
                                                        {% endif %}
274
                                                {% else %}
275
                                                        {% if o.is_enabled %}
276
                                                                {% if o.membership_status %}
277
                                                                    Registered
278
                                                                     
279
                                                                {% else %}
280
                                                                    Activation Pending
281
                                                                {% endif %}
282
                                                        {% else %}
283
                                                                -
284
                                                        {% endif %}
285
                                                {% endif %}
286
                                                
287
                                                </div>
288
                                        </td>
289
                                        <td style="width:15%">
290
                                                <div class="msg-wrap">
291
                                                 {% if user.email = o.groupowner %}
292
                                                        {% if o.is_enabled %}
293
                                                                &nbsp;
294
                                                        {% else %}
295
                                                                &nbsp;
296
                                                        {% endif %}
297
                                                {% else %}
298
                                                        {% if o.is_enabled %}
299
                                                                {% if o.membership_status %}
300
                                                                    
301
                                                                    <form action="{% url group_leave o.id %}" method="post" class="link-like">{% csrf_token %}
302
                                                                     <input type="submit"  value="x leave" class="leave" />
303
                                                                </form>        
304
                                                                <div class="dialog">
305
                                                                                Are you sure you what to leave this group?<br>
306
                                                                                Name: <a  href="{% url group_detail o.id %}" title="visit group page">{{o.groupname}}</a><br>
307
                                                                                {% if o.desc %}Description:{{o.desc|truncatewords:30}}{% endif %}<br><br>
308
                                                                                
309
                                                                                <a href="#" class="yes submit">Yes</a>&nbsp;&nbsp;&nbsp;<a href="#" class="no submit">No</a>
310
                                                                        </div>
311
                                                                {% else %}
312
                                                                    &nbsp;
313
                                                                {% endif %}
314
                                                        {% else %}
315
                                                                &nbsp;
316
                                                        {% endif %}
317
                                                {% endif %}
318
                                                
319
                                                </div>
320
                                        </td>
321
                                        <td class="centered" style="width:9%">{% if o.moderation_enabled%}Yes{% else %}No{% endif %}</td>
322
                                       <!-- <td><a href="#" class="more-info" title="more info">+ more info </a></td>-->
323
                                      </tr>
324
                                      <tr class="{% cycle 'tmore1' 'tmore2' %}" style="display:none">
325
                                        <td colspan="8" class="info-td">
326
                                                <div>
327
                                                        <p>{{o.desc}}</p>
328
                                                        <p>{% if o.homepage%}
329
                                                                                 Group's home page: <a href="{{ o.homepage }}">{{ o.homepage }}</a>
330
                                                                         {% endif %}
331
                                                                         </p>
332
                                                </div>        
333
                                        </td>
334
                                      </tr>
335
                                      {% endfor %}
336
                                    </tbody>
337
                                </table>
338
                                </div>
339
                                <div class="pagination">
340
                                        <p class="next-prev">
341
                                        {% if page_obj.has_previous %}
342
                            <a href="?page={{ page_obj.previous_page_number }}{% if sorting %}&sorting={{ sorting }}{% endif%}#allGroups">< previous</a>
343
                        {% else  %}
344
                                <a href="javascript:void()" class="disabled">< previous</a>
345
                        {% endif %}
346
                                    {% if page_obj.has_next %}
347
                            <a href="?page={{ page_obj.next_page_number }}{% if sorting %}&sorting={{ sorting }}{% endif%}#allGroups">next ></a>
348
                        {% else %}
349
                                                        <a href="javascript:void()" class="disabled">next ></a>
350
                        {% endif %}
351
                                    </p>
352
                                        <p class="nums">
353
                                                <span class="current">
354
                            Page {{ page_obj.number }} of {{ page_obj.paginator.num_pages }}
355
                        </span>
356
                                        </p>
357
                           </div>
358
                         {% endif %}
359
                {% endwith %} 
360
                      {% endwith %} 
361
                      {% endif %}
362
                      {% if form %}
363
                    {% if q %}
364
                        <h2>No projects found!</h2>
365
                    {% endif %}
366
                {% endif %}
367
      {% endif %}
368
    {% endwith %}
369
</div>
370
</div>  
371
{% endblock %}