Statistics
| Branch: | Tag: | Revision:

root / snf-astakos-app / astakos / im / templates / im / projects / project_list.html @ 529f3c49

History | View | Annotate | Download (17.2 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="definition__name">Sort by Name</option>
65
                                    <option value="issue_date" {% if  == 'issue_date' %}selected{% endif %}>Sort by Issue date</option>                        
66
                                    <option value="definition__start_date" {% if  == 'definition__start_date' %}selected{% endif %}>Sort by Start Date</option>
67
                                    <option value="definition__end_date" {% if  == 'definition__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="definition__member_join_policy__description" {% if  == 'definition__member_join_policy__description' %}selected{% endif %}>Sort by Member Join Policy</option> 
71
                                    <option value="definition__member_leave_policy__description" {% if  == 'definition__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.definition.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.definition.start_date|date:"d/m/Y"}}</td>
107
                            <td style="width:13%">{{o.definition.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 %}" 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.definition.name}}</a><br>
142
                                                                        {% if o.definition.description %}Description:{{o.definition.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 %}" 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.definition.name}}</a><br>
159
                                                                        {% if o.definition.description %}Description:{{o.definition.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.definition.member_join_policy}}</td>
168
                            <td class="centered" style="width:9%">{{o.definition.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.definition.homepage%}
176
                                Project's home page: <a target="_blank" href="{{ o.homepage }}">{{ o.definition.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="definition__name">Sort by Name</option>
220
                                                    <!--<option value="kindname" {% if sorting == 'kindname' %}selected{% endif %}>Type</option>-->                        
221
                                                    <option value="definition__start_date" {% if  == 'definition__start_date' %}selected{% endif %}>Sort by Start Date</option>
222
                                            <option value="definition__issue_date" {% if  == 'definition__issue_date' %}selected{% endif %}>Sort by Issue date</option>                        
223
                                                    <option value="definition__expiration_date" {% if  == 'definition__expiration_date' %}selected{% endif %}>Sort by Expiration Date</option>
224
                                                    <!-- <option value="approved_members_num" {% if sorting == 'approved_members_num' %}selected{% endif %}>Sort by Participants</option> -->
225
                                                    <option value="definition__moderation_enabled" {% if  == 'definition__moderation_enabled' %}selected{% endif %}>Sort by Moderation</option>                
226
                                                        </select>
227
                                                </div>
228
                                        </form>
229
                                        <table class="alt-style complex" id="allGroups">
230
                                    <caption>MY PROJECTS</caption>
231
                                    <thead>
232
                                      <tr>
233
                                        <th>Name</th>
234
                                        <!--th>Type</th-->
235
                                        <th>Issued</th>
236
                                        <th>Starts</th>
237
                                        <th>Expires</th>
238
                                        <th>Enrolled</th>
239
                                        <th>Status</th>
240
                                        <th>&nbsp;</th>
241
                                        <th class="centered">Moderated</th>
242
                                       <!-- <th>&nbsp;</th>-->
243
                                        
244
                                      </tr>
245
                                    </thead>
246
                                    <tbody>
247
                                      {% for o in page_obj.object_list %}
248
                                      <tr class="{% cycle 'tr1' 'tr2' %}">
249
                                        <td style="width:22%"><a  href="{% url project_detail o.id %}" title="visit group page">{{o.definition.name|truncatename }}</a></td>
250
                                        <!--td>{{o.kindname|capfirst}}</td-->
251
                                        <td style="width:13%">{{o.issue_date|date:"d/m/Y"}}</td>
252
                                        <td style="width:13%">{{o.definition.start_date|date:"d/m/Y"}}</td>
253
                                        <td style="width:13%">{{o.definition.end_date|date:"d/m/Y"}}</td>
254
                                        <td style="width:11%">{{approved_members|length}}</td>
255
                                        <td style="width:17%">
256
                                                <div class="msg-wrap">
257
                                                {% if user == o.owner %}
258
                                                        {% if o.is_active %}
259
                                                                Active (Owner)
260
                                                        {% else %}
261
                                                                Pending
262
                                                        {% endif %}
263
                                                {% else %}
264
                                                        {% if o.is_active %}
265
                                                                {% if user in members %}
266
                                                                    Registered
267
                                                                     
268
                                                                {% else %}
269
                                                                    Activation Pending
270
                                                                {% endif %}
271
                                                        {% else %}
272
                                                                -
273
                                                        {% endif %}
274
                                                {% endif %}
275
                                                
276
                                                </div>
277
                                        </td>
278
                                        <td style="width:15%">
279
                                                <div class="msg-wrap">
280
                                                 {% if user == o.owner %}
281
                                                        {% if o.is_active %}
282
                                                                &nbsp;
283
                                                        {% else %}
284
                                                                &nbsp;
285
                                                        {% endif %}
286
                                                {% else %}
287
                                                        {% if o.is_active %}
288
                                                                {% if user in approved_members %}
289
                                                                    
290
                                                                    <form action="{% url project_leave o.id %}" method="post" class="link-like">{% csrf_token %}
291
                                                                     <input type="submit"  value="x leave" class="leave" />
292
                                                                </form>        
293
                                                                <div class="dialog">
294
                                                                                Are you sure you want to leave this project?<br>
295
                                                                                Name: <a  href="{% url project_detail o.id %}" title="visit group page">{{o.definition.name}}</a><br>
296
                                                                                {% if o.definition.description %}Description:{{o.definition.description|truncatewords:30}}{% endif %}<br><br>
297
                                                                                
298
                                                                                <a href="#" class="yes submit">Yes</a>&nbsp;&nbsp;&nbsp;<a href="#" class="no submit">No</a>
299
                                                                        </div>
300
                                                                {% else %}
301
                                                                    &nbsp;
302
                                                                {% endif %}
303
                                                        {% else %}
304
                                                                &nbsp;
305
                                                        {% endif %}
306
                                                {% endif %}
307
                                                
308
                                                </div>
309
                                        </td>
310
                                       <!-- <td><a href="#" class="more-info" title="more info">+ more info </a></td>-->
311
                                      </tr>
312
                                      <tr class="{% cycle 'tmore1' 'tmore2' %}" style="display:none">
313
                                        <td colspan="8" class="info-td">
314
                                                <div>
315
                                                        <p>{{o.definition.description}}</p>
316
                                                        <p>{% if o.definition.homepage%}
317
                                                                                 Project's home page: <a href="{{ o.definition.homepage }}">{{ o.definition.homepage }}</a>
318
                                                                         {% endif %}
319
                                                                         </p>
320
                                                </div>        
321
                                        </td>
322
                                      </tr>
323
                                      {% endfor %}
324
                                    </tbody>
325
                                </table>
326
                                </div>
327
                                <div class="pagination">
328
                                        <p class="next-prev">
329
                                        {% if page_obj.has_previous %}
330
                            <a href="?page={{ page_obj.previous_page_number }}{% if sorting %}&sorting={{ sorting }}{% endif%}#allGroups">previous</a>
331
                        {% endif %}
332
                                    {% if page_obj.has_next %}
333
                            <a href="?page={{ page_obj.next_page_number }}{% if sorting %}&sorting={{ sorting }}{% endif%}#allGroups">next</a>
334
                        {% endif %}
335
                                    </p>
336
                                        <p class="nums">
337
                                                <span class="current">
338
                            Page {{ page_obj.number }} of {{ page_obj.paginator.num_pages }}
339
                        </span>
340
                                        </p>
341
                           </div>
342
                            {% endwith %} 
343
                          {% endwith %} 
344
                         {% endif %}
345
                {% endwith %} 
346
                      {% endwith %} 
347
                      {% endif %}
348
                      {% if form %}
349
                    {% if q %}
350
                        <h2>No projects found!</h2>
351
                    {% endif %}
352
                {% endif %}
353
      {% endif %}
354
    {% endwith %}
355
</div>
356
</div>  
357
{% endblock %}