Mercurial > hg
comparison mercurial/hgweb/hgweb_mod.py @ 3362:887da2247b57
hgweb: Keep session variables (currently only style) in HTML forms, too.
Adjusted default and gitweb template for this.
author | Thomas Arendsen Hein <thomas@intevation.de> |
---|---|
date | Wed, 11 Oct 2006 20:59:37 +0200 |
parents | 41741218504d |
children | ce8f31e0b3b8 |
comparison
equal
deleted
inserted
replaced
3361:bc5985d53386 | 3362:887da2247b57 |
---|---|
706 ext = spec[2] | 706 ext = spec[2] |
707 if fn.endswith(ext): | 707 if fn.endswith(ext): |
708 req.form['node'] = [fn[:-len(ext)]] | 708 req.form['node'] = [fn[:-len(ext)]] |
709 req.form['type'] = [type_] | 709 req.form['type'] = [type_] |
710 | 710 |
711 def sessionvars(**map): | |
712 fields = [] | |
713 if req.form.has_key('style'): | |
714 style = req.form['style'][0] | |
715 if style != self.repo.ui.config('web', 'style', ''): | |
716 fields.append(('style', style)) | |
717 | |
718 for name, value in fields: | |
719 yield dict(name=name, value=value) | |
720 | |
711 def queryprefix(**map): | 721 def queryprefix(**map): |
712 return req.url[-1] == '?' and ';' or '?' | 722 return req.url[-1] == '?' and ';' or '?' |
713 | 723 |
714 def getentries(**map): | 724 def getentries(**map): |
715 fields = {} | 725 fields = {} |
752 defaults={"url": req.url, | 762 defaults={"url": req.url, |
753 "repo": self.reponame, | 763 "repo": self.reponame, |
754 "header": header, | 764 "header": header, |
755 "footer": footer, | 765 "footer": footer, |
756 "rawfileheader": rawfileheader, | 766 "rawfileheader": rawfileheader, |
767 "sessionvars": sessionvars, | |
757 "queryprefix": queryprefix, | 768 "queryprefix": queryprefix, |
758 "getentries": getentries | 769 "getentries": getentries |
759 }) | 770 }) |
760 | 771 |
761 if not req.form.has_key('cmd'): | 772 if not req.form.has_key('cmd'): |