]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/commitdiff
updatexlrator.cgi: Update to naming of variables in css section
authorAdolf Belka <adolf.belka@ipfire.org>
Mon, 6 Mar 2023 17:04:24 +0000 (18:04 +0100)
committerPeter Müller <peter.mueller@ipfire.org>
Sat, 11 Mar 2023 16:30:39 +0000 (16:30 +0000)
- 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@ipfire.org>
Signed-off-by: Adolf Belka <adolf.belka@ipfire.org>
config/cfgroot/header.pl
html/cgi-bin/updatexlrator.cgi

index e4d9171618e42394e497e7c44df34565e557a29c..955ed2646b07c4bec355a2f00a74f87a5766685a 100644 (file)
@@ -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
 ;
index 47d3cca4211fab16ec7f8ff2ca5c20db5949d9f4..09f9f5de1d1913173576c393e38d99f47b4a6b66 100644 (file)
@@ -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>&nbsp;";
 
@@ -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/;