# HG changeset patch # User Steven Stallion # Date 1303270626 14400 # 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 -r 8b252e826c68 -r 616ad3f6fd33 doc/hgrc.5.txt --- a/doc/hgrc.5.txt Tue Apr 19 12:42:53 2011 +0200 +++ b/doc/hgrc.5.txt Tue Apr 19 23:37:06 2011 -0400 @@ -1092,6 +1092,9 @@ 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 -r 8b252e826c68 -r 616ad3f6fd33 mercurial/hgweb/hgweb_mod.py --- a/mercurial/hgweb/hgweb_mod.py Tue Apr 19 12:42:53 2011 +0200 +++ b/mercurial/hgweb/hgweb_mod.py Tue Apr 19 23:37:06 2011 -0400 @@ -233,6 +233,7 @@ 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 @@ tmpl = templater.templater(mapfile, defaults={"url": req.url, + "logourl": logourl, "staticurl": staticurl, "urlbase": urlbase, "repo": self.reponame, diff -r 8b252e826c68 -r 616ad3f6fd33 mercurial/hgweb/hgwebdir_mod.py --- a/mercurial/hgweb/hgwebdir_mod.py Tue Apr 19 12:42:53 2011 +0200 +++ b/mercurial/hgweb/hgwebdir_mod.py Tue Apr 19 23:37:06 2011 -0400 @@ -347,6 +347,7 @@ 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 @@ "footer": footer, "motd": motd, "url": url, + "logourl": logourl, "staticurl": staticurl, "sessionvars": sessionvars}) return tmpl diff -r 8b252e826c68 -r 616ad3f6fd33 mercurial/templates/gitweb/bookmarks.tmpl --- a/mercurial/templates/gitweb/bookmarks.tmpl Tue Apr 19 12:42:53 2011 +0200 +++ b/mercurial/templates/gitweb/bookmarks.tmpl Tue Apr 19 23:37:06 2011 -0400 @@ -8,7 +8,7 @@