Finish issue #470 ("No links to repository root logs").
* lib/viewvc.py (view_roots): Generate a log_href -- the revision log for the root directory of the repository -- where it makes sense to do so. * templates/classic/roots.ezt, * templates/default/roots.ezt Markup the last-modified-revision as a link to the log view where we can. * docs/template-authoring-guide.html Note the additional data dictionary item. git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@2653 8cb11bc2-c004-0410-86c3-e597b4017df7remotes/issue-495-dev
parent
43f001ef25
commit
a69597e29c
|
@ -2352,6 +2352,12 @@ td {
|
|||
<td>String</td>
|
||||
<td>Log message of last modification to the root.</td>
|
||||
</tr>
|
||||
<tr class="varlevel2">
|
||||
<td class="varname">roots.log_href</td>
|
||||
<td>String</td>
|
||||
<td>URL of log revision view for the top-most (root) directory of
|
||||
the root (repository).</td>
|
||||
</tr>
|
||||
<tr class="varlevel2">
|
||||
<td class="varname">roots.name</td>
|
||||
<td>String</td>
|
||||
|
|
|
@ -1929,20 +1929,27 @@ def view_roots(request):
|
|||
rootnames = allroots.keys()
|
||||
rootnames.sort(icmp)
|
||||
for rootname in rootnames:
|
||||
root_path, root_type, lastmod = allroots[rootname]
|
||||
href = request.get_url(view_func=view_directory,
|
||||
where='', pathtype=vclib.DIR,
|
||||
params={'root': rootname}, escape=1)
|
||||
lastmod = allroots[rootname][2]
|
||||
if root_type == vclib.SVN:
|
||||
log_href = request.get_url(view_func=view_log,
|
||||
where='', pathtype=vclib.DIR,
|
||||
params={'root': rootname}, escape=1)
|
||||
else:
|
||||
log_href = None
|
||||
roots.append(_item(name=request.server.escape(rootname),
|
||||
type=allroots[rootname][1],
|
||||
path=allroots[rootname][0],
|
||||
type=root_type,
|
||||
path=root_path,
|
||||
author=lastmod and lastmod.author or None,
|
||||
ago=lastmod and lastmod.ago or None,
|
||||
date=lastmod and lastmod.date or None,
|
||||
log=lastmod and lastmod.log or None,
|
||||
short_log=lastmod and lastmod.short_log or None,
|
||||
rev=lastmod and lastmod.rev or None,
|
||||
href=href))
|
||||
href=href,
|
||||
log_href=log_href))
|
||||
|
||||
data = common_template_data(request)
|
||||
data.merge(ezt.TemplateData({
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
[roots.name]</a>
|
||||
</td>
|
||||
[is cfg.options.show_roots_lastmod "1"]
|
||||
<td style="width:20"> [roots.rev]</td>
|
||||
<td style="width:20"> [if-any roots.log_href]<a href="[roots.log_href]">[roots.rev]</a>[else][roots.rev][end]</td>
|
||||
<td style="width:20"> [roots.ago]</td>
|
||||
<td style="width:20"> [roots.author]</td>
|
||||
<td style="width:20"> [roots.short_log]</td>
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
<tr class="vc_row_[if-index roots even]even[else]odd[end]">
|
||||
<td onclick="jumpTo('[roots.href]')"><a href="[roots.href]"><img src="[docroot]/images/[roots.type]-logo.png" alt="" class="vc_icon" />[roots.name]</a></td>
|
||||
[is cfg.options.show_roots_lastmod "1"]
|
||||
<td>[if-any roots.rev]<strong>[roots.rev]</strong> ([roots.ago] ago)
|
||||
<td>[if-any roots.rev]<strong>[if-any roots.log_href]<a href="[roots.log_href]">[roots.rev]</a>[else][roots.rev][end]</strong> ([roots.ago] ago)
|
||||
by <em>[roots.author]</em>: [roots.log][end]</td>
|
||||
[end]
|
||||
</tr>
|
||||
|
|
Loading…
Reference in New Issue