1 |
<%args> |
2 |
$page => undef; |
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 |
$page ||= $filter->argument_value('page'); |
25 |
|
26 |
if ($author) { |
27 |
$revisions->limit( |
28 |
column => 'author', |
29 |
value => $author, |
30 |
); |
31 |
} else { |
32 |
$revisions->unlimit(); |
33 |
} |
34 |
$revisions->order_by({ column => 'commit_date', order => 'desc' }); |
35 |
$revisions->set_page_info( |
36 |
current_page => $page, |
37 |
per_page => 10, |
38 |
); |
39 |
$revisions->goto_first_item; |
40 |
|
41 |
|
42 |
my $actions = SVNBrowser::Model::ActionCollection->new(); |
43 |
|
44 |
</%init> |
45 |
|
46 |
<&| /_elements/wrapper, title => "SVN Reporitory Browser" &> |
47 |
|
48 |
<% Jifty->web->form->start %> |
49 |
<% $filter->form_field('author', default_value => $author ) %> |
50 |
<% $filter->button( label => 'Show just this commiter' ) %> |
51 |
<% $filter->form_field('show_actions', default_value => $show_actions ) %> |
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 |
<% $filter->button( |
87 |
label => "<<", |
88 |
escape_label => 0, |
89 |
arguments => { |
90 |
page => $revisions->pager->previous_page, |
91 |
} |
92 |
) %> |
93 |
% } |
94 |
|
95 |
% if ($revisions->pager->last_page > 1) { |
96 |
page <% $page %> of <% $revisions->pager->last_page %> |
97 |
% } |
98 |
|
99 |
% if ($revisions->pager->next_page) { |
100 |
<% $filter->button( |
101 |
label => ">>", |
102 |
escape_label => 0, |
103 |
arguments => { |
104 |
page => $revisions->pager->next_page, |
105 |
} |
106 |
) %> |
107 |
% } |
108 |
|
109 |
<% Jifty->web->form->end %> |
110 |
|
111 |
</&> |