##// 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 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
@@ -754,6 +764,7 b' class hgweb(object):'
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 })
@@ -16,6 +16,7 b''
16 <h2>changelog for #repo|escape#</h2>
16 <h2>changelog for #repo|escape#</h2>
17
17
18 <form action="#url#log">
18 <form action="#url#log">
19 {sessionvars%hiddenformentry}
19 <p>
20 <p>
20 <label for="search1">search:</label>
21 <label for="search1">search:</label>
21 <input name="rev" id="search1" type="text" size="30">
22 <input name="rev" id="search1" type="text" size="30">
@@ -26,6 +27,7 b' navigate: <small class="navigate">#chang'
26 #entries%changelogentry#
27 #entries%changelogentry#
27
28
28 <form action="#url#log">
29 <form action="#url#log">
30 {sessionvars%hiddenformentry}
29 <p>
31 <p>
30 <label for="search2">search:</label>
32 <label for="search2">search:</label>
31 <input name="rev" id="search2" type="text" size="30">
33 <input name="rev" id="search2" type="text" size="30">
@@ -10,8 +10,8 b''
10 </div>
10 </div>
11
11
12 <form action="{url}log">
12 <form action="{url}log">
13 {sessionvars%hiddenformentry}
13 <div class="search">
14 <div class="search">
14 <input type="hidden" name="style" value="gitweb" />
15 <input type="text" name="rev" />
15 <input type="text" name="rev" />
16 </div>
16 </div>
17 </form>
17 </form>
@@ -51,3 +51,4 b' filelogentry = \'<tr class="parity#parity'
51 archiveentry = ' | <a href="{url}archive/{node|short}{extension}">#type|escape#</a> '
51 archiveentry = ' | <a href="{url}archive/{node|short}{extension}">#type|escape#</a> '
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>'
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 index = index.tmpl
53 index = index.tmpl
54 hiddenformentry = '<input type="hidden" name="#name#" value="#value|escape#" />'
@@ -10,14 +10,15 b''
10 <h2>searching for #query|escape#</h2>
10 <h2>searching for #query|escape#</h2>
11
11
12 <form action="{url}log">
12 <form action="{url}log">
13 {sessionvars%hiddenformentry}
13 search:
14 search:
14 <input type="hidden" name="style" value="gitweb">
15 <input name="rev" type="text" width="30" value="#query|escape#">
15 <input name="rev" type="text" width="30" value="#query|escape#">
16 </form>
16 </form>
17
17
18 #entries#
18 #entries#
19
19
20 <form action="{url}log">
20 <form action="{url}log">
21 {sessionvars%hiddenformentry}
21 search:
22 search:
22 <input type="hidden" name="style" value="gitweb">
23 <input type="hidden" name="style" value="gitweb">
23 <input name="rev" type="text" width="30">
24 <input name="rev" type="text" width="30">
@@ -10,8 +10,8 b''
10 </div>
10 </div>
11
11
12 <form action="{url}log">
12 <form action="{url}log">
13 {sessionvars%hiddenformentry}
13 <div class="search">
14 <div class="search">
14 <input type="hidden" name="style" value="gitweb" />
15 <input type="text" name="rev" />
15 <input type="text" name="rev" />
16 </div>
16 </div>
17 </form>
17 </form>
@@ -51,3 +51,4 b' index = index.tmpl'
51 archiveentry = '<a href="#url#archive/#node|short##extension|urlescape#">#type|escape#</a> '
51 archiveentry = '<a href="#url#archive/#node|short##extension|urlescape#">#type|escape#</a> '
52 notfound = notfound.tmpl
52 notfound = notfound.tmpl
53 error = error.tmpl
53 error = error.tmpl
54 hiddenformentry = '<input type="hidden" name="#name#" value="#value|escape#" />'
@@ -13,6 +13,7 b''
13 <h2>searching for #query|escape#</h2>
13 <h2>searching for #query|escape#</h2>
14
14
15 <form>
15 <form>
16 {sessionvars%hiddenformentry}
16 <p>
17 <p>
17 search:
18 search:
18 <input name="rev" type="text" width="30" value="#query|escape#">
19 <input name="rev" type="text" width="30" value="#query|escape#">
@@ -22,6 +23,7 b' search:'
22 #entries#
23 #entries#
23
24
24 <form>
25 <form>
26 {sessionvars%hiddenformentry}
25 <p>
27 <p>
26 search:
28 search:
27 <input name="rev" type="text" width="30" value="#query|escape#">
29 <input name="rev" type="text" width="30" value="#query|escape#">
@@ -16,6 +16,7 b''
16 <h2>shortlog for #repo|escape#</h2>
16 <h2>shortlog for #repo|escape#</h2>
17
17
18 <form action="#url#log">
18 <form action="#url#log">
19 {sessionvars%hiddenformentry}
19 <p>
20 <p>
20 <label for="search1">search:</label>
21 <label for="search1">search:</label>
21 <input name="rev" id="search1" type="text" size="30">
22 <input name="rev" id="search1" type="text" size="30">
@@ -26,6 +27,7 b' navigate: <small class="navigate">#chang'
26 #entries%shortlogentry#
27 #entries%shortlogentry#
27
28
28 <form action="#url#log">
29 <form action="#url#log">
30 {sessionvars%hiddenformentry}
29 <p>
31 <p>
30 <label for="search2">search:</label>
32 <label for="search2">search:</label>
31 <input name="rev" id="search2" type="text" size="30">
33 <input name="rev" id="search2" type="text" size="30">
General Comments 0
You need to be logged in to leave comments. Login now