diff mercurial/hgweb/hgwebdir_mod.py @ 3483:8f02223662c8

hgweb: make #motd# available for all templates
author Alexis S. L. Carvalho <alexis@cecm.usp.br>
date Sun, 22 Oct 2006 21:47:37 -0300
parents bbfb392b2b1a
children c3043ebe40a0
line wrap: on
line diff
--- 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)))