Skip to content

Commit ec80763

Browse files
committed
Updated test cases to reflect the split of the ballot writeups page
Cleaned out old ballot writups view and url Modified layout of the writups tab for IESG and Secretariat - Legacy-Id: 2480
1 parent a58253d commit ec80763

4 files changed

Lines changed: 30 additions & 136 deletions

File tree

rjs/ietf/idrfc/tests.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,7 @@ class BallotWriteupsTestCase(django.test.TestCase):
470470

471471
def test_edit_last_call_text(self):
472472
draft = InternetDraft.objects.get(filename="draft-ietf-mipshop-pfmipv6")
473-
url = urlreverse('doc_ballot_writeups', kwargs=dict(name=draft.filename))
473+
url = urlreverse('doc_ballot_lastcall', kwargs=dict(name=draft.filename))
474474
login_testing_unauthorized(self, "klm", url)
475475

476476
# normal get
@@ -507,7 +507,7 @@ def test_edit_last_call_text(self):
507507

508508
def test_request_last_call(self):
509509
draft = InternetDraft.objects.get(filename="draft-ietf-mipshop-pfmipv6")
510-
url = urlreverse('doc_ballot_writeups', kwargs=dict(name=draft.filename))
510+
url = urlreverse('doc_ballot_lastcall', kwargs=dict(name=draft.filename))
511511
login_testing_unauthorized(self, "klm", url)
512512

513513
mailbox_before = len(mail_outbox)
@@ -524,7 +524,7 @@ def test_request_last_call(self):
524524

525525
def test_edit_ballot_writeup(self):
526526
draft = InternetDraft.objects.get(filename="draft-ietf-mipshop-pfmipv6")
527-
url = urlreverse('doc_ballot_writeups', kwargs=dict(name=draft.filename))
527+
url = urlreverse('doc_ballot_writeupnotes', kwargs=dict(name=draft.filename))
528528
login_testing_unauthorized(self, "klm", url)
529529

530530
# normal get
@@ -544,7 +544,7 @@ def test_edit_ballot_writeup(self):
544544

545545
def test_issue_ballot(self):
546546
draft = InternetDraft.objects.get(filename="draft-ietf-mipshop-pfmipv6")
547-
url = urlreverse('doc_ballot_writeups', kwargs=dict(name=draft.filename))
547+
url = urlreverse('doc_ballot_writeupnotes', kwargs=dict(name=draft.filename))
548548
login_testing_unauthorized(self, "rhousley", url)
549549

550550
draft.idinternal.ballot.ballot_issued = False
@@ -579,7 +579,7 @@ def test_issue_ballot(self):
579579

580580
def test_edit_approval_text(self):
581581
draft = InternetDraft.objects.get(filename="draft-ietf-mipshop-pfmipv6")
582-
url = urlreverse('doc_ballot_writeups', kwargs=dict(name=draft.filename))
582+
url = urlreverse('doc_ballot_approvaltext', kwargs=dict(name=draft.filename))
583583
login_testing_unauthorized(self, "klm", url)
584584

585585
# normal get

rjs/ietf/idrfc/urls.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@
5555
url(r'^(?P<name>[^/]+)/edit/deferballot/$', views_ballot.defer_ballot, name='doc_defer_ballot'),
5656
url(r'^(?P<name>[^/]+)/edit/undeferballot/$', views_ballot.undefer_ballot, name='doc_undefer_ballot'),
5757
url(r'^(?P<name>[^/]+)/edit/sendballotcomment/$', views_ballot.send_ballot_comment, name='doc_send_ballot_comment'),
58-
url(r'^(?P<name>[^/]+)/edit/ballotwriteups/$', views_ballot.ballot_writeups, name='doc_ballot_writeups'),
5958
url(r'^(?P<name>[^/]+)/edit/lastcalltext/$', views_ballot.lastcalltext, name='doc_ballot_lastcall'),
6059
url(r'^(?P<name>[^/]+)/edit/ballotwriteupnotes/$', views_ballot.ballot_writeupnotes, name='doc_ballot_writeupnotes'),
6160
url(r'^(?P<name>[^/]+)/edit/approvaltext/$', views_ballot.ballot_approvaltext, name='doc_ballot_approvaltext'),

