comparison mercurial/hgweb/hgwebdir_mod.py @ 13964:616ad3f6fd33

hgweb: support alternate logo url Clicking on the logo image/text in the hgweb interface brings the user to the Mercurial project page. The majority of users expect that this would bring them to the top level index. I have added a new template variable named `logourl' which allows an administrator to change this behavior. To stay compatible with existing behavior, `logourl' will default to http://mercurial.selenic.com/. This change is very useful in large installations where jumping to the index is common.
author Steven Stallion <sstallion@gmail.com>
date Tue, 19 Apr 2011 23:37:06 -0400
parents a35aff48d577
children 938fbeacac84
comparison
equal deleted inserted replaced
13962:8b252e826c68 13964:616ad3f6fd33
345 if style == styles[0]: 345 if style == styles[0]:
346 vars['style'] = style 346 vars['style'] = style
347 347
348 start = url[-1] == '?' and '&' or '?' 348 start = url[-1] == '?' and '&' or '?'
349 sessionvars = webutil.sessionvars(vars, start) 349 sessionvars = webutil.sessionvars(vars, start)
350 logourl = config('web', 'logourl', 'http://mercurial.selenic.com/')
350 staticurl = config('web', 'staticurl') or url + 'static/' 351 staticurl = config('web', 'staticurl') or url + 'static/'
351 if not staticurl.endswith('/'): 352 if not staticurl.endswith('/'):
352 staticurl += '/' 353 staticurl += '/'
353 354
354 tmpl = templater.templater(mapfile, 355 tmpl = templater.templater(mapfile,
355 defaults={"header": header, 356 defaults={"header": header,
356 "footer": footer, 357 "footer": footer,
357 "motd": motd, 358 "motd": motd,
358 "url": url, 359 "url": url,
360 "logourl": logourl,
359 "staticurl": staticurl, 361 "staticurl": staticurl,
360 "sessionvars": sessionvars}) 362 "sessionvars": sessionvars})
361 return tmpl 363 return tmpl
362 364
363 def updatereqenv(self, env): 365 def updatereqenv(self, env):