make logo configurable via HYDRA_LOGO env var

This commit is contained in:
Rob Vermaas 2011-04-18 08:21:27 +00:00
parent d4c96a47c9
commit a8b3ebd514
2 changed files with 25 additions and 18 deletions

View file

@ -17,10 +17,10 @@ sub begin :Private {
$c->stash->{version} = $ENV{"HYDRA_RELEASE"} || "<devel>"; $c->stash->{version} = $ENV{"HYDRA_RELEASE"} || "<devel>";
$c->stash->{nixVersion} = $ENV{"NIX_RELEASE"} || "<devel>"; $c->stash->{nixVersion} = $ENV{"NIX_RELEASE"} || "<devel>";
$c->stash->{curTime} = time; $c->stash->{curTime} = time;
$c->stash->{logo} = $ENV{"HYDRA_LOGO"} ? "/logo" : "/static/images/hydra.png" ;
if (scalar(@args) == 0 || $args[0] ne "static") { if (scalar(@args) == 0 || $args[0] ne "static") {
$c->stash->{nrRunningBuilds} = $c->model('DB::BuildSchedulingInfo')->search({ busy => 1 }, {})->count(); $c->stash->{nrRunningBuilds} = $c->model('DB::BuildSchedulingInfo')->search({ busy => 1 }, {})->count();
$c->stash->{nrQueuedBuilds} = $c->model('DB::BuildSchedulingInfo')->count(); $c->stash->{nrQueuedBuilds} = $c->model('DB::BuildSchedulingInfo')->count();
} }
} }
@ -224,4 +224,11 @@ sub change_password_submit : Path('change-password/submit') : Args(0) {
$c->res->redirect("/"); $c->res->redirect("/");
} }
sub logo :Local {
my ($self, $c) = @_;
my $path = $ENV{"HYDRA_LOGO"} or die("Logo not set!");
$c->serve_static_file($path);
}
1; 1;

View file

@ -7,7 +7,7 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head> <head>
<title>Hydra - [% title %]</title> <title>Hydra - [% title %]</title>
<link type="text/css" href="/static/js/jquery/css/smoothness/jquery-ui-1.8.5.custom.css" rel="Stylesheet" /> <link type="text/css" href="/static/js/jquery/css/smoothness/jquery-ui-1.8.5.custom.css" rel="Stylesheet" />
@ -15,18 +15,18 @@
<link rel="stylesheet" href="/static/css/nix-common.css" type="text/css" /> <link rel="stylesheet" href="/static/css/nix-common.css" type="text/css" />
<link rel="stylesheet" href="/static/css/nixos-site.css" type="text/css" /> <link rel="stylesheet" href="/static/css/nixos-site.css" type="text/css" />
<link rel="stylesheet" href="/static/css/logfile.css" type="text/css" /> <link rel="stylesheet" href="/static/css/logfile.css" type="text/css" />
<script type="text/javascript" src="/static/js/jquery/js/jquery-1.4.2.min.js"></script> <script type="text/javascript" src="/static/js/jquery/js/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="/static/js/jquery/js/jquery-ui-1.8.5.custom.min.js"></script> <script type="text/javascript" src="/static/js/jquery/js/jquery-ui-1.8.5.custom.min.js"></script>
<script type="text/javascript" src="/static/js/tablesorter/jquery.tablesorter.js"></script> <script type="text/javascript" src="/static/js/tablesorter/jquery.tablesorter.js"></script>
<script type="text/javascript"> <script type="text/javascript">
$(document).ready(function() { $(document).ready(function() {
/*** Sortable tables. ***/ /*** Sortable tables. ***/
$("table.tablesorter").tablesorter(); $("table.tablesorter").tablesorter();
/*** Tree toggles in logfiles. ***/ /*** Tree toggles in logfiles. ***/
/* Set the appearance of the toggle depending on whether the /* Set the appearance of the toggle depending on whether the
@ -69,19 +69,19 @@
}); });
</script> </script>
</head> </head>
<body> <body>
<div id="page"> <div id="page">
<div id="header"> <div id="header">
<div id="logo"><a class="no-hover" href="/"><img src="/static/images/hydra.png" alt="Hydra Logo" /></a></div> <div id="logo"><a class="no-hover" href="/"><img src="[% logo %]" alt="Hydra Logo" /></a></div>
[% PROCESS topbar.tt %] [% PROCESS topbar.tt %]
[% PROCESS contextbar.tt %] [% PROCESS contextbar.tt %]
</div> </div>
<div id="main"> <div id="main">
[% PROCESS navbar.tt %] [% PROCESS navbar.tt %]
<div id="content"> <div id="content">
[% content %] [% content %]