Skip to content

Commit ab382a7

Browse files
committed
While cleaning up the Javascript includes in the nomcom app, it turns
out nomcom.js is included in the wrong pages, and on the pages it is actually useful in, it's obsolete, so delete it together with the obsoleted AJAX view and the other JS left-over cruft in nomcom/, this fixes an include 404 and removes the remaining dependency on jquery-1.5.1 apart from the Secretariat tools - Legacy-Id: 7097
1 parent b78109f commit ab382a7

12 files changed

Lines changed: 11 additions & 152 deletions

ietf/nomcom/forms.py

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -603,11 +603,6 @@ class Meta:
603603
'confirmation',
604604
'comments')
605605

606-
class Media:
607-
js = ("/js/jquery-1.5.1.min.js",
608-
"/js/nomcom.js", )
609-
610-
611606
class FeedbackEmailForm(BaseNomcomForm, forms.Form):
612607

613608
email_text = forms.CharField(label='Email text', widget=forms.Textarea())
@@ -621,11 +616,6 @@ def __init__(self, *args, **kwargs):
621616
def save(self, commit=True):
622617
create_feedback_email(self.nomcom, self.cleaned_data['email_text'])
623618

624-
class Media:
625-
js = ("/js/jquery-1.5.1.min.js",
626-
"/js/nomcom.js", )
627-
628-
629619
class QuestionnaireForm(BaseNomcomForm, forms.ModelForm):
630620

631621
comments = forms.CharField(label='Questionnaire response from this candidate',
@@ -661,19 +651,6 @@ class Meta:
661651
fields = ('positions',
662652
'comments')
663653

664-
class Media:
665-
admin_js = ['js/core.js',
666-
"js/jquery.js",
667-
"js/jquery.init.js",
668-
'js/admin/RelatedObjectLookups.js',
669-
"js/getElementsBySelector.js",
670-
'js/SelectBox.js',
671-
'js/SelectFilter2.js',
672-
]
673-
admin_js = ['%sadmin/%s' % (settings.STATIC_URL, url) for url in admin_js]
674-
js = ["/js/jquery-1.5.1.min.js", "/js/nomcom.js"] + admin_js
675-
676-
677654
class NomComTemplateForm(BaseNomcomForm, DBTemplateForm):
678655
content = forms.CharField(label="Text", widget=forms.Textarea(attrs={'cols': '120', 'rows':'40', }))
679656
fieldsets = [('Template content', ('content', )), ]

ietf/nomcom/urls.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,6 @@
4141
url(r'^(?P<year>\d{4})/feedback/$', 'public_feedback', name='nomcom_public_feedback'),
4242
url(r'^(?P<year>\d{4})/nominate/$', 'public_nominate', name='nomcom_public_nominate'),
4343
url(r'^(?P<year>\d{4})/process-nomination-status/(?P<nominee_position_id>\d+)/(?P<state>[\w]+)/(?P<date>[\d]+)/(?P<hash>[a-f0-9]+)/$', 'process_nomination_status', name='nomcom_process_nomination_status'),
44-
url(r'^ajax/position-text/(?P<position_id>\d+)/$', 'ajax_position_text', name='nomcom_ajax_position_text'),
45-
4644
)
4745

4846
# use the generic view from message

ietf/nomcom/views.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -830,15 +830,3 @@ def edit_position(request, year, position_id=None):
830830
'position': position,
831831
'year': year,
832832
'nomcom': nomcom}, RequestContext(request))
833-
834-
835-
def ajax_position_text(request, position_id):
836-
try:
837-
position_text = Position.objects.get(id=position_id).initial_text
838-
except Position.DoesNotExist:
839-
position_text = ""
840-
841-
result = {'text': position_text}
842-
843-
json_result = json.dumps(result)
844-
return HttpResponse(json_result, content_type='application/json')

ietf/templates/nomcom/private_feedback.html

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,6 @@
2121

2222
{% block subtitle %} - Feedback{% endblock %}
2323

24-
{% block pagehead %}
25-
{{ form.media }}
26-
{% endblock %}
27-
2824
{% block nomcom_content %}
2925

3026
<p>Select a nominee from the list of nominees to provide input about that nominee.
@@ -37,15 +33,6 @@
3733

3834
{% if nomcom|has_publickey %}
3935

40-
<div class="js-info">
41-
Your browser has Javascript disabled. Please enable javascript and reload the page.
42-
<script type="text/javascript">
43-
(function ($) {
44-
$(".js-info").hide();
45-
})(jQuery);
46-
</script>
47-
</div>
48-
4936
<div class="content">
5037
<div class="primary">
5138
{% if form.errors %}<div class="info-message-error">Please correct the following errors</div>{% endif %}
@@ -80,4 +67,4 @@ <h3> Nominees </h3>
8067

8168
{% endif %}
8269

