3 |
$author => undef; |
$author => undef; |
4 |
$show_actions => undef; |
$show_actions => undef; |
5 |
$per_page => undef; |
$per_page => undef; |
6 |
|
$from_date => undef; |
7 |
|
$to_date => undef; |
8 |
|
$search => undef; |
9 |
</%args> |
</%args> |
10 |
|
|
11 |
<%init> |
<%init> |
24 |
$show_actions ||= $filter->argument_value('show_actions'); |
$show_actions ||= $filter->argument_value('show_actions'); |
25 |
$page ||= $filter->argument_value('page') || 1; |
$page ||= $filter->argument_value('page') || 1; |
26 |
$per_page ||= $filter->argument_value('per_page') || 10; |
$per_page ||= $filter->argument_value('per_page') || 10; |
27 |
|
$from_date ||= $filter->argument_value('from_date'); |
28 |
|
$to_date ||= $filter->argument_value('to_date'); |
29 |
|
$search ||= $filter->argument_value('search'); |
30 |
|
|
31 |
|
$revisions->unlimit(); |
32 |
|
|
33 |
|
$revisions->limit( column => 'author', value => $author, entry_aggregator => 'AND' ) if ($author); |
34 |
|
$revisions->limit( column => 'commit_date', operator => '>=', value => $from_date, entry_aggregator => 'AND' ) if ($from_date); |
35 |
|
$revisions->limit( column => 'commit_date', operator => '<=', value => $to_date, entry_aggregator => 'AND' ) if ($to_date); |
36 |
|
|
37 |
|
$revisions->limit( column => 'message', operator => 'LIKE', value => '%' . $search . '%' ) if ($search); |
38 |
|
|
|
if ($author) { |
|
|
$revisions->limit( |
|
|
column => 'author', |
|
|
value => $author, |
|
|
); |
|
|
} else { |
|
|
$revisions->unlimit(); |
|
|
} |
|
39 |
$revisions->order_by({ column => 'commit_date', order => 'desc' }); |
$revisions->order_by({ column => 'commit_date', order => 'desc' }); |
40 |
$revisions->set_page_info( |
$revisions->set_page_info( |
41 |
current_page => $page, |
current_page => $page, |
42 |
per_page => $per_page, |
per_page => $per_page, |
43 |
); |
); |
44 |
|
|
45 |
|
warn $revisions->build_select_query; |
46 |
|
|
47 |
$revisions->goto_first_item; |
$revisions->goto_first_item; |
48 |
|
|
49 |
|
|
58 |
<% $filter->button( label => 'Filter commits' ) %> |
<% $filter->button( label => 'Filter commits' ) %> |
59 |
<% $filter->form_field('show_actions', default_value => $show_actions ) %> |
<% $filter->form_field('show_actions', default_value => $show_actions ) %> |
60 |
<% $filter->form_field('per_page', default_value => $per_page ) %> |
<% $filter->form_field('per_page', default_value => $per_page ) %> |
61 |
|
<% $filter->form_field('from_date', default_value => $from_date ) %> |
62 |
|
<% $filter->form_field('to_date', default_value => $to_date ) %> |
63 |
|
<% $filter->form_field('search', default_value => $search ) %> |
64 |
|
|
65 |
<%perl> |
<%perl> |
66 |
if (my $nr = $revisions->pager->total_entries) { |
if (my $nr = $revisions->pager->total_entries) { |
73 |
<dl> |
<dl> |
74 |
% while (my $r = $revisions->next) { |
% while (my $r = $revisions->next) { |
75 |
<dt><% Jifty->web->tangent( |
<dt><% Jifty->web->tangent( |
76 |
url => '/revision/' . $r->revision, |
url => '/rev/' . $r->revision, |
77 |
label => $r->revision, |
label => $r->revision, |
78 |
) %> |
) %> |
79 |
<span class="author"><% $r->author %></span> |
<span class="author"><% $r->author %></span> |
83 |
<pre class="commit_message"><% $r->message %></pre> |
<pre class="commit_message"><% $r->message %></pre> |
84 |
% if ($show_actions) { |
% if ($show_actions) { |
85 |
<ul class="actions"> |
<ul class="actions"> |
86 |
|
% $actions->unlimit; |
87 |
% $actions->limit( column => 'revision', value => $r->revision ); |
% $actions->limit( column => 'revision', value => $r->revision ); |
88 |
% while (my $a = $actions->next) { |
% while (my $a = $actions->next) { |
89 |
<li><tt class="action-<% $a->type %>"><% $a->type %> <% $a->branch %> <% $a->rel_path %></tt></li> |
% my $full_path = $a->branch . $a->rel_path ; |
90 |
|
<li><tt class="action-<% $a->type %>"><% $a->type %> <% $full_path %> |
91 |
|
<% Jifty->web->tangent( url => '/rev/' . $r->revision . $full_path, label => 'diff' ) %> |
92 |
|
</tt></li> |
93 |
% } |
% } |
94 |
</ul> |
</ul> |
95 |
% } |
% } |