Skip to content

Commit 8472cf2

Browse files
committed
Merged in [16630] from rjsparks@nostrum.com:
Rework how we are labeling constraints to provide a quick-fix for session requests at IETF106. Turned off several javascript functions that added/enforced old (possibly no longer correct) semantics for the session request forms. Fixes ietf-tools#2754. - Legacy-Id: 16699 Note: SVN reference [16630] has been migrated to Git commit 10422f8
2 parents e021eb8 + 10422f8 commit 8472cf2

5 files changed

Lines changed: 91 additions & 74 deletions

File tree

ietf/secr/sreq/forms.py

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,11 +89,18 @@ def __init__(self, *args, **kwargs):
8989
self.fields['length_session2'].widget.attrs['onClick'] = "if (check_num_session(2)) this.disabled=true;"
9090
self.fields['length_session3'].widget.attrs['onClick'] = "if (check_third_session()) { this.disabled=true;}"
9191
self.fields['comments'].widget = forms.Textarea(attrs={'rows':'6','cols':'65'})
92-
self.fields['wg_selector1'].widget.attrs['onChange'] = "document.form_post.conflict1.value=document.form_post.conflict1.value + ' ' + this.options[this.selectedIndex].value; return handleconflictfield(1);"
93-
self.fields['wg_selector2'].widget.attrs['onChange'] = "document.form_post.conflict2.value=document.form_post.conflict2.value + ' ' + this.options[this.selectedIndex].value; return handleconflictfield(2);"
94-
self.fields['wg_selector2'].widget.attrs['onClick'] = "return check_prior_conflict(2);"
95-
self.fields['wg_selector3'].widget.attrs['onChange'] = "document.form_post.conflict3.value=document.form_post.conflict3.value + ' ' + this.options[this.selectedIndex].value; return handleconflictfield(3);"
96-
self.fields['wg_selector3'].widget.attrs['onClick'] = "return check_prior_conflict(3);"
92+
# disabling handleconflictfield (which only enables or disables form elements) while we're hacking the meaning of the three constraints currently in use:
93+
#self.fields['wg_selector1'].widget.attrs['onChange'] = "document.form_post.conflict1.value=document.form_post.conflict1.value + ' ' + this.options[this.selectedIndex].value; return handleconflictfield(1);"
94+
#self.fields['wg_selector2'].widget.attrs['onChange'] = "document.form_post.conflict2.value=document.form_post.conflict2.value + ' ' + this.options[this.selectedIndex].value; return handleconflictfield(2);"
95+
#self.fields['wg_selector3'].widget.attrs['onChange'] = "document.form_post.conflict3.value=document.form_post.conflict3.value + ' ' + this.options[this.selectedIndex].value; return handleconflictfield(3);"
96+
self.fields['wg_selector1'].widget.attrs['onChange'] = "document.form_post.conflict1.value=document.form_post.conflict1.value + ' ' + this.options[this.selectedIndex].value; return 1;"
97+
self.fields['wg_selector2'].widget.attrs['onChange'] = "document.form_post.conflict2.value=document.form_post.conflict2.value + ' ' + this.options[this.selectedIndex].value; return 1;"
98+
self.fields['wg_selector3'].widget.attrs['onChange'] = "document.form_post.conflict3.value=document.form_post.conflict3.value + ' ' + this.options[this.selectedIndex].value; return 1;"
99+
100+
# disabling check_prior_conflict javascript while we're hacking the meaning of the three constraints currently in use
101+
#self.fields['wg_selector2'].widget.attrs['onClick'] = "return check_prior_conflict(2);"
102+
#self.fields['wg_selector3'].widget.attrs['onClick'] = "return check_prior_conflict(3);"
103+
97104
self.fields['third_session'].widget.attrs['onClick'] = "if (document.form_post.num_session.selectedIndex < 2) { alert('Cannot use this field - Number of Session is not set to 2'); return false; } else { if (this.checked==true) { document.form_post.length_session3.disabled=false; } else { document.form_post.length_session3.value=0;document.form_post.length_session3.disabled=true; } }"
98105
self.fields["resources"].choices = [(x.pk,x.desc) for x in ResourceAssociation.objects.filter(name__used=True).order_by('name__order') ]
99106

ietf/secr/static/secr/js/sessions.js

