1 |
<%args> |
2 |
$page => 1 |
3 |
|
4 |
$author => undef; |
5 |
|
6 |
$show_actions => undef; |
7 |
|
8 |
</%args> |
9 |
|
10 |
<%init> |
11 |
my $filter = Jifty->web->new_action( |
12 |
class => 'Filter', |
13 |
moniker => 'filer_list', |
14 |
# arguments => { |
15 |
# author => $author, |
16 |
# show_actions => $show_actions, |
17 |
# }, |
18 |
); |
19 |
|
20 |
my $revisions = SVNBrowser::Model::RevisionCollection->new(); |
21 |
|
22 |
$author ||= $filter->argument_value('author'); |
23 |
$show_actions ||= $filter->argument_value('show_actions'); |
24 |
|
25 |
if ($author) { |
26 |
$revisions->limit( |
27 |
column => 'author', |
28 |
value => $author, |
29 |
); |
30 |
} else { |
31 |
$revisions->unlimit(); |
32 |
} |
33 |
$revisions->order_by({ column => 'commit_date', order => 'desc' }); |
34 |
$revisions->set_page_info( |
35 |
current_page => $page, |
36 |
per_page => $show_actions ? 5 : 20, |
37 |
); |
38 |
$revisions->goto_first_item; |
39 |
|
40 |
|
41 |
my $actions = SVNBrowser::Model::ActionCollection->new(); |
42 |
|
43 |
</%init> |
44 |
|
45 |
<&| /_elements/wrapper, title => "Statistics" &> |
46 |
|
47 |
<% Jifty->web->form->start %> |
48 |
<% $filter->form_field('author', default_value => $author ) %> |
49 |
<% $filter->button( label => 'Show just this commiter' ) %> |
50 |
<% $filter->form_field('show_actions', default_value => $show_actions ) %> |
51 |
<% Jifty->web->form->end %> |
52 |
|
53 |
<%perl> |
54 |
if (my $nr = $revisions->pager->total_entries) { |
55 |
$m->out("Found $nr revisions"); |
56 |
} else { |
57 |
$m->out("No revisions found.") |
58 |
} |
59 |
</%perl> |
60 |
|
61 |
<dl> |
62 |
% while (my $r = $revisions->next) { |
63 |
<dt><% Jifty->web->tangent( |
64 |
url => '/revision/' . $r->revision, |
65 |
label => $r->revision, |
66 |
) %> |
67 |
<span class="author"><% $r->author %></span> |
68 |
<span class="commit_date"><% $r->commit_date %></span> |
69 |
</dt> |
70 |
<dd> |
71 |
<pre class="commit_message"><% $r->message %></pre> |
72 |
% if ($show_actions) { |
73 |
<ul class="actions"> |
74 |
% $actions->limit( column => 'revision', value => $r->revision ); |
75 |
% while (my $a = $actions->next) { |
76 |
<li><tt class="action-<% $a->type %>"><% $a->type %> <% $a->branch %> <% $a->rel_path %></tt></li> |
77 |
% } |
78 |
</ul> |
79 |
% } |
80 |
|
81 |
</dd> |
82 |
% } |
83 |
</dl> |
84 |
|
85 |
% if ($revisions->pager->previous_page) { |
86 |
<% Jifty->web->link( |
87 |
label => "Previous", |
88 |
onclick => |
89 |
{ args => { |
90 |
page => $revisions->pager->previous_page, |
91 |
author => $author, |
92 |
show_actions => $show_actions, |
93 |
} } |
94 |
) %> |
95 |
% } |
96 |
|
97 |
% if ($revisions->pager->last_page > 1) { |
98 |
page <% $page %> of <% $revisions->pager->last_page %> |
99 |
% } |
100 |
|
101 |
% if ($revisions->pager->next_page) { |
102 |
<% Jifty->web->link( |
103 |
label => "Next", |
104 |
onclick => { args => { |
105 |
page => $revisions->pager->next_page, |
106 |
author => $author, |
107 |
show_actions => $show_actions, |
108 |
} } |
109 |
) %> |
110 |
% } |
111 |
|
112 |
</&> |
113 |
|