##// END OF EJS Templates
hgweb: Keep session variables (currently only style) in HTML forms, too....
Thomas Arendsen Hein -
r3362:887da224 default
parent child Browse files
Show More
@@ -708,6 +708,16 b' class hgweb(object):'
708 708 req.form['node'] = [fn[:-len(ext)]]
709 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 721 def queryprefix(**map):
712 722 return req.url[-1] == '?' and ';' or '?'
713 723
@@ -754,6 +764,7 b' class hgweb(object):'
754 764 "header": header,
755 765 "footer": footer,
756 766 "rawfileheader": rawfileheader,
767 "sessionvars": sessionvars,
757 768 "queryprefix": queryprefix,
758 769 "getentries": getentries
759 770 })
@@ -16,6 +16,7 b''
16 16 <h2>changelog for #repo|escape#</h2>
17 17
18 18 <form action="#url#log">
19 {sessionvars%hiddenformentry}
19 20 <p>
20 21 <label for="search1">search:</label>
21 22 <input name="rev" id="search1" type="text" size="30">
@@ -26,6 +27,7 b' navigate: <small class="navigate">#chang'
26 27 #entries%changelogentry#
27 28
28 29 <form action="#url#log">
30 {sessionvars%hiddenformentry}
29 31 <p>
30 32 <label for="search2">search:</label>
31 33 <input name="rev" id="search2" type="text" size="30">
@@ -10,8 +10,8 b''
10 10 </div>
11 11
12 12 <form action="{url}log">
13 {sessionvars%hiddenformentry}
13 14 <div class="search">
14 <input type="hidden" name="style" value="gitweb" />
15 15 <input type="text" name="rev" />
16 16 </div>
17 17 </form>
@@ -51,3 +51,4 b' filelogentry = \'<tr class="parity#parity'
51 51 archiveentry = ' | <a href="{url}archive/{node|short}{extension}">#type|escape#</a> '
52 52 indexentry = '<tr class="parity#parity#"><td><a class="list" href="#url#"><b>#name|escape#</b></a></td><td>#description#</td><td>#contact|obfuscate#</td><td class="age">#lastchange|age# ago</td><td class="indexlinks"><a class="rss_logo" href="#url#rss-log">RSS</a> #archives%archiveentry#</td></tr>'
53 53 index = index.tmpl
54 hiddenformentry = '<input type="hidden" name="#name#" value="#value|escape#" />'
@@ -10,14 +10,15 b''
10 10 <h2>searching for #query|escape#</h2>
11 11
12 12 <form action="{url}log">
13 {sessionvars%hiddenformentry}
13 14 search:
14 <input type="hidden" name="style" value="gitweb">
15 15 <input name="rev" type="text" width="30" value="#query|escape#">
16 16 </form>
17 17
18 18 #entries#
19 19
20 20 <form action="{url}log">
21 {sessionvars%hiddenformentry}
21 22 search:
22 23 <input type="hidden" name="style" value="gitweb">
23 24 <input name="rev" type="text" width="30">
@@ -10,8 +10,8 b''
10 10 </div>
11 11
12 12 <form action="{url}log">
13 {sessionvars%hiddenformentry}
13 14 <div class="search">
14 <input type="hidden" name="style" value="gitweb" />
15 15 <input type="text" name="rev" />
16 16 </div>
17 17 </form>
@@ -51,3 +51,4 b' index = index.tmpl'
51 51 archiveentry = '<a href="#url#archive/#node|short##extension|urlescape#">#type|escape#</a> '
52 52 notfound = notfound.tmpl
53 53 error = error.tmpl
54 hiddenformentry = '<input type="hidden" name="#name#" value="#value|escape#" />'
@@ -13,6 +13,7 b''
13 13 <h2>searching for #query|escape#</h2>
14 14
15 15 <form>
16 {sessionvars%hiddenformentry}
16 17 <p>
17 18 search:
18 19 <input name="rev" type="text" width="30" value="#query|escape#">
@@ -22,6 +23,7 b' search:'
22 23 #entries#
23 24
24 25 <form>
26 {sessionvars%hiddenformentry}
25 27 <p>
26 28 search:
27 29 <input name="rev" type="text" width="30" value="#query|escape#">
@@ -16,6 +16,7 b''
16 16 <h2>shortlog for #repo|escape#</h2>
17 17
18 18 <form action="#url#log">
19 {sessionvars%hiddenformentry}
19 20 <p>
20 21 <label for="search1">search:</label>
21 22 <input name="rev" id="search1" type="text" size="30">
@@ -26,6 +27,7 b' navigate: <small class="navigate">#chang'
26 27 #entries%shortlogentry#
27 28
28 29 <form action="#url#log">
30 {sessionvars%hiddenformentry}
29 31 <p>
30 32 <label for="search2">search:</label>
31 33 <input name="rev" id="search2" type="text" size="30">
General Comments 0
You need to be logged in to leave comments. Login now