##// END OF EJS Templates
hgwebdir: use web.prefix when creating url breadcrumbs (issue3790)...
Angel Ezquerra -
r18515:bf8bbbf4 stable
parent child Browse files
Show More
@@ -24,7 +24,7 b' perms = {'
24 'pushkey': 'push',
24 'pushkey': 'push',
25 }
25 }
26
26
27 def makebreadcrumb(url):
27 def makebreadcrumb(url, prefix=''):
28 '''Return a 'URL breadcrumb' list
28 '''Return a 'URL breadcrumb' list
29
29
30 A 'URL breadcrumb' is a list of URL-name pairs,
30 A 'URL breadcrumb' is a list of URL-name pairs,
@@ -33,6 +33,8 b' def makebreadcrumb(url):'
33 '''
33 '''
34 if url.endswith('/'):
34 if url.endswith('/'):
35 url = url[:-1]
35 url = url[:-1]
36 if prefix:
37 url = '/' + prefix + url
36 relpath = url
38 relpath = url
37 if relpath.startswith('/'):
39 if relpath.startswith('/'):
38 relpath = relpath[1:]
40 relpath = relpath[1:]
@@ -133,6 +133,12 b' class hgwebdir(object):'
133 if self.stripecount:
133 if self.stripecount:
134 self.stripecount = int(self.stripecount)
134 self.stripecount = int(self.stripecount)
135 self._baseurl = self.ui.config('web', 'baseurl')
135 self._baseurl = self.ui.config('web', 'baseurl')
136 prefix = self.ui.config('web', 'prefix', '')
137 if prefix.startswith('/'):
138 prefix = prefix[1:]
139 if prefix.endswith('/'):
140 prefix = prefix[:-1]
141 self.prefix = prefix
136 self.lastrefresh = time.time()
142 self.lastrefresh = time.time()
137
143
138 def run(self):
144 def run(self):
@@ -395,7 +401,7 b' class hgwebdir(object):'
395 self.updatereqenv(req.env)
401 self.updatereqenv(req.env)
396
402
397 return tmpl("index", entries=entries, subdir=subdir,
403 return tmpl("index", entries=entries, subdir=subdir,
398 pathdef=makebreadcrumb('/' + subdir),
404 pathdef=makebreadcrumb('/' + subdir, self.prefix),
399 sortcolumn=sortcolumn, descending=descending,
405 sortcolumn=sortcolumn, descending=descending,
400 **dict(sort))
406 **dict(sort))
401
407
General Comments 0
You need to be logged in to leave comments. Login now