Make it more likely to issue a ballot when it makes sense to do so. Fixes bug 703.
- Legacy-Id: 3331
This commit is contained in:
parent
5c8c9a2be5
commit
5cc5375580
|
@ -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))
|
||||
|
||||
|
||||
|
|
|
@ -7,6 +7,12 @@
|
|||
|
||||
<p>Ballot has been sent out.</p>
|
||||
|
||||
{% if doc.idinternal.telechat_date %}
|
||||
<p>The document is currently on the {{ doc.idinternal.telechat_date }} telechat agenda.</p>
|
||||
{% else %}
|
||||
<p>The document is not on any telechat agenda.</p>
|
||||
{% endif %}
|
||||
|
||||
<div class="actions">
|
||||
<a href="{{ doc.idinternal.get_absolute_url }}">Back to document</a>
|
||||
</div>
|
||||
|
|
|
@ -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 {
|
|||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if to_iesg_eval %}
|
||||
<h3>You could also jump directly to</h3>
|
||||
<div class="warn-states">
|
||||
<form action="" method="post">
|
||||
<input type="hidden" name="state" value="{{ to_iesg_eval.next_state.document_state_id }}" />
|
||||
<input type="hidden" name="substate" value="" />
|
||||
<input type="submit" value="{{ to_iesg_eval.next_state.state }}" />
|
||||
</form>
|
||||
<p>
|
||||
But the ballot for this document has not yet been issued.
|
||||
<a href="{% url doc_ballot_writeupnotes name=doc.filename %}">Edit Ballot Text</a>
|
||||
</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<h3>Or revert to previous state</h3>
|
||||
|
||||
<div class="prev-state">
|
||||
|
|
|
@ -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 {
|
|||
<tr>
|
||||
<th>{{ field.label_tag }}:</th>
|
||||
<td>{{ 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 %}
|
||||
<span id="ballotwarn"> A ballot for this document has not been issued: <a href="{% url doc_ballot_writeupnotes name=doc.filename %}">Edit Ballot Text</a></span>
|
||||
{% 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" %}
|
||||
<label><input type="checkbox" name="job_owner" value="{{ login.id }}" /> Assign to me</label>
|
||||
|
|
Loading…
Reference in a new issue