hgweb: make #motd# available for all templates
authorAlexis S. L. Carvalho <alexis@cecm.usp.br>
Sun, 22 Oct 2006 21:47:37 -0300
changeset 3488 8f02223662c8
parent 3487 46958e428fcd
child 3489 c3345b0f2fcd
hgweb: make #motd# available for all templates
mercurial/hgweb/hgweb_mod.py
mercurial/hgweb/hgwebdir_mod.py
--- a/mercurial/hgweb/hgweb_mod.py	Sat Oct 21 23:51:36 2006 -0700
+++ b/mercurial/hgweb/hgweb_mod.py	Sun Oct 22 21:47:37 2006 -0300
@@ -629,9 +629,10 @@
             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 @@
                                                "repo": self.reponame,
                                                "header": header,
                                                "footer": footer,
+                                               "motd": motd,
                                                "rawfileheader": rawfileheader,
                                                "sessionvars": sessionvars
                                                })
--- a/mercurial/hgweb/hgwebdir_mod.py	Sat Oct 21 23:51:36 2006 -0700
+++ b/mercurial/hgweb/hgwebdir_mod.py	Sun Oct 22 21:47:37 2006 -0300
@@ -69,6 +69,9 @@
         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 @@
         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 @@
                         for column in sortable]
                 req.write(tmpl("index", entries=entries,
                                sortcolumn=sortcolumn, descending=descending,
-                               motd=self.motd,
                                **dict(sort)))