Statistics
| Branch: | Tag: | Revision:

root / snf-astakos-app / astakos / im / templates / im / projects / project_list.html @ 30dd9e0e

History | View | Annotate | Download (20.7 kB)

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

    
3
{% load astakos_tags %}
4
{% load filters %}
5

    
6
{% block page.body %}
7
<div class="maincol {% block innerpage.class %}{% endblock %}">
8
    <div class="projects">
9
            <h2>PROJECTS</h2>
10
            {% if form %}
11
                    <p>Search for existing Projects and join the ones you like. Please search by Project name. </p>
12
                    <form action="{% url project_search %}" method="post" class="withlabels signup submit-inline">{% csrf_token %}
13
                            {% include "im/form_render.html" %}
14
                        <div class="form-row submit">
15
                                <input type="submit" class="submit altcol" value="SEARCH" />
16
                                {% if q %}<a href="{% url project_all %}">clear</a>{% endif %}
17
                        </div>
18
                    </form>
19
            {% else %}
20
            <div class="two-cols clearfix">
21
                        <div class="rt">
22
                                 &nbsp;
23
                        </div>
24
                        <div class="lt">
25
                                 <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>
26
                                 <p><a href="{% url how_it_works %}" style="font-size:1.154em;">How it works ></a></p>
27
                        </div>
28
                </div>
29
                
30
                
31
                <div class="widjets"> 
32
                        <!--<a href="#" class="widjet-x" title="remove boxes">X</a>-->
33
                        <ul class="clearfix">        
34
                                <li class="create">
35
                                        <div>
36
                                                <div class="wrap">
37

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