# HG changeset patch # User Alexis S. L. Carvalho # Date 1161564457 10800 # Node ID 8f02223662c83bf0f5dc45a101ed982e78876697 # Parent 46958e428fcdd83462a409aba90a4eb0d5e7308b hgweb: make #motd# available for all templates 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 @@ -629,9 +629,10 @@ class hgweb(object): yield '' def footer(**map): - yield self.t("footer", - motd=self.repo.ui.config("web", "motd", ""), - **map) + yield self.t("footer", **map) + + def motd(**map): + yield self.repo.ui.config("web", "motd", "") def expand_form(form): shortcuts = { @@ -762,6 +763,7 @@ class hgweb(object): "repo": self.reponame, "header": header, "footer": footer, + "motd": motd, "rawfileheader": rawfileheader, "sessionvars": sessionvars }) 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 @@ -69,6 +69,9 @@ class hgwebdir(object): def footer(**map): yield tmpl("footer", **map) + def motd(**map): + yield self.motd + url = req.env['REQUEST_URI'].split('?')[0] if not url.endswith('/'): url += '/' @@ -80,6 +83,7 @@ class hgwebdir(object): tmpl = templater.templater(mapfile, templater.common_filters, defaults={"header": header, "footer": footer, + "motd": motd, "url": url}) def archivelist(ui, nodeid, url): @@ -202,5 +206,4 @@ class hgwebdir(object): for column in sortable] req.write(tmpl("index", entries=entries, sortcolumn=sortcolumn, descending=descending, - motd=self.motd, **dict(sort)))