public inbox for development@lists.ipfire.org
 help / color / mirror / Atom feed
From: Michael Tremer <michael.tremer@ipfire.org>
To: development@lists.ipfire.org
Subject: Re: [PATCH 1/4] zoneconf.cgi: Clean up HTML output
Date: Tue, 17 Nov 2020 10:54:07 +0000	[thread overview]
Message-ID: <1B49992F-E193-41B7-9153-2DBA1CF27EF3@ipfire.org> (raw)
In-Reply-To: <20201117062904.1547-1-hofmann@leo-andres.de>

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

Hello Leo,

This looks like a very clean set of patches. Well done.

I haven’t tested it, but I have seen the previous version in action.

It really looks good.

Best,
-Michael

Reviewed-by: Michael Tremer <michael.tremer(a)ipfire.org>

> On 17 Nov 2020, at 06:29, Leo-Andres Hofmann <hofmann(a)leo-andres.de> wrote:
> 
> 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
> 


  parent reply	other threads:[~2020-11-17 10:54 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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
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 ` Michael Tremer [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1B49992F-E193-41B7-9153-2DBA1CF27EF3@ipfire.org \
    --to=michael.tremer@ipfire.org \
    --cc=development@lists.ipfire.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox