Statistics
| Branch: | Tag: | Revision:

root / snf-astakos-app / astakos / im / templates / im / projects / project_list.html @ 73fbaec4

History | View | Annotate | Download (17 kB)

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

    
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 project_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 project_all %}">clear</a>{% endif %}
16
                        </div>
17
                    </form>
18
            {% else %}
19
            <div class="two-cols clearfix">
20
                        <div class="rt">
21
                                 &nbsp;
22
                        </div>
23
                        <div class="lt">
24
                                 <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>
25
                                 <p><a href="{% url how_it_works %}" style="font-size:1.154em;">How it works ></a></p>
26
                        </div>
27
                </div>
28
                
29
                
30
                <div class="widjets"> 
31
                        <!--<a href="#" class="widjet-x" title="remove boxes">X</a>-->
32
                        <ul class="clearfix">        
33
                                <li class="create">
34
                                        <div>
35
                                                <div class="wrap">
36

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