Statistics
| Branch: | Tag: | Revision:

root / snf-astakos-app / astakos / im / templates / im / projects / project_list.html @ 7592e3e2

History | View | Annotate | Download (19.1 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 object_list %}
61
        <div class="full-dotted">
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 %}#allGroups">Name</a></th>
86
                    <th><a href="?{% if q %}q={{q}}&{% endif %}sorting={% if sorting == 'issue_date' %}-issue_date{% else %}issue_date{% endif %}#allGroups">Issue Date</a></th>
87
                    <th><a href="?{% if q %}q={{q}}&{% endif %}sorting={% if sorting == 'start_date' %}-start_date{% else %}start_date{% endif %}#allGroups">Start Date</a></th>
88
                    <th><a href="?{% if q %}q={{q}}&{% endif %}sorting={% if sorting == 'end_date' %}-end_date{% else %}end_date{% endif %}#allGroups">End Date</a></th>
89
                    <th>Enrolled</th>
90
                    <th><a href="?{% if q %}q={{q}}&{% endif %}sorting={% if sorting == 'state' %}-state{% else %}state{% endif %}#allGroups">Status</a></th>
91
                    <th>&nbsp;</th>
92
                                <th>Membership Status</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%}#allGroups">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%}#allGroups">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
                    {% endif %}
198
                    {% if page_obj.has_next %}
199
                        <a href="?page={{ page_obj.next_page_number }}{% if q %}&q={{q}}{% endif %}{% if sorting %}&sorting={{sorting}}{% endif %}">next</a>
200
                    {% endif %}
201
                    </p>
202
                        <p class="nums">
203
                                <span class="current">
204
                        Page {{ page_obj.number }} of {{ paginator.num_pages }}
205
                    </span>
206
                        </p>
207
           </div>
208
      <!-- Group listing -->
209
       {% else %}
210
                       {% if not form %}
211
            {% with page|concat:sorting as args %}
212
            {% with q|paginate:args as page_obj %}
213
                         {% if page_obj.object_list  %}
214
                         {% with o.project.members as members %}
215
                {% with o.project.approved_members as approved_members %}  
216
                          <div>
217
                              {% comment %}
218
                                        <form method="GET" class="minimal" action="#allGroups" id="mygroups">
219
                                                <div class="form-row">
220
                                                    <select name="sorting"  class="dropkicked"  tabindex="1">
221
                                                            <option value="name">Sort by Name</option>
222
                                            <option value="issue_date" {% if  == 'issue_date' %}selected{% endif %}>Sort by Issue date</option>                        
223
                                                    <option value="start_date" {% if  == 'start_date' %}selected{% endif %}>Sort by Start Date</option>
224
                                                    <option value="end_date" {% if  == 'expiration_date' %}selected{% endif %}>Sort by Expiration Date</option>
225
                                                    <!-- <option value="approved_members_num" {% if sorting == 'approved_members_num' %}selected{% endif %}>Sort by Participants</option> -->
226
                                                    <option value="state" {% if  == 'state' %}selected{% endif %}>Sort by Status</option> 
227
                                <option value="member_join_policy__description" {% if  == 'member_join_policy__description' %}selected{% endif %}>Sort by Member Join Policy</option> 
228
                                <option value="member_leave_policy__description" {% if  == 'member_leave_policy__description' %}selected{% endif %}>Sort by Member Leave Policy</option>                 
229
                                                        </select>
230
                                                </div>
231
                                        </form>
232
                                        {% endcomment %}
233
                                        <table class="alt-style complex" id="allGroups">
234
                                    <caption>MY PROJECTS</caption>
235
                                    <thead>
236
                                      <tr>
237
                                    <th><a href="?sorting={% if sorting == 'name' %}-name{% else %}name{% endif %}#allGroups">Name</a></th>
238
                            <th><a href="?sorting={% if sorting == 'issue_date' %}-issue_date{% else %}issue_date{% endif %}#allGroups">Issue Date</a></th>
239
                            <th><a href="?sorting={% if sorting == 'start_date' %}-start_date{% else %}start_date{% endif %}#allGroups">Start Date</a></th>
240
                            <th><a href="?sorting={% if sorting == 'end_date' %}-end_date{% else %}end_date{% endif %}#allGroups">End Date</a></th>
241
                            <th>Enrolled</th>
242
                            <th><a href="?sorting={% if sorting == 'state' %}-state{% else %}state{% endif %}#allGroups">Status</a></th>
243
                            <th>&nbsp;</th>
244
                            <th>Membership Status</th>
245
                            <th>&nbsp;</th>
246
                            <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>
247
                            <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>
248
                            <!-- <th>&nbsp;</th>-->
249
                                      </tr>
250
                                    </thead>
251
                                    <tbody>
252
                                      {% for o in page_obj.object_list %}
