mirror of
https://github.com/facebook/sapling.git
synced 2025-01-06 04:43:19 +03:00
hgweb: make navigation of changesets a bit nicer
This commit is contained in:
parent
1dd7e5c920
commit
d5d19174b2
@ -199,22 +199,25 @@ class hgweb:
|
||||
def changenav():
|
||||
def seq(factor = 1):
|
||||
yield 1 * factor
|
||||
yield 2 * factor
|
||||
yield 5 * factor
|
||||
yield 3 * factor
|
||||
#yield 5 * factor
|
||||
for f in seq(factor * 10):
|
||||
yield f
|
||||
|
||||
linear = range(0, count - 2, self.maxchanges)[0:8]
|
||||
|
||||
for i in linear:
|
||||
yield self.t("naventry", rev = max(i, 1))
|
||||
l = []
|
||||
for f in seq():
|
||||
if f < self.maxchanges / 2: continue
|
||||
if f > count: break
|
||||
r = "%d" % f
|
||||
if pos + f < count - (f/2): l.append(("+" + r, pos + f))
|
||||
if pos - f >= 0 + (f/2): l.insert(0, ("-" + r, pos - f))
|
||||
|
||||
for s in seq():
|
||||
if s > count - 2: break
|
||||
if s > linear[-1]:
|
||||
yield self.t("naventry", rev = s)
|
||||
yield self.t("naventry", rev = 0, label="(0)")
|
||||
|
||||
yield self.t("naventry", rev = count - 1)
|
||||
for label, rev in l:
|
||||
yield self.t("naventry", label = label, rev = rev)
|
||||
|
||||
yield self.t("naventry", rev = count - 1, label="tip")
|
||||
|
||||
def changelist():
|
||||
parity = (start - end) & 1
|
||||
|
@ -14,7 +14,7 @@
|
||||
search:
|
||||
<input type="hidden" name="cmd" value="changelog">
|
||||
<input name="rev" type="text" width="30">
|
||||
navigate: #changenav#<br/>
|
||||
navigate: <small>#changenav#</small><br/>
|
||||
</form>
|
||||
|
||||
#entries#
|
||||
@ -23,7 +23,7 @@ navigate: #changenav#<br/>
|
||||
search:
|
||||
<input type="hidden" name="cmd" value="changelog">
|
||||
<input name="rev" type="text" width="30">
|
||||
navigate: #changenav#<br/>
|
||||
navigate: <small>#changenav#</small><br/>
|
||||
</form>
|
||||
|
||||
#footer#
|
||||
|
@ -8,9 +8,6 @@
|
||||
<td><a href="?cmd=changeset;node=#node#">#node#</a></td></tr>
|
||||
#parent1#
|
||||
#parent2#
|
||||
<tr>
|
||||
<td align="right">manifest: </td>
|
||||
<td><a href="?cmd=manifest;manifest=#manifest#;path=/">#manifest#</a></td></tr>
|
||||
<tr>
|
||||
<td align="right">author: </td>
|
||||
<td>#author#</td></tr>
|
||||
@ -18,7 +15,7 @@
|
||||
<td align="right">date: </td>
|
||||
<td>#date#</td></tr>
|
||||
<tr>
|
||||
<td align="right" valign="top">files: </td>
|
||||
<td align="right" valign="top"><a href="?cmd=manifest;manifest=#manifest#;path=/">files</a>: </td>
|
||||
<td>#files#</td></tr>
|
||||
</table>
|
||||
</div>
|
||||
|
@ -1,7 +1,7 @@
|
||||
header = header.tmpl
|
||||
footer = footer.tmpl
|
||||
changelog = changelog.tmpl
|
||||
naventry = "<a href="?cmd=changelog;rev=#rev#">#rev#</a> "
|
||||
naventry = "<a href="?cmd=changelog;rev=#rev#">#label#</a> "
|
||||
filedifflink = "<a href="?cmd=filediff;node=#node#;file=#file#">#file#</a> "
|
||||
filenodelink = "<a href="?cmd=file;filenode=#filenode#;file=#file#">#file#</a> "
|
||||
fileellipses = "..."
|
||||
|
Loading…
Reference in New Issue
Block a user