Statistics
| Branch: | Tag: | Revision:

root / snf-astakos-app / astakos / im / templates / im / projects / project_detail.html @ 022cc8e2

History | View | Annotate | Download (6.6 kB)

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

    
3
{% load astakos_tags filters django_tables2 %}
4

    
5
{% block page.body %}
6
{% with object.project as project %}
7
<div class="projects">
8
  <h2>
9
    <em>
10
      {% if owner_mode or admin_mode %}
11
        {% if project_view %}
12
           PROJECT {{ object.project_state_display|upper }}
13
          {% if object.has_pending_modifications %} -
14
             <a href="{% url astakos.im.views.project_app object.last_pending.pk %}">
15
               MODIFICATION PENDING</a>
16
          {% else %}
17
             <!-- note that pending modifications have priority -->
18
             {% if object.has_denied_modifications %} -
19
             <a href="{% url astakos.im.views.project_app object.last_denied.pk %}">
20
               MODIFICATION DENIED</a>
21
             {% endif %}
22
          {% endif %}
23
        {% else %}
24
          <!-- application view -->
25
           PROJECT {% if object.is_modification %} MODIFICATION {% endif %}
26
          {{ object.state_display|upper }} 
27
        {% endif %}
28

    
29
      {% else %}
30
        <!-- third user -->
31
        <!-- assert in project view -->
32
        <!-- there is always a project, may be deactivated -->
33
        
34
        {% if project.is_deactivated %}
35
        PROJECT {{ project.state_display|upper }} -
36
        {% endif %}
37
        {{ mem_display|upper }} 
38
      {% endif %}
39
    </em>
40

    
41
    <span>
42
      {% if not project_view %}
43
        <!-- owner mode only assumed -->
44
        {% if object.is_modification %}
45
          <span class="extratitle">MODIFICATION OF </span>
46
        {% endif %}
47
      {% endif %}
48
      {{ object.name|upper }}
49
    </span>
50

    
51
    <!-- make room for buttons -->
52
    {% if owner_mode or admin_mode or can_join_request or can_leave_request %}
53
      <br />
54
    {% endif %}
55

    
56
    {% if owner_mode or admin_mode %}
57
      <a style="font-size:0.7em"
58
         href="{% url astakos.im.views.project_modify object.pk %}">MODIFY</a>
59

    
60
      {% if owner_mode %}
61
          {% with object.last_pending_incl_me as last_pending %}
62
          {% if last_pending %}
63
            -
64
            <a style="font-size:0.7em"
65
               href="{% url astakos.im.views.project_app_cancel last_pending.pk %}">
66
              CANCEL {% if object.project_exists %} MODIFICATION {% else %}
67
              PROJECT {% endif %} REQUEST
68
            </a>
69
          {% endif %}
70
          {% endwith %}
71
      {% endif %}
72

    
73
      {% if admin_mode %}
74
          {% if object.can_approve %}
75
              - <a style="font-size:0.7em"
76
                  href="{% url astakos.im.views.project_app_approve object.pk %}">
77
                  APPROVE</a>
78
              - <a style="font-size:0.7em"
79
                  href="{% url astakos.im.views.project_app_deny object.pk %}">
80
                  DENY</a>
81
          {% endif %}
82
      {% endif %}
83

    
84
      {% if owner_mode %}
85
          {% if object.can_dismiss %}
86
             - <a style="font-size:0.7em"
87
                href="{% url astakos.im.views.project_app_dismiss object.pk %}">
88
                DISMISS</a>
89
          {% endif %}
90
      {% endif %}
91
      <!-- only one is possible, perhaps add cancel button too -->
92
      {% if can_join_request or can_leave_request %}
93
        <br />
94
      {% endif %}
95
    {% endif %}
96

    
97
    {% if can_join_request %}
98
      <a style="font-size:0.7em"
99
         href="{% url astakos.im.views.project_join project.pk %}">JOIN</a>
100
    {% endif %}
101

    
102
    {% if can_leave_request %}
103
      <a style="font-size:0.7em"
104
         href="{% url astakos.im.views.project_leave project.pk %}">LEAVE</a>
105
    {% endif %}
106
  </h2>
107

    
108
  <div class="full-dotted">
109
    <h3>PROJECT DETAILS</h3>
