Mercurial > public > mercurial-scm > hg-stable
diff mercurial/hgweb/hgwebdir_mod.py @ 3328:415905fad4fe
Add base URL to hgwebdir templater (fixes index page when the URL does not have a trailing /)
author | Brendan Cully <brendan@kublai.com> |
---|---|
date | Tue, 10 Oct 2006 10:54:22 -0700 |
parents | db9d2a624521 |
children | cf680c9ab1dd |
line wrap: on
line diff
--- a/mercurial/hgweb/hgwebdir_mod.py Tue Oct 10 10:28:20 2006 -0700 +++ b/mercurial/hgweb/hgwebdir_mod.py Tue Oct 10 10:54:22 2006 -0700 @@ -69,13 +69,18 @@ def footer(**map): yield tmpl("footer", motd=self.motd, **map) + url = req.env['REQUEST_URI'].split('?')[0] + if not url.endswith('/'): + url += '/' + style = self.style if req.form.has_key('style'): style = req.form['style'][0] mapfile = style_map(templater.templatepath(), style) tmpl = templater.templater(mapfile, templater.common_filters, defaults={"header": header, - "footer": footer}) + "footer": footer, + "url": url}) def archivelist(ui, nodeid, url): allowed = ui.configlist("web", "allow_archive")