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 |
|
$branch => undef; |
10 |
</%args> |
</%args> |
11 |
|
|
12 |
<%init> |
<%init> |
25 |
$show_actions ||= $filter->argument_value('show_actions'); |
$show_actions ||= $filter->argument_value('show_actions'); |
26 |
$page ||= $filter->argument_value('page') || 1; |
$page ||= $filter->argument_value('page') || 1; |
27 |
$per_page ||= $filter->argument_value('per_page') || 10; |
$per_page ||= $filter->argument_value('per_page') || 10; |
28 |
|
$from_date ||= $filter->argument_value('from_date'); |
29 |
if ($author) { |
$to_date ||= $filter->argument_value('to_date'); |
30 |
$revisions->limit( |
$search ||= $filter->argument_value('search'); |
31 |
column => 'author', |
$branch ||= $filter->argument_value('branch'); |
32 |
value => $author, |
|
33 |
|
$revisions->unlimit(); |
34 |
|
|
35 |
|
$revisions->limit( column => 'author', value => $author, entry_aggregator => 'AND' ) if ($author); |
36 |
|
$revisions->limit( column => 'commit_date', operator => '>=', value => $from_date, entry_aggregator => 'AND' ) if ($from_date); |
37 |
|
$revisions->limit( column => 'commit_date', operator => '<=', value => $to_date, entry_aggregator => 'AND' ) if ($to_date); |
38 |
|
|
39 |
|
$revisions->limit( column => 'message', operator => 'LIKE', value => '%' . $search . '%' ) if ($search); |
40 |
|
|
41 |
|
if ($branch) { |
42 |
|
my $b = SVNBrowser::Model::Branch->new(); |
43 |
|
$b->load_by_cols( path => $branch ); |
44 |
|
|
45 |
|
my $rev_branches = $revisions->join( |
46 |
|
alias1 => 'main', column1 => 'revision', |
47 |
|
table2 => 'revision_branches', column2 => 'revision' |
48 |
); |
); |
49 |
} else { |
$revisions->limit( alias => $rev_branches, column => 'branch', value => $b->id ); |
|
$revisions->unlimit(); |
|
50 |
} |
} |
51 |
|
|
52 |
$revisions->order_by({ column => 'commit_date', order => 'desc' }); |
$revisions->order_by({ column => 'commit_date', order => 'desc' }); |
53 |
$revisions->set_page_info( |
$revisions->set_page_info( |
54 |
current_page => $page, |
current_page => $page, |
55 |
per_page => $per_page, |
per_page => $per_page, |
56 |
); |
); |
57 |
|
|
58 |
|
warn $revisions->build_select_query; |
59 |
|
|
60 |
$revisions->goto_first_item; |
$revisions->goto_first_item; |
61 |
|
|
62 |
|
|
67 |
<&| /_elements/wrapper, title => "SVN Reporitory Browser" &> |
<&| /_elements/wrapper, title => "SVN Reporitory Browser" &> |
68 |
|
|
69 |
<% Jifty->web->form->start %> |
<% Jifty->web->form->start %> |
70 |
|
|
71 |
<% $filter->form_field('author', default_value => $author ) %> |
<% $filter->form_field('author', default_value => $author ) %> |
72 |
<% $filter->button( label => 'Filter commits' ) %> |
<% $filter->form_field('branch', default_value => $branch ) %> |
73 |
<% $filter->form_field('show_actions', default_value => $show_actions ) %> |
<% $filter->form_field('search', default_value => $search ) %> |
74 |
|
|
75 |
|
<div class="inline"> |
76 |
|
<% $filter->form_field('from_date', default_value => $from_date ) %> |
77 |
|
<% $filter->form_field('to_date', default_value => $to_date ) %> |
78 |
<% $filter->form_field('per_page', default_value => $per_page ) %> |
<% $filter->form_field('per_page', default_value => $per_page ) %> |
79 |
|
<% $filter->form_field('show_actions', default_value => $show_actions ) %> |
80 |
|
</div> |
81 |
|
|
82 |
|
<div style="clear: left"> |
83 |
|
<% $filter->button( label => 'Filter commits' ) %> |
84 |
|
|
85 |
<%perl> |
<%perl> |
86 |
if (my $nr = $revisions->pager->total_entries) { |
if (my $nr = $revisions->pager->total_entries) { |
89 |
$m->out("No revisions found in repository"); |
$m->out("No revisions found in repository"); |
90 |
} |
} |
91 |
</%perl> |
</%perl> |
92 |
|
</div> |
93 |
|
|
94 |
<dl> |
<dl> |
95 |
% while (my $r = $revisions->next) { |
% while (my $r = $revisions->next) { |
96 |
<dt><% Jifty->web->tangent( |
<dt><% Jifty->web->tangent( |
97 |
url => '/revision/' . $r->revision, |
url => '/rev/' . $r->revision, |
98 |
label => $r->revision, |
label => $r->revision, |
99 |
) %> |
) %> |
100 |
<span class="author"><% $r->author %></span> |
<span class="author"><% $r->author %></span> |
104 |
<pre class="commit_message"><% $r->message %></pre> |
<pre class="commit_message"><% $r->message %></pre> |
105 |
% if ($show_actions) { |
% if ($show_actions) { |
106 |
<ul class="actions"> |
<ul class="actions"> |
107 |
|
% $actions->unlimit; |
108 |
% $actions->limit( column => 'revision', value => $r->revision ); |
% $actions->limit( column => 'revision', value => $r->revision ); |
109 |
% while (my $a = $actions->next) { |
% while (my $a = $actions->next) { |
110 |
<li><tt class="action-<% $a->type %>"><% $a->type %> <% $a->branch %> <% $a->rel_path %></tt></li> |
% my $full_path = $a->branch . $a->rel_path ; |
111 |
|
<li><tt class="action-<% $a->type %>"><% $a->type %> <% $full_path %> |
112 |
|
<% Jifty->web->tangent( url => '/rev/' . $r->revision . $full_path, label => 'diff' ) %> |
113 |
|
</tt></li> |
114 |
% } |
% } |
115 |
</ul> |
</ul> |
116 |
% } |
% } |