# HG changeset patch # User Steven Stallion # Date 2011-04-20 03:37:06 # Node ID 616ad3f6fd33290dc8b06eab753b1d3604e9e5a1 # Parent 8b252e826c68089ca9bf173182d8c82d67ce87fc hgweb: support alternate logo url Clicking on the logo image/text in the hgweb interface brings the user to the Mercurial project page. The majority of users expect that this would bring them to the top level index. I have added a new template variable named `logourl' which allows an administrator to change this behavior. To stay compatible with existing behavior, `logourl' will default to http://mercurial.selenic.com/. This change is very useful in large installations where jumping to the index is common. diff --git a/doc/hgrc.5.txt b/doc/hgrc.5.txt --- a/doc/hgrc.5.txt +++ b/doc/hgrc.5.txt @@ -1092,6 +1092,9 @@ The full set of options is: Default is False. ``ipv6`` Whether to use IPv6. Default is False. +``logourl`` + Base URL to use for logos. If unset, ``http://mercurial.selenic.com/`` + will be used. ``name`` Repository name to use in the web interface. Default is current working directory. diff --git a/mercurial/hgweb/hgweb_mod.py b/mercurial/hgweb/hgweb_mod.py --- a/mercurial/hgweb/hgweb_mod.py +++ b/mercurial/hgweb/hgweb_mod.py @@ -233,6 +233,7 @@ class hgweb(object): port = req.env["SERVER_PORT"] 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/") staticurl = self.config("web", "staticurl") or req.url + 'static/' if not staticurl.endswith('/'): staticurl += '/' @@ -272,6 +273,7 @@ class hgweb(object): tmpl = templater.templater(mapfile, defaults={"url": req.url, + "logourl": logourl, "staticurl": staticurl, "urlbase": urlbase, "repo": self.reponame, diff --git a/mercurial/hgweb/hgwebdir_mod.py b/mercurial/hgweb/hgwebdir_mod.py --- a/mercurial/hgweb/hgwebdir_mod.py +++ b/mercurial/hgweb/hgwebdir_mod.py @@ -347,6 +347,7 @@ class hgwebdir(object): start = url[-1] == '?' and '&' or '?' sessionvars = webutil.sessionvars(vars, start) + logourl = config('web', 'logourl', 'http://mercurial.selenic.com/') staticurl = config('web', 'staticurl') or url + 'static/' if not staticurl.endswith('/'): staticurl += '/' @@ -356,6 +357,7 @@ class hgwebdir(object): "footer": footer, "motd": motd, "url": url, + "logourl": logourl, "staticurl": staticurl, "sessionvars": sessionvars}) return tmpl diff --git a/mercurial/templates/gitweb/bookmarks.tmpl b/mercurial/templates/gitweb/bookmarks.tmpl --- a/mercurial/templates/gitweb/bookmarks.tmpl +++ b/mercurial/templates/gitweb/bookmarks.tmpl @@ -8,7 +8,7 @@