show.html 5.36 KB
Newer Older
1
{% extends "process/base.html" %}
2
3
4
5
6
7
8
9
10
11
12
13
{% load nm %}
{% load js %}

{% block head_resources %}
{{block.super}}
{% jsinclude "nm" %}
<style type="text/css">
.errorlist { color: red; }
</style>
{% endblock %}

{% block breadcrumbs %}{{block.super}}
14
/ {{person.a_link}}
15
16
17
{% endblock %}

{% block relatedpages %}
18
{{person.a_link}}
19
20
21
22
23
24
25
26
27
28
29
{{block.super}}
{% endblock %}

{% block content %}

<h1>{{person}} / {{process.applying_for|desc_status}}</h1>

{% with status=process.compute_status %}

<table class="personinfo">
  <tr><th>Applicant</th><td><a href="{{person.get_absolute_url}}">{{person.fullname}} &lt;{{person.preferred_email}}&gt;</a></td></tr>
Enrico Zini's avatar
Enrico Zini committed
30
  <tr><th>Activity timespan</th><td>{{status.log_first.logdate|date:"Y-m-d"}} to {{status.log_last.logdate|date:"Y-m-d"}}</td></tr>
31
  <tr>
Enrico Zini's avatar
Enrico Zini committed
32
33
34
35
    <th>Status</th>
    <td>
      {% if process.frozen_by %}
        {% if process.approved_by %}
36
          Approved by {{process.approved_by.a_link}} on {{process.approved_time|date:"Y-m-d"}}.
Enrico Zini's avatar
Enrico Zini committed
37
        {% else %}
38
          Frozen for review by {{process.frozen_by.a_link}} on {{process.frozen_time|date:"Y-m-d"}}.
Enrico Zini's avatar
Enrico Zini committed
39
40
41
        {% endif %}
      {% else %}
        {% if process.approved_by %}
42
          Inconsistent state: approved by {{process.approved_by.a_link}} on {{process.approved_time|date:"Y-m-d"}}, but not frozen for review.
Enrico Zini's avatar
Enrico Zini committed
43
44
45
46
47
        {% else %}
          Collecting requirements.
        {% endif %}
      {% endif %}
    </td>
48
49
50
51
52
53
54
55
56
  </tr>

  {% if process.closed %}
  <tr>
    <th>Completed</th>
    <td>{{process.closed|date:"Y-m-d"}}</td>
  </tr>
  {% endif %}

Enrico Zini's avatar
Enrico Zini committed
57
58
59
60
61
  {% if "advocate" in status.requirements %}
  <tr>
    <th>Advocate{{status.advocates|pluralize}}</th>
    <td>
      {% for a in status.advocates %}
62
      {{a.a_link}}{% if not forloop.last %}, {% endif %}
Enrico Zini's avatar
Enrico Zini committed
63
64
65
66
67
68
69
      {% empty %}
      <a href="{{status.requirements.advocate.get_absolute_url}}">none yet</a>
      {% endfor %}
    </td>
  </tr>
  {% endif %}

Enrico Zini's avatar
Enrico Zini committed
70
71
72
73
  {% with process.current_am_assignment as am %}
  {% if am %}
  <tr>
    <th>Application Manager</th>
74
    <td>{{am.am.person.a_link}} assigned by {{am.assigned_by.a_link}} on {{am.assigned_time|date:"Y-m-d"}}</td>
Enrico Zini's avatar
Enrico Zini committed
75
76
77
78
  </tr>
  {% endif %}
  {% endwith %}

79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
  <tr>
    <th>Missing requirements</th>
    <td>
      {% if status.requirements_missing %}
        {% for req in status.requirements_missing %}
        <a href="{{req.get_absolute_url}}">{{req}}</a>{% if not forloop.last %},{% endif %}
        {% endfor %}
      {% else %}
        none
      {% endif %}
    </td>
  </tr>

  <tr>
    <th>Requirements ok</th>
    <td>
      {% if status.requirements_ok %}
        {% for req in status.requirements_ok %}
        <a href="{{req.get_absolute_url}}">{{req}}</a>{% if not forloop.last %},{% endif %}
        {% endfor %}
      {% else %}
        none
      {% endif %}
    </td>
  </tr>

