mercurial/hgweb/hgwebdir_mod.py
changeset 5915 d0576d065993
parent 5779 e9f68860d5ed
child 5928 3340aa5a64f7
equal deleted inserted replaced
5914:8e7796a990c5 5915:d0576d065993
   141                            "node": nodeid, "url": url}
   141                            "node": nodeid, "url": url}
   142 
   142 
   143         def entries(sortcolumn="", descending=False, subdir="", **map):
   143         def entries(sortcolumn="", descending=False, subdir="", **map):
   144             def sessionvars(**map):
   144             def sessionvars(**map):
   145                 fields = []
   145                 fields = []
   146                 if req.form.has_key('style'):
   146                 if 'style' in req.form:
   147                     style = req.form['style'][0]
   147                     style = req.form['style'][0]
   148                     if style != get('web', 'style', ''):
   148                     if style != get('web', 'style', ''):
   149                         fields.append(('style', style))
   149                         fields.append(('style', style))
   150 
   150 
   151                 separator = url[-1] == '?' and ';' or '?'
   151                 separator = url[-1] == '?' and ';' or '?'
   212                     row['parity'] = parity.next()
   212                     row['parity'] = parity.next()
   213                     yield row
   213                     yield row
   214 
   214 
   215         sortable = ["name", "description", "contact", "lastchange"]
   215         sortable = ["name", "description", "contact", "lastchange"]
   216         sortcolumn, descending = self.repos_sorted
   216         sortcolumn, descending = self.repos_sorted
   217         if req.form.has_key('sort'):
   217         if 'sort' in req.form:
   218             sortcolumn = req.form['sort'][0]
   218             sortcolumn = req.form['sort'][0]
   219             descending = sortcolumn.startswith('-')
   219             descending = sortcolumn.startswith('-')
   220             if descending:
   220             if descending:
   221                 sortcolumn = sortcolumn[1:]
   221                 sortcolumn = sortcolumn[1:]
   222             if sortcolumn not in sortable:
   222             if sortcolumn not in sortable:
   260             staticurl += '/'
   260             staticurl += '/'
   261 
   261 
   262         style = self.style
   262         style = self.style
   263         if style is None:
   263         if style is None:
   264             style = config('web', 'style', '')
   264             style = config('web', 'style', '')
   265         if req.form.has_key('style'):
   265         if 'style' in req.form:
   266             style = req.form['style'][0]
   266             style = req.form['style'][0]
   267         if self.stripecount is None:
   267         if self.stripecount is None:
   268             self.stripecount = int(config('web', 'stripes', 1))
   268             self.stripecount = int(config('web', 'stripes', 1))
   269         mapfile = style_map(templater.templatepath(), style)
   269         mapfile = style_map(templater.templatepath(), style)
   270         tmpl = templater.templater(mapfile, templater.common_filters,
   270         tmpl = templater.templater(mapfile, templater.common_filters,