Skip to content

Commit 1bd0910

Browse files
committed
Summary: Move required field asterisk handling to ietf.js, fix some
cosmetic stuff in the facelifted IPR code - Legacy-Id: 8917
1 parent 8d5cd02 commit 1bd0910

8 files changed

Lines changed: 13 additions & 8 deletions

File tree

ietf/templates/ipr/add_comment.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ <h1>Add comment<br><small>{{ ipr }}</small></h1>
1111

1212
{% bootstrap_messages %}
1313

14-
<form class="add-comment" method="post">
14+
<form role="form" class="add-comment" method="post">
1515
{% csrf_token %}
1616

1717
{% bootstrap_form form %}

ietf/templates/ipr/add_email.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ <h1>Add email<br><small>{{ ipr }}</small></h1>
1515

1616
{% bootstrap_messages %}
1717

18-
<form class="add-email" method="post">
18+
<form role="form" class="add-email" method="post">
1919
{% csrf_token %}
2020

2121
{% bootstrap_form form %}

ietf/templates/ipr/details_edit.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
{% endblock %}
1212

1313
{% block content %}
14-
{% bootstrap_messages %}
1514

1615
{% if form.instance|to_class_name == "HolderIprDisclosure" %}
1716
<h1>The Patent Disclosure and Licensing Declaration Template for Specific IPR Disclosures</h1>
@@ -62,7 +61,9 @@ <h1>The Patent Disclosure and Licensing Declaration Template for Generic IPR Dis
6261
will be posted, but will be marked as "non-compliant".
6362
</p>
6463

65-
<form class="ipr-form form-horizontal" role="form" method="post">
64+
{% bootstrap_messages %}
65+
66+
<form class="ipr-form form-horizontal show-required" role="form" method="post">
6667
{% csrf_token %}
6768

6869
{% if form.errors %}

ietf/templates/liaisons/edit.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ <h1>{% if liaison %}Edit liaison: {{ liaison }}{% else %}Send Liaison Statement{
3434
<p class="help-block">Fields marked with <label class="required"></label> are required. For detailed descriptions of the fields see the <a href="{% url "liaisons_field_help" %}">field help</a>.</p>
3535
{% endif %}
3636

37-
<form role="form" class="liaisons form-horizontal" method="post" enctype="multipart/form-data" data-ajax-info-url="{% url "ietf.liaisons.views.ajax_get_liaison_info" %}">{% csrf_token %}
37+
<form role="form" class="liaisons form-horizontal show-required" method="post" enctype="multipart/form-data" data-ajax-info-url="{% url "ietf.liaisons.views.ajax_get_liaison_info" %}">{% csrf_token %}
3838

3939
{% for fieldset in form.get_fieldsets %}
4040
<h2>{{ fieldset.name }}</h2>

static/facelift/js/ietf.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,3 +246,9 @@ $(document).ready(function () {
246246

247247
// Use the Bootstrap3 tooltip plugin for all elements with a title attribute
248248
$('[title][title!=""]').tooltip();
249+
250+
$(document).ready(function () {
251+
// add a required class on labels on forms that should have
252+
// explicit requirement asterisks
253+
$("form.show-required input[required],select[required],textarea[required]").closest(".form-group").find("label").addClass("required");
254+
});

static/facelift/js/ipr-edit.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
$(document).ready(function() {
22
var form = $(".ipr-form");
33

4-
form.find("input[required],select[required],textarea[required]").closest(".form-group").find("label").addClass("required");
54
var template = form.find('.draft-row.template');
65

76
var templateData = template.clone();

static/facelift/js/ipr-search.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ $(document).ready(function() {
1212
}
1313
});
1414

15+
// make enter presses submit through the nearby button
1516
$("form.ipr-search input,select").keyup(function (e) {
1617
if (e.which == 13) {
1718
$(this).next('button[type=submit]').click();

static/facelift/js/liaisons.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -309,8 +309,6 @@ $(document).ready(function () {
309309

310310

311311
// init form
312-
form.find("input[required],select[required],textarea[required]").closest(".form-group").find("label").addClass("required");
313-
314312
organization.change(function() { updateInfo(false, 'to'); });
315313
organization.change(checkOtherSDO);
316314
from.change(function() { checkFrom(false); });

0 commit comments

Comments
 (0)