mercurial/hgweb/hgwebdir_mod.py
changeset 9842 d3dbdca92458
parent 9724 40ef3bf3e04a
child 9903 5d748045c2ae
equal deleted inserted replaced
9841:7cd6dee6fe37 9842:d3dbdca92458
   313         url = req.env.get('SCRIPT_NAME', '')
   313         url = req.env.get('SCRIPT_NAME', '')
   314         if not url.endswith('/'):
   314         if not url.endswith('/'):
   315             url += '/'
   315             url += '/'
   316 
   316 
   317         vars = {}
   317         vars = {}
   318         style = self.style
   318         styles = (
   319         if 'style' in req.form:
   319             req.form.get('style', [None])[0],
   320             vars['style'] = style = req.form['style'][0]
   320             config('web', 'style'),
       
   321             'paper'
       
   322         )
       
   323         style, mapfile = templater.stylemap(styles)
       
   324         if style == styles[0]:
       
   325             vars['style'] = style
       
   326         
   321         start = url[-1] == '?' and '&' or '?'
   327         start = url[-1] == '?' and '&' or '?'
   322         sessionvars = webutil.sessionvars(vars, start)
   328         sessionvars = webutil.sessionvars(vars, start)
   323 
       
   324         staticurl = config('web', 'staticurl') or url + 'static/'
   329         staticurl = config('web', 'staticurl') or url + 'static/'
   325         if not staticurl.endswith('/'):
   330         if not staticurl.endswith('/'):
   326             staticurl += '/'
   331             staticurl += '/'
   327 
   332 
   328         style = 'style' in req.form and req.form['style'][0] or self.style
       
   329         mapfile = templater.stylemap(style)
       
   330         tmpl = templater.templater(mapfile,
   333         tmpl = templater.templater(mapfile,
   331                                    defaults={"header": header,
   334                                    defaults={"header": header,
   332                                              "footer": footer,
   335                                              "footer": footer,
   333                                              "motd": motd,
   336                                              "motd": motd,
   334                                              "url": url,
   337                                              "url": url,