public inbox for development@lists.ipfire.org
 help / color / mirror / Atom feed
* [PATCH 1/4] zoneconf.cgi: Clean up HTML output
@ 2020-11-17  6:29 Leo-Andres Hofmann
  2020-11-17  6:29 ` [PATCH 2/4] zoneconf.cgi: Make output HTML 5 standard compliant Leo-Andres Hofmann
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Leo-Andres Hofmann @ 2020-11-17  6:29 UTC (permalink / raw)
  To: development

[-- Attachment #1: Type: text/plain, Size: 4158 bytes --]

This adds missing brackets, cleans up the indentation and removes unnecessary CSS.

Signed-off-by: Leo-Andres Hofmann <hofmann(a)leo-andres.de>
---
 html/cgi-bin/zoneconf.cgi | 46 +++++++++++++++++++--------------------
 1 file changed, 22 insertions(+), 24 deletions(-)

diff --git a/html/cgi-bin/zoneconf.cgi b/html/cgi-bin/zoneconf.cgi
index d99a3e611..067410582 100644
--- a/html/cgi-bin/zoneconf.cgi
+++ b/html/cgi-bin/zoneconf.cgi
@@ -38,10 +38,6 @@ my $css = <<END
 		height: 4em;
 	}
 
-	tr.thin {
-		height: 3em;
-	}
-
 	td.narrow {
 		width: 11em;
 	}
@@ -85,10 +81,6 @@ my $css = <<END
 		border-left-style: none;
 	}
 
-	td.disabled {
-		background-color: #cccccc;
-	}
-
 	td.textcenter {
 		text-align: center;
 	}
@@ -312,8 +304,8 @@ if ($cgiparams{"ACTION"} eq $Lang::tr{"save"}) {
 print <<END
 <form method='post' enctype='multipart/form-data'>
 	<table>
-		<tr>
-		<td class="h narrow topleft" /td>
+	<tr>
+		<td class="h narrow topleft"></td>
 END
 ;
 
@@ -332,7 +324,7 @@ foreach (@zones) {
 		my $red_restricted = ($uc eq "RED" && ! ($red_type eq "STATIC" || $red_type eq "DHCP"));
 
 		if ($red_restricted) {
-			print "<td class='h textcenter $_'>$uc ($red_type)</td>";
+			print "\t\t<td class='h textcenter $_'>$uc ($red_type)</td>\n";
 
 			next; # We're done here
 		}
@@ -350,7 +342,7 @@ foreach (@zones) {
 	}
 
 	print <<END
-		<td class='h textcenter $_'>$uc</br>
+		<td class='h textcenter $_'>$uc<br>
 			<select name="MODE $uc">
 				<option value="DEFAULT" $mode_selected{"DEFAULT"}>$Lang::tr{"zoneconf nicmode default"}</option>
 				<option value="BRIDGE" $mode_selected{"BRIDGE"}>$Lang::tr{"zoneconf nicmode bridge"}</option>
@@ -361,7 +353,7 @@ END
 ;
 }
 
-print "</tr>";
+print "\t</tr>\n";
 
 my $slightlygrey = "";
 
@@ -370,7 +362,8 @@ foreach (@nics) {
 	my $nic = $_->[1];
 	my $wlan = $_->[2];
 
-	print "<tr><td class='h narrow textcenter'>$nic<br>$mac</td>";
+	print "\t<tr>\n";
+	print "\t\t<td class='h narrow textcenter'>$nic<br>$mac</td>\n";
 
 	# Iterate through all zones and check if the current NIC is assigned to it
 	foreach (@zones) {
@@ -393,7 +386,12 @@ foreach (@nics) {
 					$checked = "checked";
 				}
 
-				print "<td class='textcenter $slightlygrey'><input type='radio' id='PPPACCESS $mac' name='PPPACCESS' value='$mac' $checked></td>";
+				print <<END
+		<td class="textcenter $slightlygrey">
+			<input type="radio" id="PPPACCESS $mac" name="PPPACCESS" value="$mac" $checked>
+		</td>
+END
+;
 				next; # We're done here
 			}
 		}
@@ -432,19 +430,19 @@ foreach (@nics) {
 		my $vlan_disabled = ($wlan) ? "disabled" : "";
 
 		print <<END
-			<td class="textcenter $slightlygrey">
-				<select name="ACCESS $uc $mac" onchange="document.getElementById('TAG $uc $mac').disabled = (this.value === 'VLAN' ? false : true)">
-					<option value="NONE" $access_selected{"NONE"}>- $Lang::tr{"zoneconf access none"} -</option>
-					<option value="NATIVE" $access_selected{"NATIVE"}>$Lang::tr{"zoneconf access native"}</option>
-					<option value="VLAN" $access_selected{"VLAN"} $vlan_disabled>$Lang::tr{"zoneconf access vlan"}</option>
-				</select>
-				<input type="number" class="vlanid" id="TAG $uc $mac" name="TAG $uc $mac" min="1" max="4095" value="$zone_vlan_id" $field_disabled>
-			</td>
+		<td class="textcenter $slightlygrey">
+			<select name="ACCESS $uc $mac" onchange="document.getElementById('TAG $uc $mac').disabled = (this.value === 'VLAN' ? false : true)">
+				<option value="NONE" $access_selected{"NONE"}>- $Lang::tr{"zoneconf access none"} -</option>
+				<option value="NATIVE" $access_selected{"NATIVE"}>$Lang::tr{"zoneconf access native"}</option>
+				<option value="VLAN" $access_selected{"VLAN"} $vlan_disabled>$Lang::tr{"zoneconf access vlan"}</option>
+			</select>
+			<input type="number" class="vlanid" id="TAG $uc $mac" name="TAG $uc $mac" min="1" max="4095" value="$zone_vlan_id" $field_disabled>
+		</td>
 END
 ;
 	}
 
-	print "</tr>";
+	print "\t</tr>\n";
 
 	if ($slightlygrey) {
 		$slightlygrey = "";
-- 
2.27.0.windows.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-12-01 22:25 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-17  6:29 [PATCH 1/4] zoneconf.cgi: Clean up HTML output Leo-Andres Hofmann
2020-11-17  6:29 ` [PATCH 2/4] zoneconf.cgi: Make output HTML 5 standard compliant Leo-Andres Hofmann
2020-11-17  6:29 ` [PATCH 3/4] zoneconf.cgi: Improve CSS Leo-Andres Hofmann
2020-11-17  6:29 ` [PATCH 4/4] zoneconf.cgi: Add NIC selection highlighting Leo-Andres Hofmann
2020-11-17 10:54 ` [PATCH 1/4] zoneconf.cgi: Clean up HTML output Michael Tremer
2020-12-01 22:25 ` Thank you for cleaning up the CGIs (was: Re: [PATCH 1/4] zoneconf.cgi: Clean up HTML output) Peter Müller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox