diff --git a/trac/versioncontrol/web_ui/browser.py b/trac/versioncontrol/web_ui/browser.py
|
a
|
b
|
|
| 36 | 36 | from trac.util.translation import _ |
| 37 | 37 | from trac.web import IRequestHandler, RequestDone |
| 38 | 38 | from trac.web.chrome import add_ctxtnav, add_link, add_script, add_stylesheet, \ |
| 39 | | INavigationContributor |
| | 39 | prevnext_nav, INavigationContributor |
| 40 | 40 | from trac.wiki.api import IWikiSyntaxProvider |
| 41 | 41 | from trac.wiki.formatter import format_to_html, format_to_oneliner |
| 42 | 42 | from trac.versioncontrol.api import NoSuchChangeset, NoSuchNode |
| … |
… |
|
| 344 | 344 | context = Context.from_request(req, 'source', path, rev_or_latest) |
| 345 | 345 | |
| 346 | 346 | path_links = get_path_links(req.href, path, rev, order, desc) |
| 347 | | if len(path_links) > 1: |
| 348 | | add_link(req, 'up', path_links[-2]['href'], _('Parent directory')) |
| 349 | 347 | |
| 350 | 348 | data = { |
| 351 | 349 | 'context': context, |
| … |
… |
|
| 367 | 365 | return 'dir_entries.html', data, None |
| 368 | 366 | |
| 369 | 367 | # Links for contextual navigation |
| | 368 | if node.isfile: |
| | 369 | prev_rev = repos.previous_rev(rev=node.rev, |
| | 370 | path=node.created_path) |
| | 371 | if prev_rev: |
| | 372 | href = req.href.browser(node.created_path, rev=prev_rev) |
| | 373 | add_link(req, 'prev', href, |
| | 374 | _('Revision %(num)s', num=prev_rev)) |
| | 375 | if rev is not None: |
| | 376 | add_link(req, 'up', req.href.browser(node.created_path)) |
| | 377 | next_rev = repos.next_rev(rev=node.rev, |
| | 378 | path=node.created_path) |
| | 379 | if next_rev: |
| | 380 | href = req.href.browser(node.created_path, rev=next_rev) |
| | 381 | add_link(req, 'next', href, |
| | 382 | _('Revision %(num)s', num=next_rev)) |
| | 383 | prevnext_nav(req, _('Previous Revision'), _('Next Revision'), |
| | 384 | _('Latest Revision')) |
| | 385 | else: |
| | 386 | if len(path_links) > 1: |
| | 387 | add_link(req, 'up', path_links[-2]['href'], |
| | 388 | _('Parent directory')) |
| 370 | 389 | add_ctxtnav(req, tag.a(_('Last Change'), |
| 371 | 390 | href=req.href.changeset(node.rev, node.created_path))) |
| 372 | 391 | if node.isfile: |