project_detail.html 8.05 KB
Newer Older
Sofia Papagiannaki's avatar
Sofia Papagiannaki committed
1
2
3
4
5
{% extends "im/account_base.html" %}

{% load filters %}

{% block page.body %}
Sofia Papagiannaki's avatar
Sofia Papagiannaki committed
6
{% with object.project.approved_members as approved_members %}
7
{% with resource_catalog|populated_resource_catalog as resource_catalog%}
Sofia Papagiannaki's avatar
Sofia Papagiannaki committed
8
9
10
11
<div class="projects">
	

	<h2>
Sofia Papagiannaki's avatar
Sofia Papagiannaki committed
12
13
        <em>
            {% if user == object.owner %}
Olga Brani's avatar
Olga Brani committed
14
                [ ADMINISTRATOR - {{ object.state|upper }} ]
Sofia Papagiannaki's avatar
Sofia Papagiannaki committed
15
16
17
18
19
20
21
22
            {%  else %}
                {% if  user in approve_members %}
                    [ ENROLLED - ACTIVE ]
                {% else %}
                    [ ENROLLED - PENDING ]
                {% endif %}
            {% endif %}
        </em>
23
	 	<span>{{ object.name|upper }}</span>
Sofia Papagiannaki's avatar
Sofia Papagiannaki committed
24
25
26
	 </h2>
	 
	 <div class="full-dotted">
27
		 <h3>PROJECT DETAILS</h3>
Sofia Papagiannaki's avatar
Sofia Papagiannaki committed
28
29
		 <dl class="alt-style">
		 	<dt>Name</dt>
30
		 	<dd>{{ object.name }}&nbsp;</dd>
31
		 	<dt>Homepage url</dt>
Sofia Papagiannaki's avatar
Sofia Papagiannaki committed
32
            <dd>
33
34
                {% if object.homepage%}
                    <a href="{{ object.homepage }}">{{ object.homepage }}</a>
Sofia Papagiannaki's avatar
Sofia Papagiannaki committed
35
36
37
38
                {% else %}
                    Not set yet
                {% endif %}
            </dd>
39
40
41
42
43
		 	<dt>Description</dt>
		 	<dd>{{ object.description }}&nbsp;</dd>
            
            
		 	<dt>Issue date</dt>
Sofia Papagiannaki's avatar
Sofia Papagiannaki committed
44
		 	<dd>{{object.issue_date|date:"d/m/Y"}}&nbsp;</dd>
45
		 	<dt>Start date</dt>
46
		 	<dd>{{object.start_date|date:"d/m/Y"}}&nbsp;</dd>
Sofia Papagiannaki's avatar
Sofia Papagiannaki committed
47
		 	<dt>End Date</dt>
48
		 	<dd>{{object.end_date|date:"d/m/Y"}}&nbsp;</dd>
49
50
		 	<dt>Comments</dt>
		 	<dd>{{ object.comments }}&nbsp;</dd>
Sofia Papagiannaki's avatar
Sofia Papagiannaki committed
51
		 	<dt>Status</dt>
Sofia Papagiannaki's avatar
Sofia Papagiannaki committed
52
		 	<dd>{{ object.state }}</dd>
Sofia Papagiannaki's avatar
Sofia Papagiannaki committed
53
		 	<dt>Owner</dt>
Sofia Papagiannaki's avatar
Sofia Papagiannaki committed
54
		 	<dd>{% if user == object.owner %}
Sofia Papagiannaki's avatar
Sofia Papagiannaki committed
55
                        Me
Sofia Papagiannaki's avatar
Sofia Papagiannaki committed
56
                {% else%}
Sofia Papagiannaki's avatar
Sofia Papagiannaki committed
57
                    {{object.owner.realname}} {% if user.is_superuser %}({{object.owner.email}}){% endif %}
Sofia Papagiannaki's avatar
Sofia Papagiannaki committed
58
59
                {% endif %}
                &nbsp;
Sofia Papagiannaki's avatar
Sofia Papagiannaki committed
60
            </dd>
61
            
Sofia Papagiannaki's avatar
Sofia Papagiannaki committed
62
63
64
65
66
67
68
69
70
71
72
73
74
75
		 	<dt>Precursor Application</dt>
		 	<dd>
		 	    {% if object.precursor_application %}
                    <a href="{% url project_detail object.precursor_application.id %}">{{object.precursor_application.id}}</a>
                {% endif %}
                &nbsp;
		 	</dd>
		 	<dt>Follower Application</dt>
		 	<dd>
		 	    {% if object.follower %}
                    <a href="{% url project_detail object.follower.id %}">{{object.follower.id}}</a>
                {% endif %}
                &nbsp;
		 	</dd>
