Mercurial > hg
comparison mercurial/hgweb/hgwebdir_mod.py @ 19906:1dba26575dba
hgweb: remove now unnecessary explicit header() and footer()
They became unnecessary after allowing custom-named entries in templates.
author | Alexander Plavin <alexander@plav.in> |
---|---|
date | Wed, 24 Jul 2013 03:20:26 +0400 |
parents | 7d31f2e42a8a |
children | 43cfad930d38 |
comparison
equal
deleted
inserted
replaced
19905:078ccd780b71 | 19906:1dba26575dba |
---|---|
406 sortcolumn=sortcolumn, descending=descending, | 406 sortcolumn=sortcolumn, descending=descending, |
407 **dict(sort)) | 407 **dict(sort)) |
408 | 408 |
409 def templater(self, req): | 409 def templater(self, req): |
410 | 410 |
411 def header(**map): | |
412 yield tmpl('header', encoding=encoding.encoding, **map) | |
413 | |
414 def footer(**map): | |
415 yield tmpl("footer", **map) | |
416 | |
417 def motd(**map): | 411 def motd(**map): |
418 if self.motd is not None: | 412 if self.motd is not None: |
419 yield self.motd | 413 yield self.motd |
420 else: | 414 else: |
421 yield config('web', 'motd', '') | 415 yield config('web', 'motd', '') |
446 staticurl = config('web', 'staticurl') or url + 'static/' | 440 staticurl = config('web', 'staticurl') or url + 'static/' |
447 if not staticurl.endswith('/'): | 441 if not staticurl.endswith('/'): |
448 staticurl += '/' | 442 staticurl += '/' |
449 | 443 |
450 tmpl = templater.templater(mapfile, | 444 tmpl = templater.templater(mapfile, |
451 defaults={"header": header, | 445 defaults={"encoding": encoding.encoding, |
452 "footer": footer, | |
453 "motd": motd, | 446 "motd": motd, |
454 "url": url, | 447 "url": url, |
455 "logourl": logourl, | 448 "logourl": logourl, |
456 "logoimg": logoimg, | 449 "logoimg": logoimg, |
457 "staticurl": staticurl, | 450 "staticurl": staticurl, |