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