Sofia Papagiannaki's avatar
Sofia Papagiannaki committed
76
77
		 </dl>
	 </div>
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
	 <div class="full-dotted">
		 <h3>MEMBERSHIP OPTIONS</h3>
		 <dl class="alt-style">
		 	<dt>Max participants</dt>
		 	<dd>{% if object.limit_on_members_number%}{{object.limit_on_members_number}}{% else %}&nbsp;{% endif %}</dd>
		 	<dt>Member join policy</dt>
            <dd>
                {{ object.member_join_policy }}
            </dd>
		 	<dt>Member leave policy</dt>
            <dd>
                {{ object.member_leave_policy }}
            </dd>
		 </dl>
	 </div>
Sofia Papagiannaki's avatar
Sofia Papagiannaki committed
93
	 <div class="full-dotted">
Sofia Papagiannaki's avatar
Sofia Papagiannaki committed
94
		 <h3>RESOURCES</h3>
95
		 {% if object.projectresourcegrant_set.all %}
Sofia Papagiannaki's avatar
Sofia Papagiannaki committed
96
	     <dl class="alt-style">	
97
	 		{% for rp in object.projectresourcegrant_set.all %}
98
99
100
                {% with resource_catalog|lookup:'resources' as resource_info %}
                    {% with rp.resource|to_unicode as resource_name %}
                        {% with resource_info|lookup:resource_name as decorated_resource %}
Sofia Papagiannaki's avatar
Sofia Papagiannaki committed
101
		 		<dt>
102
       				Max {% if decorated_resource.is_abbreviation %}{{ decorated_resource.verbose_name|upper }}{% else %}{{ decorated_resource.verbose_name }}{% endif %}{% if not q.unit %}s {% endif  %}  per user
Sofia Papagiannaki's avatar
Sofia Papagiannaki committed
103
104
       			</dt>
		 		<dd>
105
106
107
       			{% if rp.member_capacity %}
       				 {% if decorated_resource.unit %}
       				 	{{ rp.member_capacity|sizeof_fmt }}
Sofia Papagiannaki's avatar
Sofia Papagiannaki committed
108
       				 {% else %}
109
       				 	{{ rp.member_capacity|isinf }}
Sofia Papagiannaki's avatar
Sofia Papagiannaki committed
110
111
112
113
114
       				 {% endif %}
       			{% else %}
       				Unlimited
       			{% endif %}
       			</dd>
115
116
117
       			        {% endwith %}
       			    {% endwith %}
       			{% endwith %}
Sofia Papagiannaki's avatar
Sofia Papagiannaki committed
118
119
120
121
122
123
124
125
126
127
       		{% empty %}
       			No resources
	 		{% endfor %}
	 		
	 		
	 	</dl>
		{% else %}
            <p>No resources</p>
        {% endif %} 
	 </div>
Sofia Papagiannaki's avatar
Sofia Papagiannaki committed
128
     {% if object.project.is_alive %}
Sofia Papagiannaki's avatar
Sofia Papagiannaki committed
129
130
	 <div class="full-dotted">
	    {% with page|concat:sorting as args %}
Sofia Papagiannaki's avatar
Sofia Papagiannaki committed
131
	    {% with object.project.projectmembership_set.select_related.all|paginate:args as membership %}
Sofia Papagiannaki's avatar
Sofia Papagiannaki committed
132
            {% if membership %}
Olga Brani's avatar
Olga Brani committed
133
             
Sofia Papagiannaki's avatar
Sofia Papagiannaki committed
134
135
136
137
             <table class="alt-style" id="members-table">
                <caption>MEMBERS:</caption>
                <thead>
                    <tr>
Sofia Papagiannaki's avatar
Sofia Papagiannaki committed
138
                        {%if user.is_superuser or user == object.owner %}<th>User Email</th>{% endif %}
Sofia Papagiannaki's avatar
Sofia Papagiannaki committed
139
140
141
142
143
144
145
                        <th>Name</th>
                        <th>Status</th>
                    </tr>
                </thead>
                <tbody>
                {% for m in membership.object_list %}
                  <tr>
Sofia Papagiannaki's avatar
Sofia Papagiannaki committed
146
                    {%if user.is_superuser or user == object.owner %}<td>{{m.person.email}}</td>{% endif %}
