Statistics
| Branch: | Tag: | Revision:

root / snf-astakos-app / astakos / im / templates / im / projects / project_list.html @ 2a965273

History | View | Annotate | Download (16.7 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 group -->
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="definition__member_accept_policy" {% if  == 'definition__member_accept_policy' %}selected{% endif %}>Sort by Member Accept Policy</option> 
70
                                        </select>
71
                                        <input type="hidden" name="q" value="{{q}}"/>
72
                                </div>
73
                        </form>
74
            <table class="alt-style complex" id="searchResults">
75
                <caption>
76
                    {% if q %}SEARCH RESULTS{% else %}ALL PROJECTS{% endif %}
77
                </caption>
78
                <thead>
79
                  <tr>
80
                    <th>Name</th>
81
                    <!--<th>Type</th>-->
82
                    <th>Issued</th>
83
                    <th>Starts</th>
84
                    <th>Expires</th>
85
                     
86
                    <th>Enrolled</th>
87
                   
88
                     
89
                    <th>Status</th>
90
                    <th>&nbsp;</th>
91
                                <th>Member accept policy</th>
92
                   <!-- <th>&nbsp;</th>-->
93
                  
94
                  </tr>
95
                </thead>
96
                <tbody>
97
                  {% for o in object_list %} 
98
                  {% with o.project.members as members %}
99
                  {% with o.project.approved_members as approved_members%}
100
                   <tr class="{% cycle 'tr1' 'tr2' %}">
101
                            <td style="width:22%"><a href="{% url project_detail o.serial %}" title="visit group page">{{o.definition.name|truncatename}}</a></td>
102
                            <!--td>{{o.kindname|capfirst}}</td-->
103
                            <td style="width:13%">{{o.issue_date|date:"d/m/Y"}}</td>
104
                            <td style="width:13%">{{o.definition.start_date|date:"d/m/Y"}}</td>
105
                            <td style="width:13%">{{o.definition.end_date|date:"d/m/Y"}}</td>
106
                            <td style="width:11%">{{approved_members|length}}</td>
107
                            
108
                            <td style="width:17%">
109
                                    <div class="msg-wrap">
110
                                {% if user == o.owner %}
111
                                    Owner
112
                                {% else %}
113
                                    {% if not user in members %}
114
                                        Not member
115
                                    {% else %}
116
                                        {% if user in approved_members %}
117
                                            Registered
118
                                        {% else %}
119
                                            Activation pending
120
                                        {% endif %}
121
                                    {% endif %}
122
                                {% endif %}
123
                                    </div>
124
                            </td>
125
                            <td style="width:15%">
126
                                    <div class="msg-wrap">
127
                                             
128
                                    {% if user in members %}
129
                                        {% if user in approved_members %}
130
                    
131
                                        
132
                                                       {% if not user == o.owner %}
133
                                                     
134
                                                    <form action="{% url project_leave o.serial %}" method="post" class="link-like">{% csrf_token %}
135
                                                         <input type="submit"  value="x leave group" class="leave"/>
136
                                                    </form>
137
                                                    <div class="dialog">
138
                                                                        Are you sure you what to leave this group?<br>
139
                                                                        Name: <a  href="{% url project_detail o.serial %}" title="visit group page">{{o.groupname}}</a><br>
140
                                                                        {% if o.definition.description %}Description:{{o.definition.description|truncatewords:30}}{% endif %}<br><br>
141
                                                                        
142
                                                                        <a href="#" class="yes submit">Yes</a>&nbsp;&nbsp;&nbsp;<a href="#" class="no submit">No</a>
143
                                                                </div>
144
                                                {% else %}
145
                                                         &nbsp;
146
                                                {% endif %}
147
                                        
148
                                            
149
                
150
                                        {% else %}
151
                                            &nbsp;
152
                                        {% endif %}
153
                                    {% else %}
154
                                        {% if o.project.is_alive %}
155
                                                <form action="{% url project_join o.serial %}" method="post" class="link-like">{% csrf_token %}
156
                                                    <input type="submit"   value="+ join group" class="join_group join" />
157
                                                </form>
158
                                                <div class="dialog">
159
                                                                        Are you sure you what to join this group?<br>
160
                                                                        Name: <a  href="{% url project_detail o.serial %}" title="visit group page">{{o.groupname}}</a><br>
161
                                                                        {% if o.definition.description %}Description:{{o.definition.description|truncatewords:30}}{% endif %}<br><br>
162
                                                                        
163
                                                                        <a href="#" class="yes submit">Yes</a>&nbsp;&nbsp;&nbsp;<a href="#" class="no submit">No</a>
164
                                                                </div>
165
                                        {% endif %}
166
                                    {% endif %}
167
                                    </div>
168
                            </td>
169
                                    <td class="centered" style="width:9%">{{o.definition.member_accept_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.definition.homepage%}
177
                                Project's home page: <a target="_blank" href="{{ o.homepage }}">{{ o.definition.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
                                        <form method="GET" class="minimal" action="#allGroups" id="mygroups">
218
                                                <div class="form-row">
219
                                                    <select name="sorting"  class="dropkicked"  tabindex="1">
220
                                                            <option value="definition__name">Sort by Name</option>
221
                                                    <!--<option value="kindname" {% if sorting == 'kindname' %}selected{% endif %}>Type</option>-->                        
222
                                                    <option value="definition__start_date" {% if  == 'definition__start_date' %}selected{% endif %}>Sort by Start Date</option>
223
                                            <option value="definition__issue_date" {% if  == 'definition__issue_date' %}selected{% endif %}>Sort by Issue date</option>                        
224
                                                    <option value="definition__expiration_date" {% if  == 'definition__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="definition__moderation_enabled" {% if  == 'definition__moderation_enabled' %}selected{% endif %}>Sort by Moderation</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.serial %}" title="visit group page">{{o.definition.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.definition.start_date|date:"d/m/Y"}}</td>
254
                                        <td style="width:13%">{{o.definition.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.serial %}" 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 group?<br>
296
                                                                                Name: <a  href="{% url project_detail o.serial %}" title="visit group page">{{o.groupname}}</a><br>
297
                                                                                {% if o.definition.description %}Description:{{o.definition.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.definition.description}}</p>
317
                                                        <p>{% if o.definition.homepage%}
318
                                                                                 Project's home page: <a href="{{ o.definition.homepage }}">{{ o.definition.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 %}