From patchwork Tue Nov 17 06:29:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leo-Andres Hofmann X-Patchwork-Id: 3667 Return-Path: Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4CZwyX535qz3wlJ for ; Tue, 17 Nov 2020 06:29:24 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [172.28.1.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail02.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4CZwyT1HQrz1qg; Tue, 17 Nov 2020 06:29:21 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4CZwyT0pJhz2yfw; Tue, 17 Nov 2020 06:29:21 +0000 (UTC) Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4CZwyR0xmCz2y3s for ; Tue, 17 Nov 2020 06:29:19 +0000 (UTC) Received: from arche.uberspace.de (arche.uberspace.de [185.26.156.147]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mail01.ipfire.org (Postfix) with ESMTPS id 4CZwyQ2vHHz1kr for ; Tue, 17 Nov 2020 06:29:18 +0000 (UTC) Received: (qmail 11037 invoked from network); 17 Nov 2020 06:29:17 -0000 Received: from localhost (HELO localhost) (127.0.0.1) by arche.uberspace.de with SMTP; 17 Nov 2020 06:29:17 -0000 From: Leo-Andres Hofmann To: development@lists.ipfire.org Subject: [PATCH 3/4] zoneconf.cgi: Improve CSS Date: Tue, 17 Nov 2020 07:29:03 +0100 Message-Id: <20201117062904.1547-3-hofmann@leo-andres.de> X-Mailer: git-send-email 2.27.0.windows.1 In-Reply-To: <20201117062904.1547-1-hofmann@leo-andres.de> References: <20201117062904.1547-1-hofmann@leo-andres.de> MIME-Version: 1.0 ARC-Authentication-Results: i=1; mail01.ipfire.org; dkim=none; dmarc=none; spf=pass (mail01.ipfire.org: domain of hofmann@leo-andres.de designates 185.26.156.147 as permitted sender) smtp.mailfrom=hofmann@leo-andres.de ARC-Seal: i=1; s=202003rsa; d=lists.ipfire.org; t=1605594558; a=rsa-sha256; cv=none; b=hgP29Q2FEU4w4Vn5ERjY3/ddWzdXFL0j7aln12L9upm7l/L+2HFGPSqB3bXXeOlKmreVhi UpC1jjmGb3ypNyHPuADh74qiiotcUwiA5mmhBGwAQzF4TzdzmwPAKe3gjKsLP+TRDm8UEf FGW5kvQJpL+ZnMOQge5CK3n7/HH5dwelieFSkw+rFvnV6iQ2Oqp4Ch3v77jIbTwE59zUur tD4vbDMbCLZDYBDsWpOiICj2YeM7LysLfUYcZD37sS70n+QCuVhAhFDGq2zdxcq2uITNnf DQNwQeL09MOvpBWXyJnyMUCuHVo7tSp3qTM6AOuJScghllCnztjUvcv39UuQoQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=lists.ipfire.org; s=202003rsa; t=1605594558; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=WBjER5TTufB7e5MlpNyT1+vwhLnijf6yOMo2at7ioKE=; b=B3hoJvvMV8N+aF8ZcMopm6MvXMesYmlEW2UR0rr0ext4PqkDf+a1v/5Opu/6cUlRbiKs72 VdxlZSo0uzssYDQdKiYLedBYqcNZaEFiswmikxH3sjvZ2qEuhmAknlrWJxOwNPW4kub2qH 3XbvFof3Qwey/YnbB25gg0ekLTjUMgaKqqlczKdwmRHVk3pDIGf82Xq514Gv8bSCF9SSVN 57jh43R5V+q3F+55lR9OY05xBTmvEHMRvxrlO23OxSGmxsYXF5fYK6I+zatwdgjBrpJ18X WfPFjv3bunQYk/9ivat5xDwhBnASHvKUvIqRfZxv0ljvAMaXB65uluoIiPTqYQ== X-Rspamd-Server: mail01.haj.ipfire.org X-Spamd-Result: default: False [0.69 / 11.00]; ARC_NA(0.00)[]; BAYES_HAM(-3.00)[99.99%]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+mx:c]; R_MISSING_CHARSET(2.50)[]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; BROKEN_CONTENT_TYPE(1.50)[]; RCPT_COUNT_ONE(0.00)[1]; RCVD_TLS_LAST(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM(-1.00)[-1.000]; IP_REPUTATION_HAM(-0.01)[asn: 205766(0.00), country: DE(-0.00), ip: 185.26.156.147(0.00)]; DMARC_NA(0.00)[leo-andres.de]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:205766, ipnet:185.26.156.0/24, country:DE]; RCVD_COUNT_TWO(0.00)[2]; ARC_SIGNED(0.00)[lists.ipfire.org:s=202003rsa:i=1] X-Rspamd-Queue-Id: 4CZwyQ2vHHz1kr Authentication-Results: mail01.ipfire.org; dkim=none; dmarc=none; spf=pass (mail01.ipfire.org: domain of hofmann@leo-andres.de designates 185.26.156.147 as permitted sender) smtp.mailfrom=hofmann@leo-andres.de X-BeenThere: development@lists.ipfire.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: IPFire development talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: development-bounces@lists.ipfire.org Sender: "Development" - Add an element id so that the styling only affects the zone table - Alternating row colors are now generated by CSS, remove unneeded Perl code Signed-off-by: Leo-Andres Hofmann --- html/cgi-bin/zoneconf.cgi | 73 ++++++++++++++++++--------------------- 1 file changed, 33 insertions(+), 40 deletions(-) diff --git a/html/cgi-bin/zoneconf.cgi b/html/cgi-bin/zoneconf.cgi index 2346aa829..ef361af95 100644 --- a/html/cgi-bin/zoneconf.cgi +++ b/html/cgi-bin/zoneconf.cgi @@ -28,63 +28,64 @@ require "${General::swroot}/header.pl"; my $css = < - table { + table#zoneconf { width: 100%; border-collapse: collapse; table-layout: fixed; } - tr { + #zoneconf tr { height: 4em; } - td.narrow { - width: 11em; + #zoneconf td { + padding: 5px 10px; + border: 0.5px solid black; + text-align: center; } - td { - padding: 5px; - padding-left: 10px; - padding-right: 10px; - border: 0.5px solid black; + /* dark grey header cells */ + #zoneconf td.heading { + background-color: grey; + color: white; + } + #zoneconf td.heading::first-line { + font-weight: bold; + line-height: 1.6; } - td.slightlygrey { - background-color: #F0F0F0; + /* narrow left column */ + #zoneconf tr > td:first-child { + width: 11em; } - td.h { - background-color: grey; - color: white; - font-weight: 800; + /* alternating row background color */ + #zoneconf tr:nth-child(2n+3) { + background-color: #F0F0F0; } - td.green { + #zoneconf td.green { background-color: $Header::colourgreen; } - td.red { + #zoneconf td.red { background-color: $Header::colourred; } - td.blue { + #zoneconf td.blue { background-color: $Header::colourblue; } - td.orange { + #zoneconf td.orange { background-color: $Header::colourorange; } - td.topleft { - background-color: white; + #zoneconf td.topleft { + background-color: $Header::pagecolour; border-top-style: none; border-left-style: none; } - td.textcenter { - text-align: center; - } - input.vlanid { width: 4em; } @@ -299,9 +300,9 @@ if ($cgiparams{"ACTION"} eq $Lang::tr{"save"}) { print < - +
- + END ; @@ -320,7 +321,7 @@ foreach (@zones) { my $red_restricted = ($uc eq "RED" && ! ($red_type eq "STATIC" || $red_type eq "DHCP")); if ($red_restricted) { - print "\t\t\n"; + print "\t\t\n"; next; # We're done here } @@ -338,7 +339,7 @@ foreach (@zones) { } print <$uc
+
\n"; -my $slightlygrey = ""; - foreach (@nics) { my $mac = $_->[0]; my $nic = $_->[1]; my $wlan = $_->[2]; print "\t\n"; - print "\t\t\n"; + print "\t\t\n"; # Iterate through all zones and check if the current NIC is assigned to it foreach (@zones) { @@ -383,7 +382,7 @@ foreach (@nics) { } print < + END @@ -426,7 +425,7 @@ END my $vlan_disabled = ($wlan) ? "disabled" : ""; print < + \n"; - - if ($slightlygrey) { - $slightlygrey = ""; - } else { - $slightlygrey = "slightlygrey"; - } } print <
$uc ($red_type)$uc ($red_type)$uc
$nic
$mac
$nic
$mac