Sofia Papagiannaki's avatar
Sofia Papagiannaki committed
147
                    <td>{{m.person.realname}}</td>
Sofia Papagiannaki's avatar
Sofia Papagiannaki committed
148
                    {% if m.person == object.owner %}
Sofia Papagiannaki's avatar
Sofia Papagiannaki committed
149
150
                    <td>Owner</td>
                    {% else %}
Sofia Papagiannaki's avatar
Sofia Papagiannaki committed
151
                        {% if m.acceptance_date %}
Sofia Papagiannaki's avatar
Sofia Papagiannaki committed
152
                        <td>Approved {% if m.leave_request_date%}(User has requested to leave the project on:{{m.leave_request_date}}){% endif %}
Sofia Papagiannaki's avatar
Sofia Papagiannaki committed
153
154
                            {% if user == object.owner and user != m.person %}
                                <a href="{% url project_remove_member object.id m.person.id  %}?{% if page %}page={{ page }}{% endif %}{% if sorting %}&sorting={{sorting}}{% endif %}">Remove</a>
Sofia Papagiannaki's avatar
Sofia Papagiannaki committed
155
156
157
158
                            {% endif %}
                        </td>
                        {% else %}
                        <td>Pending
Sofia Papagiannaki's avatar
Sofia Papagiannaki committed
159
                            {% if user == object.owner %}
160
                                <a href="{% url project_accept_member object.id m.person.id %}?{% if page %}page={{ page }}{% endif %}{% if sorting %}&sorting={{sorting}}{% endif %}">Accept</a>
Sofia Papagiannaki's avatar
Sofia Papagiannaki committed
161
                                <a href="{% url project_reject_member object.id m.person.id  %}?{% if page %}page={{ page }}{% endif %}{% if sorting %}&sorting={{sorting}}{% endif %}">Reject</a>
Sofia Papagiannaki's avatar
Sofia Papagiannaki committed
162
163
164
165
166
167
168
169
170
171
172
                            {% endif %}
                        </td>    
                        {% endif %}
                    {% endif %}
                  </tr>
                {% endfor %}
                </tbody>
             </table>
             <div class="pagination">
                <p class="next-prev">
                    {% if membership.has_previous %}
Olga Brani's avatar
Olga Brani committed
173
174
175
                        <a href="?page={{ membership.previous_page_number }}{% if sorting %}&sorting={{sorting}}{% endif %}">< previous</a>
                    {% else %}
                    	<a href="javascript:void()" class="disabled">< previous</a>
Sofia Papagiannaki's avatar
Sofia Papagiannaki committed
176
177
                    {% endif %}
                    {% if membership.has_next %}
Olga Brani's avatar
Olga Brani committed
178
179
180
                        <a href="?page={{ membership.next_page_number }}{% if sorting %}&sorting={{sorting}}{% endif %}">next ></a>
                    {% else %}
                    	<a href="javascript:void()" class="disabled">next ></a>    
Sofia Papagiannaki's avatar
Sofia Papagiannaki committed
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
                    {% endif %}
                </p>
                <p class="nums">
                    <span class="current">
                        Page {{ membership.number }} of {{ membership.paginator.num_pages }}
                    </span>
                </p>
            </div>
             {% else %}
                <p>No members yet!</p>
            {% endif %}
        {% endwith %}
        {% endwith %}
	 </div>
     
     
    
    <div class="full-dotted">
Sofia Papagiannaki's avatar
Sofia Papagiannaki committed
199
        <form action="{% url project_detail object.id %}#members-table" method="post" class="withlabels" >{% csrf_token %}
Sofia Papagiannaki's avatar
Sofia Papagiannaki committed
200
201
202
203
204
205
206
207
208
209
210
211
            <h2>Enroll more members</h2>
                {% with addmembers_form as form %}
                    {% include "im/form_render.html" %}
                {% endwith %}
                <div class="form-row submit">
                    <input type="submit" class="submit altcol" value="ADD MEMBERS" />
                </div>
        </form>
    </div>
    {% endif %}
    <div class="full-dotted">
        <p>
212
        	<a href="{% url project_list %}">back to Projects &gt;</a>
Sofia Papagiannaki's avatar
Sofia Papagiannaki committed
213
214
215
216
217
218
        </p>
        </ul>
    </div>
     
    
</div>
219
220

{% endwith %} 
Sofia Papagiannaki's avatar
Sofia Papagiannaki committed
221
{% endwith %}
Sofia Papagiannaki's avatar
Sofia Papagiannaki committed
222
{% endblock %}