From: Adolf Belka <adolf.belka@ipfire.org>
To: development@lists.ipfire.org
Subject: [PATCH 2/2] updatexlrator.cgi: Update to naming of variables in css section
Date: Mon, 06 Mar 2023 18:04:24 +0100 [thread overview]
Message-ID: <20230306170424.3447723-2-adolf.belka@ipfire.org> (raw)
In-Reply-To: <20230306170424.3447723-1-adolf.belka@ipfire.org>
[-- Attachment #1: Type: text/plain, Size: 4038 bytes --]
- This updates the updatexlrator.cgi page to the same central use of extraHead from
header.pl and simplifying of css variables where appropriate.
- The variables for the percentage bar will also be able to be used in other cgi pages
with a percent bar.
Tested-by: Adolf Belka <adolf.belka(a)ipfire.org>
Signed-off-by: Adolf Belka <adolf.belka(a)ipfire.org>
---
| 25 ++++++++++++++++
html/cgi-bin/updatexlrator.cgi | 54 +++++-----------------------------
2 files changed, 32 insertions(+), 47 deletions(-)
--git a/config/cfgroot/header.pl b/config/cfgroot/header.pl
index e4d917161..955ed2646 100644
--- a/config/cfgroot/header.pl
+++ b/config/cfgroot/header.pl
@@ -58,6 +58,31 @@ $Header::extraHead = <<END
.red {
background-color: red;
}
+ .table1colour {
+ background-color: $Header::table1colour;
+ }
+ .table2colour {
+ background-color: $Header::table2colour;
+ }
+ .percent-box {
+ border-style: solid;
+ border-width: 1px;
+ border-color: #a0a0a0;
+ width: 100px;
+ height: 10px;
+ }
+ .percent-bar {
+ background-color: #a0a0a0;
+ border-style: solid;
+ border-width: 1px;
+ border-color: #e2e2e2;
+ }
+ .percent-space {
+ background-color: #e2e2e2;
+ border-style: solid;
+ border-width: 1px;
+ border-color: #e2e2e2;
+ }
</style>
END
;
diff --git a/html/cgi-bin/updatexlrator.cgi b/html/cgi-bin/updatexlrator.cgi
index 47d3cca42..09f9f5de1 100644
--- a/html/cgi-bin/updatexlrator.cgi
+++ b/html/cgi-bin/updatexlrator.cgi
@@ -105,46 +105,6 @@ my @metadata=();
&General::readhash("${General::swroot}/proxy/settings", \%proxysettings);
&General::readhash("/srv/web/ipfire/html/themes/ipfire/include/colors.txt", \%color);
-###--- HTML HEAD ---###
-my $extraHead = <<END
-<style>
- .row-color20 {
- background-color: $color{'color20'};
- }
- .row-color22 {
- background-color: $color{'color22'};
- }
- .row-table1colour {
- background-color: $Header::table1colour;
- }
- .row-table2colour {
- background-color: $Header::table2colour;
- }
- .percent-box {
- border-style: solid;
- border-width: 1px;
- border-color: #a0a0a0;
- width: 100px;
- height: 10px;
- }
- .percent-bar {
- background-color: #a0a0a0;
- border-style: solid;
- border-width: 1px;
- border-color: #e2e2e2;
- }
- .percent-space {
- background-color: #e2e2e2;
- border-style: solid;
- border-width: 1px;
- border-color: #e2e2e2;
- }
-</style>
-END
-;
-###--- END HTML HEAD ---###
-
-
$xlratorsettings{'ACTION'} = '';
$xlratorsettings{'ENABLE_LOG'} = 'off';
$xlratorsettings{'PASSIVE_MODE'} = 'off';
@@ -409,7 +369,7 @@ $selected{'NOT_ACCESSED_LAST'}{$xlratorsettings{'NOT_ACCESSED_LAST'}} = "selecte
&Header::showhttpheaders();
-&Header::openpage($Lang::tr{'updxlrtr configuration'}, 1, $extraHead);
+&Header::openpage($Lang::tr{'updxlrtr configuration'}, 1, $Header::extraHead);
&Header::openbigbox('100%', 'left', '', $errormessage);
@@ -572,9 +532,9 @@ END
$id++;
if ($id % 2) {
- print "<tr class='row-table1colour'>\n"; }
+ print "<tr class='table1colour'>\n"; }
else {
- print "<tr class='row-table2colour'>\n"; }
+ print "<tr class='table2colour'>\n"; }
$filesize = $size_updatefile;
1 while $filesize =~ s/^(-?\d+)(\d{3})/$1.$2/;
@@ -863,9 +823,9 @@ foreach (@vendors)
$id++;
if ($id % 2) {
- print "<tr class='row-color20'>\n"; }
+ print "<tr class='color20'>\n"; }
else {
- print "<tr class='row-color22'>\n"; }
+ print "<tr class='color22'>\n"; }
print "<td class='base' align='center'><nobr> ";
@@ -1202,9 +1162,9 @@ END
$id++;
if ($id % 2) {
- print "<tr class='row-table1colour'>\n"; }
+ print "<tr class='table1colour'>\n"; }
else {
- print "<tr class='row-table2colour'>\n"; }
+ print "<tr class='table2colour'>\n"; }
$filesize = $size_updatefile;
1 while $filesize =~ s/^(-?\d+)(\d{3})/$1.$2/;
--
2.39.2
prev parent reply other threads:[~2023-03-06 17:04 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-06 17:04 [PATCH 1/2] dhcp.cgi: " Adolf Belka
2023-03-06 17:04 ` Adolf Belka [this message]
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=20230306170424.3447723-2-adolf.belka@ipfire.org \
--to=adolf.belka@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