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