Lines changed: 64 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -51,36 +51,39 @@ function check_third_session () {
5151
}
5252
return false;
5353
}
54-
function handleconflictfield (val) {
55-
if (val==1) {
56-
if (document.form_post.conflict1.value.length > 0) {
57-
document.form_post.conflict2.disabled=false;
58-
if (document.form_post.conflict2.value.length > 0) {
59-
document.form_post.conflict3.disabled=false;
60-
}
61-
return 1;
62-
} else {
63-
if (document.form_post.conflict2.value.length > 0 || document.form_post.conflict3.value.length > 0) {
64-
alert("Second and Third Conflicts to Avoid fields are being disabled");
65-
document.form_post.conflict2.disabled=true;
66-
document.form_post.conflict3.disabled=true;
67-
return 0;
68-
}
69-
}
70-
} else {
71-
if (document.form_post.conflict2.value.length > 0) {
72-
document.form_post.conflict3.disabled=false;
73-
return 1;
74-
} else {
75-
if (document.form_post.conflict3.value.length > 0) {
76-
alert("Third Conflicts to Avoid field is being disabled");
77-
document.form_post.conflict3.disabled=true;
78-
return 0;
79-
}
80-
}
81-
}
82-
return 1;
83-
}
54+
55+
// All calls to handleconflictfield are being disabled while we hack on the meaning of the three constraint fields
56+
// function handleconflictfield (val) {
57+
// if (val==1) {
58+
// if (document.form_post.conflict1.value.length > 0) {
59+
// document.form_post.conflict2.disabled=false;
60+
// if (document.form_post.conflict2.value.length > 0) {
61+
// document.form_post.conflict3.disabled=false;
62+
// }
63+
// return 1;
64+
// } else {
65+
// if (document.form_post.conflict2.value.length > 0 || document.form_post.conflict3.value.length > 0) {
66+
// alert("Second and Third Conflicts to Avoid fields are being disabled");
67+
// document.form_post.conflict2.disabled=true;
68+
// document.form_post.conflict3.disabled=true;
69+
// return 0;
70+
// }
71+
// }
72+
// } else {
73+
// if (document.form_post.conflict2.value.length > 0) {
74+
// document.form_post.conflict3.disabled=false;
75+
// return 1;
76+
// } else {
77+
// if (document.form_post.conflict3.value.length > 0) {
78+
// alert("Third Conflicts to Avoid field is being disabled");
79+
// document.form_post.conflict3.disabled=true;
80+
// return 0;
81+
// }
82+
// }
83+
// }
84+
// return 1;
85+
// }
86+
8487
function delete_last1 () {
8588
var b = document.form_post.conflict1.value;
8689
var temp = new Array();
@@ -109,34 +112,38 @@ function delete_last3 () {
109112
document.form_post.wg_selector3.selectedIndex=0;
110113
}
111114

112-
function check_prior_conflict(val) {
113-
if (val == 2) {
114-
if (document.form_post.conflict1.value=="") {
115-
alert("Please specify your First Priority prior to using this field");
116-
document.form_post.conflict2.disabled=true;
117-
document.form_post.conflict3.disabled=true;
118-
document.form_post.wg_selector1.focus();
119-
return 0;
120-
}
121-
}
122-
else {
123-
if (document.form_post.conflict2.value=="" && document.form_post.conflict1.value=="") {
124-
alert("Please specify your First and Second Priority prior to using this field");
125-
document.form_post.conflict3.disabled=true;
126-
document.form_post.wg_selector1.focus();
127-
return 0;
128-
} else {
129-
if (document.form_post.conflict2.value=="") {
130-
alert("Please specify your Second Priority prior to using this field");
131-
document.form_post.conflict3.disabled=true;
132-
document.form_post.wg_selector2.focus();
133-
return 0;
134-
}
135-
}
136-
}
115+
// Not calling check_prior_confict (see ietf/secr/sreq/forms.py definition of SessionForm)
116+
// while we are hacking the use of the current three constraint types around. We could bring
117+
// this back in when we solve the general case of what constraints to use at what meeting.
118+
// When we do, the else should explicitly check for a value of 3.
119+
// function check_prior_conflict(val) {
120+
// if (val == 2) {
121+
// if (document.form_post.conflict1.value=="") {
122+
// alert("Please specify your First Priority prior to using this field");
123+
// document.form_post.conflict2.disabled=true;
124+
// document.form_post.conflict3.disabled=true;
125+
// document.form_post.wg_selector1.focus();
126+
// return 0;
127+
// }
128+
// }
129+
// else {
130+
// if (document.form_post.conflict2.value=="" && document.form_post.conflict1.value=="") {
131+
// alert("Please specify your First and Second Priority prior to using this field");
132+
// document.form_post.conflict3.disabled=true;
133+
// document.form_post.wg_selector1.focus();
134+
// return 0;
135+
// } else {
136+
// if (document.form_post.conflict2.value=="") {
137+
// alert("Please specify your Second Priority prior to using this field");
138+
// document.form_post.conflict3.disabled=true;
139+
// document.form_post.wg_selector2.focus();
140+
// return 0;
141+
// }
142+
// }
143+
// }
137144

138-
return 1;
139-
}
145+
// return 1;
146+
// }
140147

141148
function retrieve_data () {
142149
document.form_post.num_session.selectedIndex = document.form_post.prev_num_session.value;

ietf/secr/templates/includes/session_info.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ Number of Sessions: {{ session.num_session }}
88
Length of Session(s): {{ session.length_session1|display_duration }}{% if session.length_session2 %}, {{ session.length_session2|display_duration }}{% endif %}{% if session.length_session3 %}, {{ session.length_session3|display_duration }}{% endif %}
99
Number of Attendees: {{ session.attendees }}
1010
Conflicts to Avoid:
11-
{% if session.conflict1 %} First Priority: {{ session.conflict1 }}{% endif %}
12-
{% if session.conflict2 %} Second Priority: {{ session.conflict2 }}{% endif %}
13-
{% if session.conflict3 %} Third Priority: {{ session.conflict3 }}{% endif %}
11+
{% if session.conflict1 %} Chair Conflict: {{ session.conflict1 }}{% endif %}
12+
{% if session.conflict2 %} Technology Overlap: {{ session.conflict2 }}{% endif %}
13+
{% if session.conflict3 %} Key Participant Conflict: {{ session.conflict3 }}{% endif %}
1414

1515

1616
People who must be present:

ietf/secr/templates/includes/sessions_request_form.html

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,23 +24,26 @@
2424
</tr>
2525
<tr class="bg1">
2626
<td rowspan="3" valign="top" width="220">WG Sessions:<br>You may select multiple WGs within each priority</td>
27-
<td width="320">First Priority:</td>
27+
<td width="320">Chair Conflict:</td>
2828
<td>{{ form.wg_selector1 }}
29-
<input type="button" value="Delete the last entry" onClick="delete_last1(); return handleconflictfield(1);"><br>
29+
{% comment %}<input type="button" value="Delete the last entry" onClick="delete_last1(); return handleconflictfield(1);"><br>{% endcomment %}
30+
<input type="button" value="Delete the last entry" onClick="delete_last1(); return 1;"><br>
3031
{{ form.conflict1.errors }}{{ form.conflict1 }}
3132
</td>
3233
</tr>
3334
<tr class="bg1">
34-
<td>Second Priority:</td>
35+
<td>Technology Overlap:</td>
3536
<td>{{ form.wg_selector2 }}
36-
<input type="button" value="Delete the last entry" onClick="delete_last2(); return handleconflictfield(2);"><br>
37+
{% comment %}<input type="button" value="Delete the last entry" onClick="delete_last2(); return handleconflictfield(2);"><br>{% endcomment %}
38+
<input type="button" value="Delete the last entry" onClick="delete_last2(); return 1;"><br>
3739
{{ form.conflict2.errors }}{{ form.conflict2 }}
3840
</td>
3941
</tr>
4042
<tr class="bg1">
41-
<td>Third Priority:</td>
43+
<td>Key Participant Conflict:</td>
4244
<td>{{ form.wg_selector3 }}
43-
<input type="button" value="Delete the last entry" onClick="delete_last3(); return handleconflictfield(3);"><br>
45+
{% comment %}<input type="button" value="Delete the last entry" onClick="delete_last3(); return handleconflictfield(3);"><br>{% endcomment %}
46+
<input type="button" value="Delete the last entry" onClick="delete_last3(); return 1;"><br>
4447
{{ form.conflict3.errors }}{{ form.conflict3 }}
4548
</td>
4649
</tr>

ietf/secr/templates/includes/sessions_request_view.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616
<td>Conflicts to Avoid:</td>
1717
<td>
1818
<table>
19-
{% if session.conflict1 %}<tr><td>First Priority: </td><td>{{ session.conflict1 }}</td></tr>{% endif %}
20-
{% if session.conflict2 %}<tr><td>Second Priority: </td><td>{{ session.conflict2 }}</td></tr>{% endif %}
21-
{% if session.conflict3 %}<tr><td>Third Priority: </td><td>{{ session.conflict3 }}</td></tr>{% endif %}
19+
{% if session.conflict1 %}<tr><td>Chair Conflict: </td><td>{{ session.conflict1 }}</td></tr>{% endif %}
20+
{% if session.conflict2 %}<tr><td>Technology Overlap: </td><td>{{ session.conflict2 }}</td></tr>{% endif %}
21+
{% if session.conflict3 %}<tr><td>Key Participant Conflict: </td><td>{{ session.conflict3 }}</td></tr>{% endif %}
2222
</table>
2323
</td>
2424
</tr>

0 commit comments

Comments
 (0)