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