Skip to content

Commit 2ac9694

Browse files
committed
Summary: Port the remaining JS parts of IPR tool, still missing some
templates though - Legacy-Id: 8901
1 parent 1124d6d commit 2ac9694

8 files changed

Lines changed: 36 additions & 19 deletions

File tree

ietf/ipr/forms.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
GenericIprDisclosure, ThirdPartyIprDisclosure, NonDocSpecificIprDisclosure,
1313
IprLicenseTypeName, IprDisclosureStateName)
1414
from ietf.message.models import Message
15+
from ietf.utils.fields import DatepickerDateField
1516

1617
# ----------------------------------------------------------------
1718
# Globals
@@ -232,7 +233,7 @@ class Meta:
232233
exclude = [ 'by','docs','state','rel' ]
233234

234235
class MessageModelForm(forms.ModelForm):
235-
response_due = forms.DateField(required=False,help_text='The date which a response is due')
236+
response_due = DatepickerDateField(date_format="yyyy-mm-dd", picker_settings={"autoclose": "1" }, required=False, help_text='The date which a response is due')
236237

237238
class Meta:
238239
model = Message

ietf/templates/doc/status_change/make_last_call.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
{% load bootstrap3 %}
44

55
{% block pagehead %}
6-
<link rel="stylesheet" href="/facelift/css/lib/datepicker3.css"></link>
6+
<link rel="stylesheet" href="/facelift/css/lib/datepicker3.css"></link>
77
{% endblock %}
88

99
{% block title %}Make last call for {{ doc.name }}{% endblock %}
@@ -33,7 +33,7 @@ <h1>Make last call<br><small>{{doc.name}}</small></h1>
3333

3434

3535
{% block js %}
36-
<script src="/facelift/js/lib/bootstrap-datepicker.js"></script>
36+
<script src="/facelift/js/lib/bootstrap-datepicker.js"></script>
3737
{% endblock %}
3838

3939
{% block scripts %}

ietf/templates/ipr/details_view.html

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -283,8 +283,3 @@
283283
{% endif %}
284284

285285
{% endblock %} <!-- tab_content -->
286-
287-
{% block js %}
288-
<script type="text/javascript" src="/js/jquery-ui-1.8.11.custom.min.js"></script>
289-
<script type="text/javascript" src="/js/ipr-view.js"></script>
290-
{% endblock %}

ietf/templates/ipr/email.html

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
{% block title %}IPR Email{% endblock %}
44

55
{% block pagehead %}
6-
<link rel="stylesheet" type="text/css" href="/css/jquery-ui-themes/jquery-ui-1.8.11.custom.css"></link>
7-
<link rel="stylesheet" type="text/css" href="/css/ipr.css"></link>
6+
<link rel="stylesheet" href="/facelift/css/lib/datepicker3.css"></link>
7+
<link rel="stylesheet" type="text/css" href="/css/ipr.css"></link>
88
{% endblock %}
99

1010

@@ -38,6 +38,5 @@ <h2>Send email to disclosure submitter</h2>
3838
{% endblock %}
3939

4040
{% block js %}
41-
<script type="text/javascript" src="/js/jquery-ui-1.8.11.custom.min.js"></script>
42-
<script type="text/javascript" src="/js/ipr-email.js"></script>
43-
{% endblock %}
41+
<script src="/facelift/js/lib/bootstrap-datepicker.js"></script>
42+
{% endblock %}

ietf/templates/ipr/search.html

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{% extends "ietf.html" %}
22

33
{% block pagehead %}
4-
<link rel="stylesheet" type="text/css" href="/css/ipr.css"></link>
4+
<link rel="stylesheet" type="text/css" href="/css/ipr.css"></link>
55
{% endblock %}
66

77
{% block title %}IPR search{% endblock %}
@@ -11,6 +11,5 @@
1111
{% endblock %}
1212

1313
{% block js %}
14-
<script type="text/javascript" src="/js/lib/jquery-1.8.2.min.js"></script>
15-
<script type="text/javascript" src="/js/ipr-search.js"></script>
14+
<script type="text/javascript" src="/facelift/js/ipr-search.js"></script>
1615
{% endblock %}

ietf/templates/ipr/search_form.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<h1>IPR Search</h1>
44

5-
<form role="form">
5+
<form class="ipr-search" role="form">
66
{% if user|has_role:"Secretariat" %}
77
<div class="col-md-12">
88
<h2>State Filter</h2>

ietf/templates/ipr/search_result.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
{% block title %}IPR disclosures{% endblock %}
66

77
{% block pagehead %}
8-
<link rel="stylesheet" type="text/css" href="/css/ipr.css"></link>
8+
<link rel="stylesheet" type="text/css" href="/css/ipr.css"></link>
99
{% endblock %}
1010

1111
{% block content %}
@@ -82,5 +82,5 @@ <h2>{% block search_header %}Patent owner/applicant search result{% endblock %}<
8282
{% endblock %}
8383

8484
{% block js %}
85-
<script type="text/javascript" src="/js/ipr-search.js"></script>
85+
<script type="text/javascript" src="/facelift/js/ipr-search.js"></script>
8686
{% endblock %}

static/facelift/js/ipr-search.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
$(document).ready(function() {
2+
// hack the "All States" check box
3+
$("#id_state input[value!=all]").change(function(e) {
4+
if (this.checked) {
5+
$("#id_state input[value=all]").prop('checked',false);
6+
}
7+
});
8+
9+
$("#id_state_0").change(function(e) {
10+
if (this.checked) {
11+
$("#id_state input[value!=all]").prop('checked',false);
12+
}
13+
});
14+
15+
$("form.ipr-search input,select").keyup(function (e) {
16+
if (e.which == 13) {
17+
$(this).next('button[type=submit]').click();
18+
return false;
19+
} else {
20+
return true;
21+
}
22+
});
23+
});

0 commit comments

Comments
 (0)