Statistics
| Branch: | Tag: | Revision:

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

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