project_list.html 17.1 KB
Newer Older
Sofia Papagiannaki's avatar
Sofia Papagiannaki committed
1
2
3
4
5
6
7
8
9
10
{% extends "im/account_base.html" %}

{% load filters %}

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

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