Skip to content

Commit 6524aba

Browse files
committed
Ask for whether the ballot should say whether the charter can pass
without external review - Legacy-Id: 4272
1 parent 47b466e commit 6524aba

3 files changed

Lines changed: 26 additions & 7 deletions

File tree

ietf/templates/wgcharter/change_state.html

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,12 @@ <h1>{{ title }}</h1>
4848
{{ field.errors }}
4949
</td>
5050
</tr>
51+
{% if field.name == "charter_state" and not option == "initcharter" %}
52+
<tr class="ballot-wo-extern" style="display:none">
53+
<td></td>
54+
<td><label><input name="ballot_wo_extern" type="checkbox" /> Ask whether external review can be skipped in ballot</label></td>
55+
</tr>
56+
{% endif %}
5157
{% endfor %}
5258
{% if initial_review %}
5359
<tr><td></td><td class="warning">Warning: Announced initial review time hasn't elapsed yet. It does so at {{ initial_review.expires }}.</td></tr>
@@ -80,7 +86,8 @@ <h3>Or revert to previous state</h3>
8086

8187
{% block content_end %}
8288
<script type="text/javascript">
83-
var messages = {{ messages|safe }};
89+
var messages = {{ messages|safe }},
90+
statesForBallotWoExtern = {{ states_for_ballot_wo_extern }};
8491
</script>
8592
<script type="text/javascript" src="/js/charter-change-state.js"></script>
8693
{% endblock %}

ietf/wgcharter/views.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,10 @@ def change_state(request, name, option=None):
102102
email_secretariat(request, wg, "state-%s" % charter_state.slug, message)
103103

104104
if charter_state.slug == "intrev":
105-
create_ballot_if_not_open(charter, login, "r-extrev")
105+
if request.POST.get("ballot_wo_extern"):
106+
create_ballot_if_not_open(charter, login, "r-wo-ext")
107+
else:
108+
create_ballot_if_not_open(charter, login, "r-extrev")
106109
elif charter_state.slug == "iesgrev":
107110
create_ballot_if_not_open(charter, login, "approve")
108111

@@ -151,6 +154,8 @@ def state_pk(slug):
151154
state_pk("extrev"): "The WG %s (%s) has been set to External review by %s. Please send out the external review announcement to the appropriate lists.\n\nSend the announcement to other SDOs: Yes\nAdditional recipients of the announcement: " % (wg.name, wg.acronym, login.plain_name()),
152155
}
153156

157+
states_for_ballot_wo_extern = State.objects.filter(type="charter", slug="intrev").values_list("pk", flat=True)
158+
154159
return render_to_response('wgcharter/change_state.html',
155160
dict(form=form,
156161
doc=wg.charter,
@@ -159,7 +164,9 @@ def state_pk(slug):
159164
prev_charter_state=prev_charter_state,
160165
title=title,
161166
initial_review=initial_review,
162-
messages=simplejson.dumps(messages)),
167+
messages=simplejson.dumps(messages),
168+
states_for_ballot_wo_extern=simplejson.dumps(list(states_for_ballot_wo_extern)),
169+
),
163170
context_instance=RequestContext(request))
164171

165172
class TelechatForm(forms.Form):

static/js/charter-change-state.js

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
jQuery(document).ready(function () {
2-
function setMessageDraft() {
2+
function stateChanged() {
33
var v = $(this).val();
44
jQuery("#id_message").val(messages[v] || "");
5+
6+
if (jQuery.inArray(+v, statesForBallotWoExtern) != -1)
7+
jQuery("tr.ballot-wo-extern").show();
8+
else
9+
jQuery("tr.ballot-wo-extern").hide();
510
}
611

7-
jQuery("#id_charter_state").click(setMessageDraft).change(setMessageDraft).keydown(setMessageDraft);
12+
jQuery("#id_charter_state").click(stateChanged).change(stateChanged).keydown(stateChanged);
813

9-
if (jQuery("#id_message").val() == "")
10-
jQuery("#id_charter_state").click();
14+
// trigger event
15+
jQuery("#id_charter_state").click();
1116
});

0 commit comments

Comments
 (0)