110
    <dl class="alt-style">
111
      <dt>Name</dt>
112
      <dd>{{ object.name }}&nbsp;</dd>
113
      <dt>Homepage url</dt>
114
      <dd>
115
        {% if object.homepage%}
116
        <a href="{{ object.homepage }}">{{ object.homepage }}</a>
117
        {% else %}
118
        Not set yet
119
        {% endif %}
120
      </dd>
121
      <dt>Description</dt>
122
      <dd>{{ object.description }}&nbsp;</dd>
123

    
124
      {% if owner_mode %}
125
        <dt>Application date</dt>
126
        <dd>{{object.issue_date|date:"d/m/Y"}}&nbsp;</dd>
127
      {% endif %}
128

    
129
      <dt>Start date</dt>
130
      <dd>{{object.start_date|date:"d/m/Y"}}&nbsp;</dd>
131
      <dt>End Date</dt>
132
      <dd>{{object.end_date|date:"d/m/Y"}}&nbsp;</dd>
133

    
134
      {% if owner_mode %}
135
        <dt>Comments</dt>
136
        <dd>{{ object.comments }}&nbsp;</dd>
137
      {% endif %}
138

    
139
      <dt>Owner</dt>
140
      <dd>
141
        {% if owner_mode %}
142
        Me
143
        {% else %}
144
        {{object.owner.realname}} {% if user.is_superuser %}({{object.owner.email}}){% endif %}
145
        {% endif %}
146
        &nbsp;
147
      </dd>
148
    </dl>
149
  </div>
150

    
151
  <div class="full-dotted">
152
    <h3>MEMBERSHIP OPTIONS</h3>
153
    <dl class="alt-style">
154
      <dt>Max participants</dt>
155
      <dd>
156
        {% if object.limit_on_members_number %}
157
        {{object.limit_on_members_number}}
158
        {% else %}&nbsp;{% endif %}
159
      </dd>
160
      <dt>Member join policy</dt>
161
      <dd>
162
        {{ object.member_join_policy_display|title }}
163
      </dd>
164
      <dt>Member leave policy</dt>
165
      <dd>
166
        {{ object.member_leave_policy_display|title }}
167
      </dd>
168
    </dl>
169
  </div>
170

    
171
  <div class="full-dotted">
172
    <h3>RESOURCES</h3>
173
    {% if object.projectresourcegrant_set.all %}
174
    <dl class="alt-style">
175
      {% for rp in object.projectresourcegrant_set.all %}
176
      <dt>Max {{rp.resource.pluralized_display_name}} per user</dt>
177
      <dd>{{rp.display_member_capacity}}</dd>
178
      {% empty %}
179
      No resources
180
      {% endfor %}
181
    </dl>
182
    {% else %}
183
    <p>No resources</p>
184
    {% endif %}
185
  </div>
186

    
187
  {% if owner_mode and project_view %}
188
    {% if object.project.is_alive %}
189
      <div class="full-dotted">
190
        <h3>MEMBERS</h3>
191
        {% if members_table %}
192
        {% render_table members_table %}
193
        {% endif %}
194
      </div>
195

    
196
      {% if not project.is_deactivated %}
197
        <div class="full-dotted">
198
          <form action="{% url project_detail object.chain %}#members-table"
199
                method="post" class="withlabels" >
200
            {% csrf_token %}
201
            <h2>Enroll more members</h2>
202
            {% with addmembers_form as form %}
203
            {% include "im/form_render.html" %}
204
            {% endwith %}
205
            <div class="form-row submit">
206
              <input type="submit" class="submit altcol" value="ADD MEMBERS" />
207
            </div>
208
          </form>
209
        </div>
210
      {% endif %}
211
    {% endif %}
212

    
213
    {% comment %}
214
      {% if modifications_table %}
215
      <div class="full-dotted">
216
        <h3>MODIFICATION REQUESTS</h3>
217
        {% render_table modifications_table %}
218
      </div>
219
      {% endif %}
220
    {% endcomment %}
221

    
222
  {% endif %}
223

    
224
  <div class="full-dotted">
225
    <p>
226
      <a href="{% url project_list %}">&lt; Back to Projects</a>
227
    </p>
228
  </div>
229

    
230
{% endwith %}
231
{% endblock %}