networks: Minor indentation fixes

This commit is contained in:
Sunil Mohan Adapa committed 2015-12-09 12:21:38 +05:30
1 parent d1b20ac113
commit da99a7cb9d
4 files changed
+68 -68

No files matched your search

+4 -4
View File
@@ -148,8 +148,8 @@ def edit(request, uuid):
if connection.get_connection_type() == '802-3-ethernet':
network.edit_ethernet_connection(
connection, name, interface, zone, ipv4_method,
ipv4_address, ipv4_netmask, ipv4_gateway,
ipv4_dns, ipv4_second_dns)
ipv4_address, ipv4_netmask, ipv4_gateway, ipv4_dns,
ipv4_second_dns)
elif connection.get_connection_type() == '802-11-wireless':
ssid = form.cleaned_data['ssid']
mode = form.cleaned_data['mode']
@@ -386,8 +386,8 @@ def add_wifi(request, ssid=None, interface_name=None):
network.add_wifi_connection(
name, interface, zone, ssid, mode, auth_mode, passphrase,
ipv4_method, ipv4_address, ipv4_netmask,
ipv4_gateway, ipv4_dns, ipv4_second_dns)
ipv4_method, ipv4_address, ipv4_netmask, ipv4_gateway,
ipv4_dns, ipv4_second_dns)
return redirect(reverse_lazy('networks:index'))
else:
if form_data:
@@ -43,40 +43,40 @@
<script type="text/javascript">
(function($) {
if ($("#id_ipv4_method").prop("value") != "manual") {
$("#id_ipv4_address").prop("readOnly", true);
$("#id_ipv4_netmask").prop("readOnly", true);
$("#id_ipv4_gateway").prop("readOnly", true);
}
$("#id_name").focus();
$("#id_ipv4_method").change(function() {
if ($("#id_ipv4_method").prop("value") == "manual") {
$("#id_ipv4_address").prop("readOnly", false);
$("#id_ipv4_address").prop("required", true);
$("#id_ipv4_netmask").prop("readOnly", false);
$("#id_ipv4_gateway").prop("readOnly", false);
} else {
$("#id_ipv4_address").val("");
$("#id_ipv4_address").prop("readOnly", true);
$("#id_ipv4_address").prop("required", false);
$("#id_ipv4_netmask").val("");
$("#id_ipv4_netmask").prop("readOnly", true);
$("#id_ipv4_gateway").val("");
$("#id_ipv4_gateway").prop("readOnly", true);
if ($("#id_ipv4_method").prop("value") != "manual") {
$("#id_ipv4_address").prop("readOnly", true);
$("#id_ipv4_netmask").prop("readOnly", true);
$("#id_ipv4_gateway").prop("readOnly", true);
}
});
$("#id_name").focus();
$('#id_show_password').change(function() {
// Changing type attribute from password to text is prevented by
// most browsers. Making a new form field works.
new_type = 'password';
if ($('#id_show_password').prop('checked'))
new_type = 'text';
$("#id_ipv4_method").change(function() {
if ($("#id_ipv4_method").prop("value") == "manual") {
$("#id_ipv4_address").prop("readOnly", false);
$("#id_ipv4_address").prop("required", true);
$("#id_ipv4_netmask").prop("readOnly", false);
$("#id_ipv4_gateway").prop("readOnly", false);
} else {
$("#id_ipv4_address").val("");
$("#id_ipv4_address").prop("readOnly", true);
$("#id_ipv4_address").prop("required", false);
$("#id_ipv4_netmask").val("");
$("#id_ipv4_netmask").prop("readOnly", true);
$("#id_ipv4_gateway").val("");
$("#id_ipv4_gateway").prop("readOnly", true);
}
});
$('#id_password').replaceWith(
$('#id_password').clone().attr('type', new_type));
});
$('#id_show_password').change(function() {
// Changing type attribute from password to text is prevented by
// most browsers. Making a new form field works.
new_type = 'password';
if ($('#id_show_password').prop('checked'))
new_type = 'text';
$('#id_password').replaceWith(
$('#id_password').clone().attr('type', new_type));
});
})(jQuery);
</script>
@@ -43,40 +43,40 @@
<script type="text/javascript">
(function($) {
if ($("#id_ipv4_method").prop("value") != "manual") {
$("#id_ipv4_address").prop("readOnly", true);
$("#id_ipv4_netmask").prop("readOnly", true);
$("#id_ipv4_gateway").prop("readOnly", true);
}
$("#id_name").focus();
if ($("#id_ipv4_method").prop("value") != "manual") {
$("#id_ipv4_address").prop("readOnly", true);
$("#id_ipv4_netmask").prop("readOnly", true);
$("#id_ipv4_gateway").prop("readOnly", true);
}
$("#id_name").focus();
$("#id_ipv4_method").change(function() {
if ($("#id_ipv4_method").prop("value") == "manual") {
$("#id_ipv4_address").prop("readOnly", false);
$("#id_ipv4_address").prop("required", true);
$("#id_ipv4_netmask").prop("readOnly", false);
$("#id_ipv4_gateway").prop("readOnly", false);
} else {
$("#id_ipv4_address").val("");
$("#id_ipv4_address").prop("readOnly", true);
$("#id_ipv4_address").prop("required", false);
$("#id_ipv4_netmask").val("");
$("#id_ipv4_netmask").prop("readOnly", true);
$("#id_ipv4_gateway").val("");
$("#id_ipv4_gateway").prop("readOnly", true);
}
});
$("#id_ipv4_method").change(function() {
if ($("#id_ipv4_method").prop("value") == "manual") {
$("#id_ipv4_address").prop("readOnly", false);
$("#id_ipv4_address").prop("required", true);
$("#id_ipv4_netmask").prop("readOnly", false);
$("#id_ipv4_gateway").prop("readOnly", false);
} else {
$("#id_ipv4_address").val("");
$("#id_ipv4_address").prop("readOnly", true);
$("#id_ipv4_address").prop("required", false);
$("#id_ipv4_netmask").val("");
$("#id_ipv4_netmask").prop("readOnly", true);
$("#id_ipv4_gateway").val("");
$("#id_ipv4_gateway").prop("readOnly", true);
}
});
$('#id_show_password').change(function() {
// Changing type attribute from password to text is prevented by
// most browsers. Making a new form field works.
new_type = 'password';
if ($('#id_show_password').prop('checked'))
new_type = 'text';
$('#id_show_password').change(function() {
// Changing type attribute from password to text is prevented by
// most browsers. Making a new form field works.
new_type = 'password';
if ($('#id_show_password').prop('checked'))
new_type = 'text';
$('#id_password').replaceWith(
$('#id_password').clone().attr('type', new_type));
});
$('#id_password').replaceWith(
$('#id_password').clone().attr('type', new_type));
});
})(jQuery);
</script>