Summary: Move required field asterisk handling to ietf.js, fix some

cosmetic stuff in the facelifted IPR code
 - Legacy-Id: 8917
This commit is contained in:
Ole Laursen 2015-01-26 12:56:39 +00:00
parent 8d5cd02922
commit 1bd0910210
8 changed files with 13 additions and 8 deletions

View file

@ -11,7 +11,7 @@
{% bootstrap_messages %}
<form class="add-comment" method="post">
<form role="form" class="add-comment" method="post">
{% csrf_token %}
{% bootstrap_form form %}

View file

@ -15,7 +15,7 @@
{% bootstrap_messages %}
<form class="add-email" method="post">
<form role="form" class="add-email" method="post">
{% csrf_token %}
{% bootstrap_form form %}

View file

@ -11,7 +11,6 @@
{% endblock %}
{% block content %}
{% bootstrap_messages %}
{% if form.instance|to_class_name == "HolderIprDisclosure" %}
<h1>The Patent Disclosure and Licensing Declaration Template for Specific IPR Disclosures</h1>
@ -62,7 +61,9 @@
will be posted, but will be marked as "non-compliant".
</p>
<form class="ipr-form form-horizontal" role="form" method="post">
{% bootstrap_messages %}
<form class="ipr-form form-horizontal show-required" role="form" method="post">
{% csrf_token %}
{% if form.errors %}

View file

@ -34,7 +34,7 @@
<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>
{% endif %}
<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 %}
<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 %}
{% for fieldset in form.get_fieldsets %}
<h2>{{ fieldset.name }}</h2>

View file

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

View file

@ -1,7 +1,6 @@
$(document).ready(function() {
var form = $(".ipr-form");
form.find("input[required],select[required],textarea[required]").closest(".form-group").find("label").addClass("required");
var template = form.find('.draft-row.template');
var templateData = template.clone();

View file

@ -12,6 +12,7 @@ $(document).ready(function() {
}
});
// make enter presses submit through the nearby button
$("form.ipr-search input,select").keyup(function (e) {
if (e.which == 13) {
$(this).next('button[type=submit]').click();

View file

@ -309,8 +309,6 @@ $(document).ready(function () {
// init form
form.find("input[required],select[required],textarea[required]").closest(".form-group").find("label").addClass("required");
organization.change(function() { updateInfo(false, 'to'); });
organization.change(checkOtherSDO);
from.change(function() { checkFrom(false); });