* lib/viewcvs.py

(view_log): Always expose the view_href and download_href.

* templates/log.ezt
* templates/log_table.ezt
  Lose the "if CVS" condition I added for some includes a while ago.

* templates/include/branch.ezt
  Always show bookmarkable links to HEAD/download.


git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@961 8cb11bc2-c004-0410-86c3-e597b4017df7
remotes/tags/1.0.0-rc1
cmpilato 2004-10-19 14:46:35 +00:00
parent 6fbdc57c44
commit 0540dd9c0a
4 changed files with 28 additions and 40 deletions

View File

@ -1870,9 +1870,24 @@ def view_log(request):
data['graph_href'] = request.get_url(view_func=view_cvsgraph, params={},
escape=1)
taginfo = options.get('cvs_tags', {})
main = taginfo.get('MAIN')
data['view_href'] = request.get_url(view_func=view_markup, params={},
escape=1)
data['download_href'] = request.get_url(view_func=view_checkout, params={},
escape=1)
if not is_plain_text(request.mime_type):
data['download_text_href'] = \
request.get_url(view_func=view_checkout,
params={'content-type': 'text/plain'},
escape=1)
else:
data['download_text_href'] = None
taginfo = options.get('cvs_tags', {})
tagitems = taginfo.items()
tagitems.sort()
tagitems.reverse()
main = taginfo.get('MAIN')
if main:
# Default branch may have multiple names so we list them
branches = []
@ -1880,26 +1895,9 @@ def view_log(request):
# Don't list MAIN unless there are no other names
if branch is not main or len(main.aliases) == 1:
branches.append(branch.name)
### this formatting should be moved into the ezt template
data['branch'] = string.join(branches, ', ')
data['view_href'] = request.get_url(view_func=view_markup, params={},
escape=1)
data['download_href'] = request.get_url(view_func=view_checkout, params={},
escape=1)
if not is_plain_text(request.mime_type):
data['download_text_href'] = \
request.get_url(view_func=view_checkout,
params={'content-type': 'text/plain'},
escape=1)
else:
data['download_text_href'] = None
tagitems = taginfo.items()
tagitems.sort()
tagitems.reverse()
data['tags'] = tags = [ ]
for tag, rev in tagitems:
if rev.co_rev:

View File

@ -1,12 +1,8 @@
[if-any branch]
Default branch: [branch]
<br>
Bookmark a link to HEAD:
(<a href="[view_href]">view</a>)
(<a href="[download_href]">download</a>)
[if-any download_text_href](<a href="[download_text_href]">as text</a>)[end]
[else]
No default branch
[end]
<br>
<p>[if-any branch]Default branch: [branch][else]No default branch[end]<br>
Bookmark a link to HEAD:
(<a href="[view_href]">view</a>)
(<a href="[download_href]">download</a>)
[if-any download_text_href](<a href="[download_text_href]">as text</a>)[end]
</p>

View File

@ -8,11 +8,8 @@
<hr noshade>
[is roottype "cvs"]
[include "include/branch.ezt"]
[include "include/view_tag.ezt"]
[end]
[include "include/branch.ezt"]
[include "include/view_tag.ezt"]
[include "include/paging.ezt"]
[for entries]

View File

@ -8,11 +8,8 @@
<hr noshade>
[is roottype "cvs"]
[include "include/branch.ezt"]
[include "include/view_tag.ezt"]
[end]
[include "include/branch.ezt"]
[include "include/view_tag.ezt"]
[include "include/paging.ezt"]
<hr noshade>