Statistics
| Branch: | Tag: | Revision:

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

History | View | Annotate | Download (17 kB)

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

    
3
{% load astakos_tags %}
4
{% load filters %}
5

    
6
{% block page.body %} 
7
<div class="maincol {% block innerpage.class %}{% endblock %}">
8
    <div class="projects">
9
            <h2>PROJECTS</h2>
10
            {% if form %}
11
                    <p>Search for existing Projects and join the ones you like. Please search by Project name. </p>
12
                    <form action="{% url project_search %}" method="post" class="withlabels signup submit-inline">{% csrf_token %}
13
                            {% include "im/form_render.html" %}
14
                        <div class="form-row submit">
15
                                <input type="submit" class="submit altcol" value="SEARCH" />
16
                                {% if q %}<a href="{% url project_all %}">clear</a>{% endif %}
17
                        </div>
18
                    </form>
19
            {% else %}
20
             
21
            <div class="two-cols clearfix">
22
                        <div class="rt">
23
                                 &nbsp;
24
                        </div>
25
                        <div class="lt">
26
                                 <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>
27
                                 <p><a href="{% url how_it_works %}" style="font-size:1.154em;">How it works ></a></p>
28
                        </div>
29
                </div>
30
                
31
                
32
                <div class="widjets"> 
33
                        <!--<a href="#" class="widjet-x" title="remove boxes">X</a>-->
34
                        <ul class="clearfix">        
35
                                <li class="create">
36
                                        <div>
37
                                                <div class="wrap">
38

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