Statistics
| Branch: | Tag: | Revision:

root / snf-astakos-app / astakos / im / templates / im / projects / project_detail.html @ 85d444db

History | View | Annotate | Download (8 kB)

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

    
3
{% load filters %}
4

    
5
{% block page.body %}
6
{% with object.project.approved_members as approved_members %}
7
{% with resource_catalog|populated_resource_catalog as resource_catalog%}
8
<div class="projects">
9
        
10

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

    
213
{% endwith %} 
214
{% endwith %}
215
{% endblock %}