feature: converted css to use symlinks and multiple files

This commit is contained in:
Darryl Quinn 2015-04-05 21:19:32 -05:00
parent 6672996cd3
commit df0bc42208
8 changed files with 96 additions and 27 deletions

View File

@ -0,0 +1,28 @@
body { font-family:Verdana; background: white; color:black }
a:link { background: white; color: black }
a:visited { background: white; color: black }
a:active { background: white; color: black }
h1 { font-family:Verdana; color: black}
hr {
width: 100%;
height: 2px;
margin-left: auto;
margin-right: auto;
color: black;
background-color: white;
}
body table {
font-size: 16px;
}
.navbar_select { background:white; color:black }
.navbar_select a:link { background:white; color:black }
.navbar_select a:visited { background:white; color:black }
.navbar_select a:active { background:white; color:black }
.TopBanner { width:100%; }
.LogoDiv { position:absolute left:0px; width:100%; height:95; }
.AREDNLogo { background: white; position:absolute; left:10%; width:175; height:95; }
.PartOfAREDN { font-family:Verdana; font-size:xx-small; text-align:center; }

View File

@ -61,7 +61,9 @@ sub html_header
print "<meta http-equiv='expires' content='0'>\n";
print "<meta http-equiv='cache-control' content='no-cache'>\n";
print "<meta http-equiv='pragma' content='no-cache'>\n";
print "<link id='stylesheet_css' rel=StyleSheet href='/style.css' type='text/css'>\n";
my $rnum=`date +%s`;
chomp($rnum);
print "<link id='stylesheet_css' rel=StyleSheet href='/style.css?", $rnum, "' type='text/css'>\n";
print "</head>\n" if $close;
}
@ -1362,14 +1364,14 @@ sub get_interface
sub css_options
{
print "<option value=\"/style.css\">Select a theme</option>";
print "<option value=\"style.css\">Select a theme</option>";
my @cssfiles = `ls /www/*.css`;
foreach $css (@cssfiles)
{
chomp($css);
$css =~ m#^(.*?)([^/]*)(\.css)$#;
($dir,$file) = ($1,$2);
print "<option value=\"/$file.css\">$file</option>" unless $file eq "style";
print "<option value=\"$file.css\">$file</option>" unless $file eq "style";
}
}

View File

@ -49,13 +49,17 @@ $config = "not set" if $config eq "" or not -d "/etc/config.$config";
read_postdata();
# set up the style sheet
system "cp -f /www/aredn.css /www/style.css" unless -f "/www/style.css";
if($parms{css}) { system "cp -f /www/$parms{css} /www/style.css" }
system "rm -rf /www/style.css" if -f "/www/style.css"; # cleanup any actual file named style.css
system "ln -s /www/aredn.css /www/style.css" unless -l "/www/style.css";
if($parms{css}) {
system "ln -fs /www/$parms{css} /www/style.css" if -f "/www/$parms{css}";
}
# generate the page
http_header();
html_header("AREDN&trade; Node $node", 1);
print "<body><form method=post action=/cgi-bin/status enctype='multipart/form-data'>\n";
print "<body><form method='post' action='/cgi-bin/status' enctype='multipart/form-data'>\n";
print "<center>\n";
alert_banner();

View File

@ -1,20 +0,0 @@
body { background:black; color:red }
a:link { background:black; color:gray }
a:visited { background:black; color:gray }
a:active { background:black; color:gray }
button { background-color:gray; font-weight:bold }
input { background-color:gray; font-weight:bold }
option { background-color:gray; font-weight:bold }
select { background-color:gray; font-weight:bold }
.navbar_select { background:red; color:black }
.navbar_select a:link { background:red; color:black }
.navbar_select a:visited { background:red; color:black }
.navbar_select a:active { background:red; color:black }
.TopBanner { width:100%; }
.LogoDiv { position:absolute left:0px; width:100%; height:95; }
.AREDNLogo { background:rgb(231,231,231); position:absolute; left:10%; width:175; height:95; }
.PartOfAREDN { font-family:Verdana; font-size:xx-small; text-align:center; }

View File

@ -0,0 +1,28 @@
body { font-family:Verdana; background: black; color:red }
a:link { background: black; color: red }
a:visited { background: black; color: red }
a:active { background: black; color: red }
h1 { font-family:Verdana; color: red}
hr {
width: 100%;
height: 2px;
margin-left: auto;
margin-right: auto;
color: red;
background-color: black;
}
body table {
font-size: 16px;
}
.navbar_select { background:black; color:red }
.navbar_select a:link { background:black; color:red }
.navbar_select a:visited { background:black; color:red }
.navbar_select a:active { background:black; color:red }
.TopBanner { width:100%; }
.LogoDiv { position:absolute left:0px; width:100%; height:95; }
.AREDNLogo { background: white; position:absolute; left:10%; width:175; height:95; }
.PartOfAREDN { font-family:Verdana; font-size:xx-small; text-align:center; }

View File

@ -1 +0,0 @@
/tmp/web/style.css

View File

@ -0,0 +1,28 @@
body { font-family:Verdana; background: black; color:yellow }
a:link { background: black; color: yellow }
a:visited { background: black; color: yellow }
a:active { background: black; color: yellow }
h1 { font-family:Verdana; color: yellow}
hr {
width: 100%;
height: 2px;
margin-left: auto;
margin-right: auto;
color: yellow;
background-color: black;
}
body table {
font-size: 16px;
}
.navbar_select { background:black; color:yellow }
.navbar_select a:link { background:black; color:yellow }
.navbar_select a:visited { background:black; color:yellow }
.navbar_select a:active { background:black; color:yellow }
.TopBanner { width:100%; }
.LogoDiv { position:absolute left:0px; width:100%; height:95; }
.AREDNLogo { background: white; position:absolute; left:10%; width:175; height:95; }
.PartOfAREDN { font-family:Verdana; font-size:xx-small; text-align:center; }