rjs/ietf/idrfc/views_ballot.py

Lines changed: 0 additions & 124 deletions
Original file line numberDiff line numberDiff line change
@@ -307,130 +307,6 @@ class Meta:
307307
def clean_approval_text(self):
308308
return self.cleaned_data["approval_text"].replace("\r", "")
309309

310-
@group_required('Area_Director','Secretariat')
311-
def ballot_writeups(request, name):
312-
"""Editing of ballot write-ups, sending last calls, ..."""
313-
doc = get_object_or_404(InternetDraft, filename=name)
314-
if not doc.idinternal:
315-
raise Http404()
316-
317-
login = IESGLogin.objects.get(login_name=request.user.username)
318-
319-
try:
320-
ballot = doc.idinternal.ballot
321-
except BallotInfo.DoesNotExist:
322-
ballot = generate_ballot(request, doc)
323-
324-
last_call_form = LastCallTextForm(instance=ballot)
325-
ballot_writeup_form = BallotWriteupForm(instance=ballot)
326-
approval_text_form = ApprovalTextForm(instance=ballot)
327-
328-
if request.method == 'POST':
329-
if "save_last_call_text" in request.POST or "send_last_call_request" in request.POST:
330-
last_call_form = LastCallTextForm(request.POST, instance=ballot)
331-
if last_call_form.is_valid():
332-
ballot.last_call_text = last_call_form.cleaned_data["last_call_text"]
333-
ballot.save()
334-
335-
if "send_last_call_request" in request.POST:
336-
doc.idinternal.change_state(IDState.objects.get(document_state_id=IDState.LAST_CALL_REQUESTED), None)
337-
338-
change = log_state_changed(request, doc, login)
339-
email_owner(request, doc, doc.idinternal.job_owner, login, change)
340-
request_last_call(request, doc)
341-
342-
doc.idinternal.event_date = date.today()
343-
doc.idinternal.save()
344-
345-
return render_to_response('idrfc/last_call_requested.html',
346-
dict(doc=doc),
347-
context_instance=RequestContext(request))
348-
349-
if "regenerate_last_call_text" in request.POST:
350-
ballot.last_call_text = generate_last_call_announcement(request, doc)
351-
ballot.save()
352-
353-
# make sure form has the updated text
354-
last_call_form = LastCallTextForm(instance=ballot)
355-
356-
if "save_ballot_writeup" in request.POST:
357-
ballot_writeup_form = BallotWriteupForm(request.POST, instance=ballot)
358-
if ballot_writeup_form.is_valid():
359-
ballot.ballot_writeup = ballot_writeup_form.cleaned_data["ballot_writeup"]
360-
ballot.save()
361-
362-
if "issue_ballot" in request.POST:
363-
ballot_writeup_form = BallotWriteupForm(request.POST, instance=ballot)
364-
approval_text_form = ApprovalTextForm(request.POST, instance=ballot)
365-
if ballot_writeup_form.is_valid() and approval_text_form.is_valid():
366-
ballot.ballot_writeup = ballot_writeup_form.cleaned_data["ballot_writeup"]
367-
ballot.approval_text = approval_text_form.cleaned_data["approval_text"]
368-
ballot.active = True
369-
ballot.ballot_issued = True
370-
ballot.save()
371-
372-
if not Position.objects.filter(ballot=ballot, ad=login):
373-
pos = Position()
374-
pos.ballot = ballot
375-
pos.ad = login
376-
pos.yes = 1
377-
pos.noobj = pos.abstain = pos.approve = pos.discuss = pos.recuse = 0
378-
pos.save()
379-
380-
msg = generate_issue_ballot_mail(request, doc)
381-
send_mail_preformatted(request, msg)
382-
383-
email_iana(request, doc, 'drafts-eval@icann.org', msg)
384-
385-
doc.b_sent_date = date.today()
386-
doc.save()
387-
388-
add_document_comment(request, doc, "Ballot has been issued")
389-
390-
doc.idinternal.event_date = date.today()
391-
doc.idinternal.save()
392-
393-
return render_to_response('idrfc/ballot_issued.html',
394-
dict(doc=doc),
395-
context_instance=RequestContext(request))
396-
397-
398-
if "save_approval_text" in request.POST:
399-
approval_text_form = ApprovalTextForm(request.POST, instance=ballot)
400-
if approval_text_form.is_valid():
401-
ballot.approval_text = approval_text_form.cleaned_data["approval_text"]
402-
ballot.save()
403-
404-
if "regenerate_approval_text" in request.POST:
405-
ballot.approval_text = generate_approval_mail(request, doc)
406-
ballot.save()
407-
408-
# make sure form has the updated text
409-
approval_text_form = ApprovalTextForm(instance=ballot)
410-
411-
doc.idinternal.event_date = date.today()
412-
doc.idinternal.save()
413-
414-
can_request_last_call = doc.idinternal.cur_state_id < 27
415-
can_make_last_call = doc.idinternal.cur_state_id < 20
416-
can_announce = doc.idinternal.cur_state_id > 19
417-
docs_with_invalid_status = [d.document().file_tag() for d in doc.idinternal.ballot_set() if "None" in d.document().intended_status.intended_status or "Request" in d.document().intended_status.intended_status]
418-
need_intended_status = ", ".join(docs_with_invalid_status)
419-
420-
return render_to_response('idrfc/ballot_writeups.html',
421-
dict(doc=doc,
422-
ballot=ballot,
423-
last_call_form=last_call_form,
424-
ballot_writeup_form=ballot_writeup_form,
425-
approval_text_form=approval_text_form,
426-
can_request_last_call=can_request_last_call,
427-
can_make_last_call=can_make_last_call,
428-
can_announce=can_announce,
429-
need_intended_status=need_intended_status,
430-
),
431-
context_instance=RequestContext(request))
432-
433-
434310
@group_required('Area_Director','Secretariat')
435311
def lastcalltext(request, name):
436312
"""Editing of the last call text"""

