From 5cc537558052a7bf1e596d55e56cddf0eadd5714 Mon Sep 17 00:00:00 2001 From: Robert Sparks Date: Thu, 18 Aug 2011 21:20:25 +0000 Subject: [PATCH] Make it more likely to issue a ballot when it makes sense to do so. Fixes bug 703. - Legacy-Id: 3331 --- ietf/idrfc/views_edit.py | 27 ++++++++++++++++++++++--- ietf/templates/idrfc/ballot_issued.html | 6 ++++++ ietf/templates/idrfc/change_state.html | 17 ++++++++++++++++ ietf/templates/idrfc/edit_info.html | 21 ++++++++++++++++++- 4 files changed, 67 insertions(+), 4 deletions(-) diff --git a/ietf/idrfc/views_edit.py b/ietf/idrfc/views_edit.py index ca16f9825..c48fc11ea 100644 --- a/ietf/idrfc/views_edit.py +++ b/ietf/idrfc/views_edit.py @@ -72,11 +72,26 @@ def change_state(request, name): prev_state_formatted = format_document_state(doc.idinternal.prev_state, doc.idinternal.prev_sub_state) + try: + ballot_issued = doc.idinternal.ballot.ballot_issued + except BallotInfo.DoesNotExist: + ballot_issued = False + + to_iesg_eval = None + if not ballot_issued: + try: + to_iesg_eval = next_states.filter(next_state=IDState.IESG_EVALUATION)[0] + except IndexError: + pass + if to_iesg_eval: + next_states = next_states.exclude(next_state=IDState.IESG_EVALUATION) + return render_to_response('idrfc/change_state.html', dict(form=form, doc=doc, prev_state_formatted=prev_state_formatted, - next_states=next_states), + next_states=next_states, + to_iesg_eval=to_iesg_eval), context_instance=RequestContext(request)) def dehtmlify_textarea_text(s): @@ -90,7 +105,7 @@ class EditInfoForm(forms.Form): create_in_state = forms.ModelChoiceField(IDState.objects.filter(document_state_id__in=(IDState.PUBLICATION_REQUESTED, IDState.AD_WATCHING)), empty_label=None, required=False) state_change_notice_to = forms.CharField(max_length=255, label="Notice emails", help_text="Separate email addresses with commas", required=False) note = forms.CharField(widget=forms.Textarea, label="IESG note", required=False) - telechat_date = forms.TypedChoiceField(coerce=lambda x: datetime.datetime.strptime(x, '%Y-%m-%d').date(), empty_value=None, required=False) + telechat_date = forms.TypedChoiceField(coerce=lambda x: datetime.datetime.strptime(x, '%Y-%m-%d').date(), empty_value=None, required=False, widget=forms.Select(attrs={'onchange':'make_bold()'})) returning_item = forms.BooleanField(required=False) def __init__(self, *args, **kwargs): @@ -289,12 +304,18 @@ def edit_info(request, name): if not new_document: form.standard_fields = [x for x in form.standard_fields if x.name != "create_in_state"] + + try: + ballot_issued = doc.idinternal.ballot.ballot_issued + except BallotInfo.DoesNotExist: + ballot_issued = False return render_to_response('idrfc/edit_info.html', dict(doc=doc, form=form, user=request.user, - login=login), + login=login, + ballot_issued=ballot_issued), context_instance=RequestContext(request)) diff --git a/ietf/templates/idrfc/ballot_issued.html b/ietf/templates/idrfc/ballot_issued.html index 0c62d5f7f..821c104c9 100644 --- a/ietf/templates/idrfc/ballot_issued.html +++ b/ietf/templates/idrfc/ballot_issued.html @@ -7,6 +7,12 @@

Ballot has been sent out.

+{% if doc.idinternal.telechat_date %} +

The document is currently on the {{ doc.idinternal.telechat_date }} telechat agenda.

+{% else %} +

The document is not on any telechat agenda.

+{% endif %} +
Back to document
diff --git a/ietf/templates/idrfc/change_state.html b/ietf/templates/idrfc/change_state.html index 6220f432f..bbe6a1fba 100644 --- a/ietf/templates/idrfc/change_state.html +++ b/ietf/templates/idrfc/change_state.html @@ -10,10 +10,12 @@ form.change-state .actions { text-align: right; padding-top: 10px; } +.warn-states, .next-states, .prev-state { margin-bottom: 30px; } +.warn-states form, .next-states form, .prev-state form { display: inline; @@ -52,6 +54,21 @@ form.change-state .actions { {% endif %} +{% if to_iesg_eval %} +

You could also jump directly to

+
+
+ + + +
+

+ But the ballot for this document has not yet been issued. + Edit Ballot Text +

+
+{% endif %} +

Or revert to previous state

diff --git a/ietf/templates/idrfc/edit_info.html b/ietf/templates/idrfc/edit_info.html index ec3ae5684..89c3d8130 100644 --- a/ietf/templates/idrfc/edit_info.html +++ b/ietf/templates/idrfc/edit_info.html @@ -2,6 +2,16 @@ {% block title %}Edit info on {{ doc }}{% endblock %} +{% block scripts %} + +function make_bold() +{ + var e = document.getElementById("ballotwarn"); + e.setAttribute("class","warning"); +} + +{% endblock %} + {% block morecss %} form.edit-info #id_state_change_notice_to { width: 600px; @@ -13,6 +23,10 @@ form.edit-info #id_note { form.edit-info .actions { padding-top: 20px; } +.warning { + font-weight:bold; + color:red; +} {% endblock %} {% block content %} @@ -25,7 +39,12 @@ form.edit-info .actions { {{ field.label_tag }}: {{ field }} - {% ifequal field.name "telechat_date" %}{{ form.returning_item }} {{ form.returning_item.label_tag }} {{ form.returning_item.errors }}{% endifequal %} + {% ifequal field.name "telechat_date" %} + {% if not ballot_issued %} + A ballot for this document has not been issued: Edit Ballot Text + {% endif %} + {{ form.returning_item }} {{ form.returning_item.label_tag }} {{ form.returning_item.errors }} + {% endifequal %} {% ifequal field.name "job_owner" %} {% if user|in_group:"Area_Director" %}