83-
{% endblock %}
70+
{% endblock %}

ietf/templates/nomcom/private_feedback_email.html

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,7 @@
22

33
{% load nomcom_tags %}
44

5-
{% block subtitle %} - Provide feeback email{% endblock %}
6-
7-
{% block pagehead %}
8-
{{ form.media }}
9-
{% endblock %}
5+
{% block subtitle %} - Provide feedback email{% endblock %}
106

117
{% block nomcom_content %}
128

@@ -17,15 +13,6 @@
1713

1814
{% if nomcom|has_publickey %}
1915

20-
<div class="js-info">
21-
Your browser has Javascript disabled. Please enable javascript and reload the page.
22-
<script type="text/javascript">
23-
(function ($) {
24-
$(".js-info").hide();
25-
})(jQuery);
26-
</script>
27-
</div>
28-
2916
<div>
3017
{% if form.errors %}<div class="info-message-error">Please correct the following errors</div>{% endif %}
3118

@@ -42,4 +29,4 @@
4229
{% endif %}
4330

4431

45-
{% endblock %}
32+
{% endblock %}

ietf/templates/nomcom/private_nominate.html

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,8 @@
44

55
{% block subtitle %} - Nominate{% endblock %}
66

7-
{% block pagehead %}
8-
{{ form.media }}
9-
{% endblock %}
10-
117
{% block nomcom_content %}
128

13-
149
{% if message %}
1510
<div class="info-message-{{ message.0 }}">{{ message.1 }}</div>
1611
{% endif %}
@@ -28,4 +23,4 @@
2823
</form>
2924
{% endif %}
3025

31-
{% endblock %}
26+
{% endblock %}

ietf/templates/nomcom/private_questionnaire.html

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,6 @@
44

55
{% block subtitle %} - Quesionnaire Response{% endblock %}
66

7-
{% block pagehead %}
8-
{{ form.media }}
9-
{% endblock %}
10-
117
{% block nomcom_content %}
128

139

@@ -17,15 +13,6 @@
1713

1814
{% if nomcom|has_publickey %}
1915

20-
<div class="js-info">
21-
Your browser has Javascript disabled. Please enable javascript and reload the page.
22-
<script type="text/javascript">
23-
(function ($) {
24-
$(".js-info").hide();
25-
})(jQuery);
26-
</script>
27-
</div>
28-
2916
<div class="content">
3017
{% if questionnaire_response %}
3118
<h3>Questionnaire response:</h3>
@@ -46,4 +33,4 @@ <h3>Questionnaire response:</h3>
4633
</div>
4734
{% endif %}
4835

49-
{% endblock %}
36+
{% endblock %}

ietf/templates/nomcom/public_feedback.html

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,6 @@
2222

2323
{% block subtitle %} - Feedback{% endblock %}
2424

25-
{% block pagehead %}
26-
{{ form.media }}
27-
{% endblock %}
28-
2925
{% block nomcom_content %}
3026

3127
<p>Select a nominee from the list of nominees to provide input about that nominee.
@@ -38,15 +34,6 @@
3834

3935
{% if nomcom|has_publickey %}
4036

41-
<div class="js-info">
42-
Your browser has Javascript disabled. Please enable javascript and reload the page.
43-
<script type="text/javascript">
44-
(function ($) {
45-
$(".js-info").hide();
46-
})(jQuery);
47-
</script>
48-
</div>
49-
5037
<div class="content">
5138
<div class="primary">
5239
{% if form.errors %}<div class="info-message-error">Please correct the following errors</div>{% endif %}
@@ -87,4 +74,4 @@ <h3> Nominees </h3>
8774

8875
{% endif %}
8976

90-
{% endblock %}
77+
{% endblock %}

ietf/templates/nomcom/public_nominate.html

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,8 @@
44

55
{% block subtitle %} - Nominate{% endblock %}
66

7-
{% block pagehead %}
8-
{{ form.media }}
9-
{% endblock %}
10-
117
{% block nomcom_content %}
128

13-
149
{% if message %}
1510
<div class="info-message-{{ message.0 }}">{{ message.1 }}</div>
1611
{% endif %}
@@ -28,4 +23,4 @@
2823
</form>
2924
{% endif %}
3025

31-
{% endblock %}
26+
{% endblock %}

static/css/base2.css

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -395,11 +395,12 @@ span.fieldRequired {
395395
transition-duration: 0.2s;
396396
}
397397

398-
/* js styles */
399-
.js-info {
400-
background-color: #FFDD88;
398+
.js-info { /* Javascript disabled box */
399+
display: block;
400+
background-color: #ffdd88;
401401
border: 1px dashed red;
402402
font-size: 1.2em;
403403
padding: 1em 2em;
404+
margin: 1em 0;
404405
}
405406

0 commit comments

Comments
 (0)