Statistics
| Branch: | Tag: | Revision:

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

History | View | Annotate | Download (5.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 %}
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
          {% endif %}]
17
        {% else %}
18
          <!-- application view -->
19
          [ PROJECT {% if object.is_modification %} MODIFICATION {% endif %}
20
          {{ object.state_display|upper }} ]
21
        {% endif %}
22

    
23
      {% else %}
24
        <!-- third user -->
25
        <!-- assert in project view -->
26
        <!-- there is always a project, may be deactivated -->
27
        [
28
        {% if project.is_deactivated %}
29
        PROJECT {{ project.state_display|upper }} -
30
        {% endif %}
31
        {{ mem_display|upper }} ]
32
      {% endif %}
33
    </em>
34

    
35
    <span>
36
      {% if not project_view %}
37
        <!-- owner mode only assumed -->
38
        {% if object.is_modification %}
39
          <span class="extratitle">MODIFICATION OF </span>
40
        {% endif %}
41
      {% endif %}
42
      {{ object.name|upper }}
43
    </span>
44

    
45
    <!-- make room for buttons -->
46
    {% if owner_mode or can_join_request or can_leave_request %}
47
      <br />
48
    {% endif %}
49

    
50
    {% if owner_mode %}
51
      <a style="font-size:0.7em"
52
         href="{% url astakos.im.views.project_modify object.pk %}">MODIFY</a>
53

    
54
      {% with object.last_pending_incl_me as last_pending %}
55
      {% if last_pending %}
56
        -
57
        <a style="font-size:0.7em"
58
           href="{% url astakos.im.views.project_app_cancel last_pending.pk %}">
59
          CANCEL {% if object.is_modification %} MODIFICATION {% else %}
60
          PROJECT {% endif %} REQUEST
61
        </a>
62
      {% endif %}
63
      {% endwith %}
64

    
65
      <!-- only one is possible, perhaps add cancel button too -->
66
      {% if can_join_request or can_leave_request %}
67
        <br />
68
      {% endif %}
69
    {% endif %}
70

    
71
    {% if can_join_request %}
72
      <a style="font-size:0.7em"
73
         href="{% url astakos.im.views.project_join project.pk %}">JOIN</a>
74
    {% endif %}
75

    
76
    {% if can_leave_request %}
77
      <a style="font-size:0.7em"
78
         href="{% url astakos.im.views.project_leave project.pk %}">LEAVE</a>
79
    {% endif %}
80
  </h2>
81

    
82
  <div class="full-dotted">
83
    <h3>PROJECT DETAILS</h3>
84
    <dl class="alt-style">
85
      <dt>Name</dt>
86
      <dd>{{ object.name }}&nbsp;</dd>
87
      <dt>Homepage url</dt>
88
      <dd>
89
        {% if object.homepage%}
90
        <a href="{{ object.homepage }}">{{ object.homepage }}</a>
91
        {% else %}
92
        Not set yet
93
        {% endif %}
94
      </dd>
95
      <dt>Description</dt>
96
      <dd>{{ object.description }}&nbsp;</dd>
97

    
98
      {% if owner_mode %}
99
        <dt>Application date</dt>
100
        <dd>{{object.issue_date|date:"d/m/Y"}}&nbsp;</dd>
101
      {% endif %}
102

    
103
      <dt>Start date</dt>
104
      <dd>{{object.start_date|date:"d/m/Y"}}&nbsp;</dd>
105
      <dt>End Date</dt>
106
      <dd>{{object.end_date|date:"d/m/Y"}}&nbsp;</dd>
107

    
108
      {% if owner_mode %}
109
        <dt>Comments</dt>
110
        <dd>{{ object.comments }}&nbsp;</dd>
111
      {% endif %}
112

    
113
      <dt>Owner</dt>
114
      <dd>
115
        {% if owner_mode %}
116
        Me
117
        {% else %}
118
        {{object.owner.realname}} {% if user.is_superuser %}({{object.owner.email}}){% endif %}
119
        {% endif %}
120
        &nbsp;
121
      </dd>
122
    </dl>
123
  </div>
124

    
125
  <div class="full-dotted">
126
    <h3>MEMBERSHIP OPTIONS</h3>
127
    <dl class="alt-style">
128
      <dt>Max participants</dt>
129
      <dd>
130
        {% if object.limit_on_members_number %}
131
        {{object.limit_on_members_number}}
132
        {% else %}&nbsp;{% endif %}
133
      </dd>
134
      <dt>Member join policy</dt>
135
      <dd>
136
        {{ object.member_join_policy_display|title }}
137
      </dd>
138
      <dt>Member leave policy</dt>
139
      <dd>
140
        {{ object.member_leave_policy_display|title }}
141
      </dd>
142
    </dl>
143
  </div>
144

    
145
  <div class="full-dotted">
146
    <h3>RESOURCES</h3>
147
    {% if object.projectresourcegrant_set.all %}
148
    <dl class="alt-style">
149
      {% for rp in object.projectresourcegrant_set.all %}
150
      <dt>Max {{rp.resource.pluralized_display_name}} per user</dt>
151
      <dd>{{rp.display_member_capacity}}</dd>
152
      {% empty %}
153
      No resources
154
      {% endfor %}
155
    </dl>
156
    {% else %}
157
    <p>No resources</p>
158
    {% endif %}
159
  </div>
160

    
161
  {% if owner_mode and project_view %}
162
    {% if object.project.is_alive %}
163
      <div class="full-dotted">
164
        <h3>MEMBERS</h3>
165
        {% if members_table %}
166
        {% render_table members_table %}
167
        {% endif %}
168
      </div>
169

    
170
      {% if not project.is_deactivated %}
171
        <div class="full-dotted">
172
          <form action="{% url project_detail object.chain %}#members-table"
173
                method="post" class="withlabels" >
174
            {% csrf_token %}
175
            <h2>Enroll more members</h2>
176
            {% with addmembers_form as form %}
177
            {% include "im/form_render.html" %}
178
            {% endwith %}
179
            <div class="form-row submit">
180
              <input type="submit" class="submit altcol" value="ADD MEMBERS" />
181
            </div>
182
          </form>
183
        </div>
184
      {% endif %}
185
    {% endif %}
186

    
187
    {% comment %}
188
      {% if modifications_table %}
189
      <div class="full-dotted">
190
        <h3>MODIFICATION REQUESTS</h3>
191
        {% render_table modifications_table %}
192
      </div>
193
      {% endif %}
194
    {% endcomment %}
195

    
196
  {% endif %}
197

    
198
  <div class="full-dotted">
199
    <p>
200
      <a href="{% url project_list %}">&lt; Back to Projects</a>
201
    </p>
202
  </div>
203

    
204
{% endwith %}
205
{% endblock %}