Skip to content

Commit 1ae302c

Browse files
committed
Add info about last call/scheduled telechat to the request review page, fix a bug
- Legacy-Id: 11782
1 parent 78062ad commit 1ae302c

2 files changed

Lines changed: 27 additions & 1 deletion

File tree

ietf/doc/views_review.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
from django.template.loader import render_to_string
1010
from django.core.urlresolvers import reverse as urlreverse
1111

12-
from ietf.doc.models import Document, NewRevisionDocEvent, DocEvent, State, DocAlias
12+
from ietf.doc.models import Document, NewRevisionDocEvent, DocEvent, State, DocAlias, LastCallDocEvent
1313
from ietf.ietfauth.utils import is_authorized_in_doc_stream, user_is_person, has_role
1414
from ietf.name.models import ReviewRequestStateName, ReviewResultName, DocTypeName
1515
from ietf.review.models import ReviewRequest
@@ -47,6 +47,7 @@ def __init__(self, user, doc, *args, **kwargs):
4747

4848
self.doc = doc
4949

50+
self.fields['type'].queryset = self.fields['type'].queryset.filter(used=True)
5051
self.fields['type'].widget = forms.RadioSelect(choices=[t for t in self.fields['type'].choices if t[0]])
5152

5253
f = self.fields["team"]
@@ -115,9 +116,22 @@ def request_review(request, name):
115116
else:
116117
form = RequestReviewForm(request.user, doc)
117118

119+
now = datetime.datetime.now()
120+
121+
lc_ends = None
122+
e = doc.latest_event(LastCallDocEvent, type="sent_last_call")
123+
if e and e.expires >= now:
124+
lc_ends = e.expires
125+
126+
scheduled_for_telechat = doc.telechat_date()
127+
118128
return render(request, 'doc/review/request_review.html', {
119129
'doc': doc,
120130
'form': form,
131+
'lc_ends': lc_ends,
132+
'lc_ends_days': (lc_ends - now).days if lc_ends else None,
133+
'scheduled_for_telechat': scheduled_for_telechat,
134+
'scheduled_for_telechat_days': (scheduled_for_telechat - now.date()).days if scheduled_for_telechat else None,
121135
})
122136

123137
def review_request(request, name, request_id):

ietf/templates/doc/review/request_review.html

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,18 @@ <h1>Request review<br><small>{{ doc.name }}</small></h1>
1616

1717
<p>Submit a request to have the document reviewed.</p>
1818

19+
<p>
20+
<div>Current revision of the document: <strong>{{ doc.rev }}</strong>.</div>
21+
22+
{% if lc_ends %}
23+
<div>Last Call ends: <strong>{{ lc_ends|date:"Y-m-d" }}</strong> (in {{ lc_ends_days }} day{{ lc_ends_days|pluralize }}).</div>
24+
{% endif %}
25+
26+
{% if scheduled_for_telechat %}
27+
<div>Scheduled for telechat: <strong>{{ scheduled_for_telechat|date:"Y-m-d" }}</strong> (in {{ scheduled_for_telechat_days }} day{{ scheduled_for_telechat_days|pluralize }}).</div>
28+
{% endif %}
29+
</p>
30+
1931
<form class="form-horizontal" method="post">
2032
{% csrf_token %}
2133
{% bootstrap_field form.requested_by layout="horizontal" %}

0 commit comments

Comments
 (0)