hgweb: add a "web/logoimg" setting to customize the web logo image
This change complements the existing web/logourl setting, and lets the user
customize the logo image that is shown on many of the hg server pages.
If this setting is not set, hglogo.png is used.
--- a/mercurial/hgweb/hgweb_mod.py Thu Jul 21 11:05:26 2011 +0200
+++ b/mercurial/hgweb/hgweb_mod.py Thu Jul 21 15:10:16 2011 +0200
@@ -235,6 +235,7 @@
port = port != default_port and (":" + port) or ""
urlbase = '%s://%s%s' % (proto, req.env['SERVER_NAME'], port)
logourl = self.config("web", "logourl", "http://mercurial.selenic.com/")
+ logoimg = self.config("web", "logoimg", "hglogo.png")
staticurl = self.config("web", "staticurl") or req.url + 'static/'
if not staticurl.endswith('/'):
staticurl += '/'
@@ -275,6 +276,7 @@
tmpl = templater.templater(mapfile,
defaults={"url": req.url,
"logourl": logourl,
+ "logoimg": logoimg,
"staticurl": staticurl,
"urlbase": urlbase,
"repo": self.reponame,
--- a/mercurial/hgweb/hgwebdir_mod.py Thu Jul 21 11:05:26 2011 +0200
+++ b/mercurial/hgweb/hgwebdir_mod.py Thu Jul 21 15:10:16 2011 +0200
@@ -348,6 +348,7 @@
start = url[-1] == '?' and '&' or '?'
sessionvars = webutil.sessionvars(vars, start)
logourl = config('web', 'logourl', 'http://mercurial.selenic.com/')
+ logoimg = config('web', 'logoimg', 'hglogo.png')
staticurl = config('web', 'staticurl') or url + 'static/'
if not staticurl.endswith('/'):
staticurl += '/'
@@ -358,6 +359,7 @@
"motd": motd,
"url": url,
"logourl": logourl,
+ "logoimg": logoimg,
"staticurl": staticurl,
"sessionvars": sessionvars})
return tmpl
--- a/mercurial/templates/monoblue/footer.tmpl Thu Jul 21 11:05:26 2011 +0200
+++ b/mercurial/templates/monoblue/footer.tmpl Thu Jul 21 15:10:16 2011 +0200
@@ -9,7 +9,7 @@
</div>
<div id="powered-by">
- <p><a href="{logourl}" title="Mercurial"><img src="{staticurl}hglogo.png" width=75 height=90 border=0 alt="mercurial"></a></p>
+ <p><a href="{logourl}" title="Mercurial"><img src="{staticurl}{logoimg}" width=75 height=90 border=0 alt="mercurial"></a></p>
</div>
<div id="corner-top-left"></div>
--- a/mercurial/templates/monoblue/index.tmpl Thu Jul 21 11:05:26 2011 +0200
+++ b/mercurial/templates/monoblue/index.tmpl Thu Jul 21 15:10:16 2011 +0200
@@ -26,7 +26,7 @@
</div>
<div id="powered-by">
- <p><a href="{logourl}" title="Mercurial"><img src="{staticurl}hglogo.png" width=75 height=90 border=0 alt="mercurial"></a></p>
+ <p><a href="{logourl}" title="Mercurial"><img src="{staticurl}{logoimg}" width=75 height=90 border=0 alt="mercurial"></a></p>
</div>
<div id="corner-top-left"></div>
--- a/mercurial/templates/paper/bookmarks.tmpl Thu Jul 21 11:05:26 2011 +0200
+++ b/mercurial/templates/paper/bookmarks.tmpl Thu Jul 21 15:10:16 2011 +0200
@@ -11,7 +11,7 @@
<div class="menu">
<div class="logo">
<a href="{logourl}">
-<img src="{staticurl}hglogo.png" alt="mercurial" /></a>
+<img src="{staticurl}{logoimg}" alt="mercurial" /></a>
</div>
<ul>
<li><a href="{url}shortlog{sessionvars%urlparameter}">log</a></li>
--- a/mercurial/templates/paper/branches.tmpl Thu Jul 21 11:05:26 2011 +0200
+++ b/mercurial/templates/paper/branches.tmpl Thu Jul 21 15:10:16 2011 +0200
@@ -11,7 +11,7 @@
<div class="menu">
<div class="logo">
<a href="{logourl}">
-<img src="{staticurl}hglogo.png" alt="mercurial" /></a>
+<img src="{staticurl}{logoimg}" alt="mercurial" /></a>
</div>
<ul>
<li><a href="{url}shortlog{sessionvars%urlparameter}">log</a></li>
--- a/mercurial/templates/paper/changeset.tmpl Thu Jul 21 11:05:26 2011 +0200
+++ b/mercurial/templates/paper/changeset.tmpl Thu Jul 21 15:10:16 2011 +0200
@@ -6,7 +6,7 @@
<div class="menu">
<div class="logo">
<a href="{logourl}">
-<img src="{staticurl}hglogo.png" alt="mercurial" /></a>
+<img src="{staticurl}{logoimg}" alt="mercurial" /></a>
</div>
<ul>
<li><a href="{url}shortlog/{node|short}{sessionvars%urlparameter}">log</a></li>
--- a/mercurial/templates/paper/error.tmpl Thu Jul 21 11:05:26 2011 +0200
+++ b/mercurial/templates/paper/error.tmpl Thu Jul 21 15:10:16 2011 +0200
@@ -7,7 +7,7 @@
<div class="menu">
<div class="logo">
<a href="{logourl}">
-<img src="{staticurl}hglogo.png" width=75 height=90 border=0 alt="mercurial" /></a>
+<img src="{staticurl}{logoimg}" width=75 height=90 border=0 alt="mercurial" /></a>
</div>
<ul>
<li><a href="{url}shortlog{sessionvars%urlparameter}">log</a></li>
--- a/mercurial/templates/paper/fileannotate.tmpl Thu Jul 21 11:05:26 2011 +0200
+++ b/mercurial/templates/paper/fileannotate.tmpl Thu Jul 21 15:10:16 2011 +0200
@@ -7,7 +7,7 @@
<div class="menu">
<div class="logo">
<a href="{logourl}">
-<img src="{staticurl}hglogo.png" alt="mercurial" /></a>
+<img src="{staticurl}{logoimg}" alt="mercurial" /></a>
</div>
<ul>
<li><a href="{url}shortlog/{node|short}{sessionvars%urlparameter}">log</a></li>
--- a/mercurial/templates/paper/filediff.tmpl Thu Jul 21 11:05:26 2011 +0200
+++ b/mercurial/templates/paper/filediff.tmpl Thu Jul 21 15:10:16 2011 +0200
@@ -7,7 +7,7 @@
<div class="menu">
<div class="logo">
<a href="{logourl}">
-<img src="{staticurl}hglogo.png" alt="mercurial" /></a>
+<img src="{staticurl}{logoimg}" alt="mercurial" /></a>
</div>
<ul>
<li><a href="{url}shortlog/{node|short}{sessionvars%urlparameter}">log</a></li>
--- a/mercurial/templates/paper/filelog.tmpl Thu Jul 21 11:05:26 2011 +0200
+++ b/mercurial/templates/paper/filelog.tmpl Thu Jul 21 15:10:16 2011 +0200
@@ -11,7 +11,7 @@
<div class="menu">
<div class="logo">
<a href="{logourl}">
-<img src="{staticurl}hglogo.png" alt="mercurial" /></a>
+<img src="{staticurl}{logoimg}" alt="mercurial" /></a>
</div>
<ul>
<li><a href="{url}shortlog/{node|short}{sessionvars%urlparameter}">log</a></li>
--- a/mercurial/templates/paper/filerevision.tmpl Thu Jul 21 11:05:26 2011 +0200
+++ b/mercurial/templates/paper/filerevision.tmpl Thu Jul 21 15:10:16 2011 +0200
@@ -7,7 +7,7 @@
<div class="menu">
<div class="logo">
<a href="{logourl}">
-<img src="{staticurl}hglogo.png" alt="mercurial" /></a>
+<img src="{staticurl}{logoimg}" alt="mercurial" /></a>
</div>
<ul>
<li><a href="{url}shortlog/{node|short}{sessionvars%urlparameter}">log</a></li>
--- a/mercurial/templates/paper/graph.tmpl Thu Jul 21 11:05:26 2011 +0200
+++ b/mercurial/templates/paper/graph.tmpl Thu Jul 21 15:10:16 2011 +0200
@@ -12,7 +12,7 @@
<div class="menu">
<div class="logo">
<a href="{logourl}">
-<img src="{staticurl}hglogo.png" alt="mercurial" /></a>
+<img src="{staticurl}{logoimg}" alt="mercurial" /></a>
</div>
<ul>
<li><a href="{url}shortlog/{node|short}{sessionvars%urlparameter}">log</a></li>
--- a/mercurial/templates/paper/help.tmpl Thu Jul 21 11:05:26 2011 +0200
+++ b/mercurial/templates/paper/help.tmpl Thu Jul 21 15:10:16 2011 +0200
@@ -11,7 +11,7 @@
<div class="menu">
<div class="logo">
<a href="{logourl}">
-<img src="{staticurl}hglogo.png" alt="mercurial" /></a>
+<img src="{staticurl}{logoimg}" alt="mercurial" /></a>
</div>
<ul>
<li><a href="{url}shortlog{sessionvars%urlparameter}">log</a></li>
--- a/mercurial/templates/paper/helptopics.tmpl Thu Jul 21 11:05:26 2011 +0200
+++ b/mercurial/templates/paper/helptopics.tmpl Thu Jul 21 15:10:16 2011 +0200
@@ -11,7 +11,7 @@
<div class="menu">
<div class="logo">
<a href="{logourl}">
-<img src="{staticurl}hglogo.png" alt="mercurial" /></a>
+<img src="{staticurl}{logoimg}" alt="mercurial" /></a>
</div>
<ul>
<li><a href="{url}shortlog{sessionvars%urlparameter}">log</a></li>
--- a/mercurial/templates/paper/index.tmpl Thu Jul 21 11:05:26 2011 +0200
+++ b/mercurial/templates/paper/index.tmpl Thu Jul 21 15:10:16 2011 +0200
@@ -6,7 +6,7 @@
<div class="container">
<div class="menu">
<a href="{logourl}">
-<img src="{staticurl}hglogo.png" width=75 height=90 border=0 alt="mercurial" /></a>
+<img src="{staticurl}{logoimg}" width=75 height=90 border=0 alt="mercurial" /></a>
</div>
<div class="main">
<h2>Mercurial Repositories</h2>
--- a/mercurial/templates/paper/manifest.tmpl Thu Jul 21 11:05:26 2011 +0200
+++ b/mercurial/templates/paper/manifest.tmpl Thu Jul 21 15:10:16 2011 +0200
@@ -7,7 +7,7 @@
<div class="menu">
<div class="logo">
<a href="{logourl}">
-<img src="{staticurl}hglogo.png" alt="mercurial" /></a>
+<img src="{staticurl}{logoimg}" alt="mercurial" /></a>
</div>
<ul>
<li><a href="{url}shortlog/{node|short}{sessionvars%urlparameter}">log</a></li>
--- a/mercurial/templates/paper/search.tmpl Thu Jul 21 11:05:26 2011 +0200
+++ b/mercurial/templates/paper/search.tmpl Thu Jul 21 15:10:16 2011 +0200
@@ -7,7 +7,7 @@
<div class="menu">
<div class="logo">
<a href="{logourl}">
-<img src="{staticurl}hglogo.png" width=75 height=90 border=0 alt="mercurial"></a>
+<img src="{staticurl}{logoimg}" width=75 height=90 border=0 alt="mercurial"></a>
</div>
<ul>
<li><a href="{url}shortlog{sessionvars%urlparameter}">log</a></li>
--- a/mercurial/templates/paper/shortlog.tmpl Thu Jul 21 11:05:26 2011 +0200
+++ b/mercurial/templates/paper/shortlog.tmpl Thu Jul 21 15:10:16 2011 +0200
@@ -11,7 +11,7 @@
<div class="menu">
<div class="logo">
<a href="{logourl}">
-<img src="{staticurl}hglogo.png" alt="mercurial" /></a>
+<img src="{staticurl}{logoimg}" alt="mercurial" /></a>
</div>
<ul>
<li class="active">log</li>
--- a/mercurial/templates/paper/tags.tmpl Thu Jul 21 11:05:26 2011 +0200
+++ b/mercurial/templates/paper/tags.tmpl Thu Jul 21 15:10:16 2011 +0200
@@ -11,7 +11,7 @@
<div class="menu">
<div class="logo">
<a href="{logourl}">
-<img src="{staticurl}hglogo.png" alt="mercurial" /></a>
+<img src="{staticurl}{logoimg}" alt="mercurial" /></a>
</div>
<ul>
<li><a href="{url}shortlog{sessionvars%urlparameter}">log</a></li>
--- a/mercurial/templates/spartan/footer.tmpl Thu Jul 21 11:05:26 2011 +0200
+++ b/mercurial/templates/spartan/footer.tmpl Thu Jul 21 15:10:16 2011 +0200
@@ -2,7 +2,7 @@
{motd}
<div class="logo">
<a href="{logourl}">
-<img src="{staticurl}hglogo.png" width=75 height=90 border=0 alt="mercurial"></a>
+<img src="{staticurl}{logoimg}" width=75 height=90 border=0 alt="mercurial"></a>
</div>
</body>