##// END OF EJS Templates
hgweb: use registrar to declare "websub" template filter...
Yuya Nishihara -
r37238:307ee888 default
parent child Browse files
Show More
@@ -27,6 +27,7 b' from .. import ('
27 hook,
27 hook,
28 profiling,
28 profiling,
29 pycompat,
29 pycompat,
30 registrar,
30 repoview,
31 repoview,
31 templatefilters,
32 templatefilters,
32 templater,
33 templater,
@@ -170,6 +171,9 b' class requestcontext(object):'
170 or req.apppath
171 or req.apppath
171 or self.repo.root)
172 or self.repo.root)
172
173
174 filters = {}
175 templatefilter = registrar.templatefilter(filters)
176 @templatefilter('websub')
173 def websubfilter(text):
177 def websubfilter(text):
174 return templatefilters.websub(text, self.websubtable)
178 return templatefilters.websub(text, self.websubtable)
175
179
@@ -191,7 +195,7 b' class requestcontext(object):'
191 }
195 }
192 tres = formatter.templateresources(self.repo.ui, self.repo)
196 tres = formatter.templateresources(self.repo.ui, self.repo)
193 tmpl = templater.templater.frommapfile(mapfile,
197 tmpl = templater.templater.frommapfile(mapfile,
194 filters={'websub': websubfilter},
198 filters=filters,
195 defaults=defaults,
199 defaults=defaults,
196 resources=tres)
200 resources=tres)
197 return tmpl
201 return tmpl
General Comments 0
You need to be logged in to leave comments. Login now