105
  {% if "fd_comments" in visit_perms %}
Enrico Zini's avatar
Enrico Zini committed
106
  <tr id="view_fd_comment"><th>FD comments</th><td>{{process.fd_comment}}</td></tr>
107
108
  {% endif %}

Enrico Zini's avatar
Enrico Zini committed
109
  {% if "view_mbox" in visit_perms %}
Enrico Zini's avatar
Enrico Zini committed
110
  <tr id="view_mbox">
111
112
113
114
115
116
117
118
119
120
    <th>Mail archive</th>
    <td>
        <tt><a href="mailto:{{process.archive_email}}">{{process.archive_email}}</a></tt>
        {% if process.mailbox_file %}
        <a href="{% url 'process_mailbox_download' pk=process.pk %}">(download mail archive)</a>
        <a href="{% url 'process_mailbox_show' pk=process.pk %}">(display mail archive)</a>
        {% else %}
        (no mail archive yet)
        {% endif %}
    </td>
121
  </tr>
122
123

  {% comment %} TODO: Requires porting stats backend to new Process
124
125
126
127
128
129
130
131
132
133
134
135
136
  {% if mbox_stats %}
  <tr><th>Mailbox stats</th>
      <td>{{mbox_stats.date_first_py|date:"Y-m-d"}} to {{mbox_stats.date_last_py|date:"Y-m-d"}},
          {{mbox_stats.num_mails}} mails,
          <br>
          {% if mbox_stats.median_py %}
            {% if mbox_stats.median_py.days %}{{mbox_stats.median_py.days}}d {% endif %}{{mbox_stats.median_hours}}h median response time
          {% endif %}
          <span class="mbox_sparkline" values="{{mbox_stats.response_time|join:","}}"></span>
      </td>
  </tr>
  {% endif %}
  {% endcomment %}
137
138

  {% endif %}
139
140
141
</table>

{% comment %}
Enrico Zini's avatar
Enrico Zini committed
142
{% if "edit_bio" in visit_perms or "edit_ldap" in visit_perms %}
143
144
145
146
<a href="{% url 'restricted_person' key=person.lookup_key %}">Edit personal information</a>
{% endif %}
{% endcomment %}

147
<h2>Requirements</h2>
148
149

<table>
150
151
152
153
154
  <thead>
    <tr>
      <th>Requirement</th>
      <th>Satisfied</th>
      <th>Approved by</th>
Enrico Zini's avatar
Enrico Zini committed
155
      <th>Approved date</th>
156
157
158
159
      <th>Notes</th>
    </tr>
  </thead>
  <tbody>
Enrico Zini's avatar
Enrico Zini committed
160
    {% for req in status.requirements_sorted %}
161
162
163
164
    <tr>
      {% with req.compute_status as rstatus %}
      <td><a href="{{req.get_absolute_url}}">{{req}}</a></td>
      <td>{{rstatus.satisfied|yesno}}</td>
Enrico Zini's avatar
Enrico Zini committed
165
166
      <td>
        {% if req.approved_by %}
167
          {{req.approved_by.a_link}}
Enrico Zini's avatar
Enrico Zini committed
168
169
170
171
172
173
174
175
176
177
178
        {% else %}
          -
        {% endif %}
      </td>
      <td>
        {% if req.approved_time %}
          {{req.approved_time|date:"Y-m-d"}}
        {% else %}
          -
        {% endif %}
      </td>
179
180
181
182
183
184
185
186
187
      <td>
        {% for nclass, ntext in rstatus.notes %}
        <span class="{{nclass}}">{{ntext}}</span>{% if not forloop.last %}<br>{% endif %}
        {% endfor %}
      </td>
      {% endwith %}
    </tr>
    {% endfor %}
  </tbody>
188
189
</table>

Enrico Zini's avatar
Enrico Zini committed
190
<a href="{% url 'process_download_statements' pk=process.pk %}">(download all signed statements in a single mailbox file)</a>
191
192
193

{% endwith %}

194
<h3>Log</h2>
195

196
197
{% include "process/log_widget.html"  with entries=process.log.all %}

198
{% endblock %}