rjs/ietf/templates/idrfc/doc_main.html

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -130,20 +130,39 @@ <h1>{% block doc_h1 %}{% endblock %}</h1>
130130

131131
<div id="writeup">
132132
<div id="writeup_content">
133+
---- following is a DRAFT of message to be sent AFTER approval ---
133134
{% if doc.in_ietf_process and doc.ietf_process.has_iesg_ballot %}
134135
{% if user|in_group:"Area_Director,Secretariat" %}
135-
<div style="margin-bottom:8px;">
136-
<span id="doc_writeup_edit_button" class="yui-button yui-link-button"><span class="first-child">
137-
<a href="{% url doc_ballot_writeups name=doc.draft_name %}">Ballot write-ups</a>
138-
</span></span></div>
139-
{% endif %}{# user in_group #}
140-
---- following is a DRAFT of message to be sent AFTER approval ---
136+
<div style="background:#E0E0FF">
137+
<p align=right>
138+
<span id="doc_edit_announce_button" class="yui-button yui-link-button"><span class="first-child">
139+
<a href="{% url doc_ballot_approvaltext name=doc.draft_name %}">Edit Announcement Text</a>
140+
</span></span>
141+
</p>
142+
{% endif %}
143+
{% endif %}
141144
<pre>
142145
{{ doc.ietf_process.iesg_ballot.approval_text|escape|urlize }}
143146
</pre>
147+
{% if doc.in_ietf_process and doc.ietf_process.has_iesg_ballot %}
148+
{% if user|in_group:"Area_Director,Secretariat" %}
149+
</div>
150+
151+
<div style="background:#E0E0FF">
152+
<p align=right>
153+
<span id="doc_ballot_edit_button" class="yui-button yui-link-button"><span class="first-child">
154+
<a href="{% url doc_ballot_writeupnotes name=doc.draft_name %}">Edit Ballot Text</a>
155+
</span></span>
156+
</p>
157+
{% endif %}
158+
{% endif %}
144159
<pre>
145160
{{ doc.ietf_process.iesg_ballot.ballot_writeup|escape|urlize }}
146161
</pre>
162+
{% if doc.in_ietf_process and doc.ietf_process.has_iesg_ballot %}
163+
{% if user|in_group:"Area_Director,Secretariat" %}
164+
</div>
165+
{% endif %}
147166
{% endif %}
148167
</div>
149168
</div>

0 commit comments

Comments
 (0)