##// END OF EJS Templates
hgweb: make navigation of changesets a bit nicer
mpm@selenic.com -
r173:8da1df93 default
parent child Browse files
Show More
@@ -199,22 +199,25 b' class hgweb:'
199 def changenav():
199 def changenav():
200 def seq(factor = 1):
200 def seq(factor = 1):
201 yield 1 * factor
201 yield 1 * factor
202 yield 2 * factor
202 yield 3 * factor
203 yield 5 * factor
203 #yield 5 * factor
204 for f in seq(factor * 10):
204 for f in seq(factor * 10):
205 yield f
205 yield f
206
207 linear = range(0, count - 2, self.maxchanges)[0:8]
208
209 for i in linear:
210 yield self.t("naventry", rev = max(i, 1))
211
206
212 for s in seq():
207 l = []
213 if s > count - 2: break
208 for f in seq():
214 if s > linear[-1]:
209 if f < self.maxchanges / 2: continue
215 yield self.t("naventry", rev = s)
210 if f > count: break
211 r = "%d" % f
212 if pos + f < count - (f/2): l.append(("+" + r, pos + f))
213 if pos - f >= 0 + (f/2): l.insert(0, ("-" + r, pos - f))
214
215 yield self.t("naventry", rev = 0, label="(0)")
216
216
217 yield self.t("naventry", rev = count - 1)
217 for label, rev in l:
218 yield self.t("naventry", label = label, rev = rev)
219
220 yield self.t("naventry", rev = count - 1, label="tip")
218
221
219 def changelist():
222 def changelist():
220 parity = (start - end) & 1
223 parity = (start - end) & 1
@@ -14,7 +14,7 b''
14 search:
14 search:
15 <input type="hidden" name="cmd" value="changelog">
15 <input type="hidden" name="cmd" value="changelog">
16 <input name="rev" type="text" width="30">
16 <input name="rev" type="text" width="30">
17 navigate: #changenav#<br/>
17 navigate: <small>#changenav#</small><br/>
18 </form>
18 </form>
19
19
20 #entries#
20 #entries#
@@ -23,7 +23,7 b' navigate: #changenav#<br/>'
23 search:
23 search:
24 <input type="hidden" name="cmd" value="changelog">
24 <input type="hidden" name="cmd" value="changelog">
25 <input name="rev" type="text" width="30">
25 <input name="rev" type="text" width="30">
26 navigate: #changenav#<br/>
26 navigate: <small>#changenav#</small><br/>
27 </form>
27 </form>
28
28
29 #footer#
29 #footer#
@@ -9,16 +9,13 b''
9 #parent1#
9 #parent1#
10 #parent2#
10 #parent2#
11 <tr>
11 <tr>
12 <td align="right">manifest:&nbsp;</td>
13 <td><a href="?cmd=manifest;manifest=#manifest#;path=/">#manifest#</a></td></tr>
14 <tr>
15 <td align="right">author:&nbsp;</td>
12 <td align="right">author:&nbsp;</td>
16 <td>#author#</td></tr>
13 <td>#author#</td></tr>
17 <tr>
14 <tr>
18 <td align="right">date:&nbsp;</td>
15 <td align="right">date:&nbsp;</td>
19 <td>#date#</td></tr>
16 <td>#date#</td></tr>
20 <tr>
17 <tr>
21 <td align="right" valign="top">files:&nbsp;</td>
18 <td align="right" valign="top"><a href="?cmd=manifest;manifest=#manifest#;path=/">files</a>:&nbsp;</td>
22 <td>#files#</td></tr>
19 <td>#files#</td></tr>
23 </table>
20 </table>
24 </div>
21 </div>
@@ -1,7 +1,7 b''
1 header = header.tmpl
1 header = header.tmpl
2 footer = footer.tmpl
2 footer = footer.tmpl
3 changelog = changelog.tmpl
3 changelog = changelog.tmpl
4 naventry = "<a href="?cmd=changelog;rev=#rev#">#rev#</a> "
4 naventry = "<a href="?cmd=changelog;rev=#rev#">#label#</a> "
5 filedifflink = "<a href="?cmd=filediff;node=#node#;file=#file#">#file#</a> "
5 filedifflink = "<a href="?cmd=filediff;node=#node#;file=#file#">#file#</a> "
6 filenodelink = "<a href="?cmd=file;filenode=#filenode#;file=#file#">#file#</a> "
6 filenodelink = "<a href="?cmd=file;filenode=#filenode#;file=#file#">#file#</a> "
7 fileellipses = "..."
7 fileellipses = "..."
General Comments 0
You need to be logged in to leave comments. Login now