253
                                      <tr class="{% cycle 'tr1' 'tr2' %}">
254
                                        <td style="width:22%"><a  href="{% url project_detail o.id %}" title="visit group page">{{o.name|truncatename }}</a></td>
255
                                        <!--td>{{o.kindname|capfirst}}</td-->
256
                                        <td style="width:13%">{{o.issue_date|date:"d/m/Y"}}</td>
257
                                        <td style="width:13%">{{o.start_date|date:"d/m/Y"}}</td>
258
                                        <td style="width:13%">{{o.end_date|date:"d/m/Y"}}</td>
259
                                        <td style="width:11%">{{approved_members|length}}</td>
260
                                        <td style="width:17%">
261
                                                <div class="msg-wrap">
262
                                                {% if user == o.owner %}
263
                                                        {% if o.is_active %}
264
                                                                Active (Owner)
265
                                                        {% else %}
266
                                                                Pending
267
                                                        {% endif %}
268
                                                {% else %}
269
                                                        {% if o.is_active %}
270
                                                                {% if user in members %}
271
                                                                    Registered
272
                                                                     
273
                                                                {% else %}
274
                                                                    Activation Pending
275
                                                                {% endif %}
276
                                                        {% else %}
277
                                                                -
278
                                                        {% endif %}
279
                                                {% endif %}
280
                                                
281
                                                </div>
282
                                        </td>
283
                                        <td style="width:15%">
284
                                                <div class="msg-wrap">
285
                                                 {% if user == o.owner %}
286
                                                        {% if o.is_active %}
287
                                                                &nbsp;
288
                                                        {% else %}
289
                                                                &nbsp;
290
                                                        {% endif %}
291
                                                {% else %}
292
                                                        {% if o.is_active %}
293
                                                                {% if user in approved_members %}
294
                                                                    
295
                                                                    <form action="{% url project_leave o.id %}?next={{request.path}}" method="post" class="link-like">{% csrf_token %}
296
                                                                     <input type="submit"  value="x leave" class="leave" />
297
                                                                </form>        
298
                                                                <div class="dialog">
299
                                                                                Are you sure you want to leave this project?<br>
300
                                                                                Name: <a  href="{% url project_detail o.id %}" title="visit group page">{{o.name}}</a><br>
301
                                                                                {% if o.description %}Description:{{o.description|truncatewords:30}}{% endif %}<br><br>
302
                                                                                
303
                                                                                <a href="#" class="yes submit">Yes</a>&nbsp;&nbsp;&nbsp;<a href="#" class="no submit">No</a>
304
                                                                        </div>
305
                                                                {% else %}
306
                                                                    &nbsp;
307
                                                                {% endif %}
308
                                                        {% else %}
309
                                                                &nbsp;
310
                                                        {% endif %}
311
                                                {% endif %}
312
                                                
313
                                                </div>
314
                                        </td>
315
                                       <!-- <td><a href="#" class="more-info" title="more info">+ more info </a></td>-->
316
                                      </tr>
317
                                      <tr class="{% cycle 'tmore1' 'tmore2' %}" style="display:none">
318
                                        <td colspan="8" class="info-td">
319
                                                <div>
320
                                                        <p>{{o.description}}</p>
321
                                                        <p>{% if o.homepage%}
322
                                                                                 Project's home page: <a href="{{ o.homepage }}">{{ o.homepage }}</a>
323
                                                                         {% endif %}
324
                                                                         </p>
325
                                                </div>        
326
                                        </td>
327
                                      </tr>
328
                                      {% endfor %}
329
                                    </tbody>
330
                                </table>
331
                                </div>
332
                                <div class="pagination">
333
                                        <p class="next-prev">
334
                                        {% if page_obj.has_previous %}
335
                            <a href="?page={{ page_obj.previous_page_number }}{% if sorting %}&sorting={{ sorting }}{% endif%}#allGroups">previous</a>
336
                        {% endif %}
337
                                    {% if page_obj.has_next %}
338
                            <a href="?page={{ page_obj.next_page_number }}{% if sorting %}&sorting={{ sorting }}{% endif%}#allGroups">next</a>
339
                        {% endif %}
340
                                    </p>
341
                                        <p class="nums">
342
                                                <span class="current">
343
                            Page {{ page_obj.number }} of {{ page_obj.paginator.num_pages }}
344
                        </span>
345
                                        </p>
346
                           </div>
347
                            {% endwith %} 
348
                          {% endwith %} 
349
                         {% endif %}
350
                {% endwith %} 
351
                      {% endwith %} 
352
                      {% endif %}
353
                      {% if form %}
354
                    {% if q %}
355
                        <h2>No projects found!</h2>
356
                    {% endif %}
357
                {% endif %}
358
      {% endif %}
359
    {% endwith %}
360
</div>
361
</div>  
362
{% endblock %}