Expose to revision.ezt a count of the total number of changed paths.
* lib/viewvc.py (view_revision): Add new 'num_changes' data dictionary item. * templates/revision.ezt Expose new 'num_changes' item as a header on this page, and tweak the way the more/first changes links appear. * docs/template-authoring-guide.html Document num_changes dictionary item. git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@2067 8cb11bc2-c004-0410-86c3-e597b4017df7remotes/issue-366-dev
parent
c733fceb9f
commit
1433941124
|
@ -2073,6 +2073,11 @@ td {
|
|||
<td>String</td>
|
||||
<td>URL for the current view but with <tt>limit_changes</tt> disabled.</td>
|
||||
</tr>
|
||||
<tr class="varlevel1">
|
||||
<td class="varname">num_changes</td>
|
||||
<td>String</td>
|
||||
<td>Number of paths changed in this revision.</td>
|
||||
</tr>
|
||||
<tr class="varlevel1">
|
||||
<td class="varname">next_href</td>
|
||||
<td>String</td>
|
||||
|
|
|
@ -3214,6 +3214,7 @@ def view_revision(request):
|
|||
more_changes_href = None
|
||||
first_changes = None
|
||||
first_changes_href = None
|
||||
num_changes = len(changes)
|
||||
if limit_changes and len(changes) > limit_changes:
|
||||
more_changes = len(changes) - limit_changes
|
||||
params = query_dict.copy()
|
||||
|
@ -3316,6 +3317,7 @@ def view_revision(request):
|
|||
'changes' : changes,
|
||||
'prev_href' : prev_rev_href,
|
||||
'next_href' : next_rev_href,
|
||||
'num_changes' : num_changes,
|
||||
'limit_changes': limit_changes,
|
||||
'more_changes': more_changes,
|
||||
'more_changes_href': more_changes_href,
|
||||
|
|
|
@ -28,6 +28,11 @@
|
|||
<td>[if-any date][date][else]<em>(unknown date)</em>[end]
|
||||
[if-any ago]<em>([ago] ago)</em>[end]</td>
|
||||
</tr>
|
||||
<tr align="left">
|
||||
<th>Changed paths:</th>
|
||||
<td><strong>[num_changes]</strong>
|
||||
[if-any more_changes](showing only [limit_changes]; <a href="[more_changes_href]">show all</a>)[end][if-any first_changes](<a href="[first_changes_href]">show only first [first_changes]</a>)[end]</td>
|
||||
</tr>
|
||||
<tr align="left">
|
||||
<th>Log Message:</th>
|
||||
<td><pre class="vc_log">[log]</pre></td>
|
||||
|
@ -39,17 +44,6 @@
|
|||
|
||||
<p><strong>Changed paths:</strong></p>
|
||||
|
||||
[if-any more_changes]
|
||||
<div>
|
||||
Only [limit_changes] changes shown,
|
||||
<a href="[more_changes_href]">display [more_changes] more changes...</a>
|
||||
</div>
|
||||
[end]
|
||||
|
||||
[if-any first_changes]
|
||||
<div><a href="[first_changes_href]">Show only first [first_changes] changes...</div>
|
||||
[end]
|
||||
|
||||
<table cellspacing="1" cellpadding="2">
|
||||
<thead>
|
||||
<tr align="left">
|
||||
|
@ -75,6 +69,11 @@
|
|||
<td colspan="5">No changed paths.</td>
|
||||
</tr>
|
||||
[end]
|
||||
[if-any more_changes]
|
||||
<tr>
|
||||
<td colspan="5">[[]<a href="[more_changes_href]">...</a>]</td>
|
||||
</tr>
|
||||
[end]
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
|
Loading…
Reference in New Issue