1 |
<%args> |
<%args> |
2 |
$page => undef; |
$next => undef |
|
$author => undef; |
|
|
$show_actions => undef; |
|
|
$per_page => undef; |
|
|
$from_date => undef; |
|
|
$to_date => undef; |
|
|
$search => 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 |
); |
); |
11 |
|
|
12 |
my $revisions = SVNBrowser::Model::RevisionCollection->new(); |
if (! $next) { |
13 |
|
$filter->argument_values({ show_actions => 1 }); |
14 |
$author ||= $filter->argument_value('author'); |
$filter->run; |
15 |
$show_actions ||= $filter->argument_value('show_actions'); |
} |
|
$page ||= $filter->argument_value('page') || 1; |
|
|
$per_page ||= $filter->argument_value('per_page') || 10; |
|
|
$from_date ||= $filter->argument_value('from_date'); |
|
|
$to_date ||= $filter->argument_value('to_date'); |
|
|
$search ||= $filter->argument_value('search'); |
|
|
|
|
|
$revisions->unlimit(); |
|
|
|
|
|
$revisions->limit( column => 'author', value => $author, entry_aggregator => 'AND' ) if ($author); |
|
|
$revisions->limit( column => 'commit_date', operator => '>=', value => $from_date, entry_aggregator => 'AND' ) if ($from_date); |
|
|
$revisions->limit( column => 'commit_date', operator => '<=', value => $to_date, entry_aggregator => 'AND' ) if ($to_date); |
|
|
|
|
|
$revisions->limit( column => 'message', operator => 'LIKE', value => '%' . $search . '%' ) if ($search); |
|
|
|
|
|
$revisions->order_by({ column => 'commit_date', order => 'desc' }); |
|
|
$revisions->set_page_info( |
|
|
current_page => $page, |
|
|
per_page => $per_page, |
|
|
); |
|
|
|
|
|
warn $revisions->build_select_query; |
|
|
|
|
|
$revisions->goto_first_item; |
|
|
|
|
|
|
|
|
my $actions = SVNBrowser::Model::ActionCollection->new(); |
|
16 |
|
|
17 |
|
#use Data::Dump qw/dump/; |
18 |
|
#warn "ARGS = ", dump( %ARGS ); |
19 |
</%init> |
</%init> |
20 |
|
|
21 |
<&| /_elements/wrapper, title => "SVN Reporitory Browser" &> |
<&| /_elements/wrapper, title => "SVN Reporitory Browser" &> |
22 |
|
|
23 |
<% Jifty->web->form->start %> |
<% Jifty->web->form->start %> |
24 |
<% $filter->form_field('author', default_value => $author ) %> |
|
25 |
|
<% $filter->form_field('author') %> |
26 |
|
<% $filter->form_field('branch') %> |
27 |
|
<% $filter->form_field('rel_path') %> |
28 |
|
<% $filter->form_field('search') %> |
29 |
|
|
30 |
|
<div class="inline"> |
31 |
|
<% $filter->form_field('from_date') %> |
32 |
|
<% $filter->form_field('to_date') %> |
33 |
|
<% $filter->form_field('per_page') %> |
34 |
|
<% $filter->form_field('show_actions') %> |
35 |
|
</div> |
36 |
|
|
37 |
|
<div style="clear: left"> |
38 |
<% $filter->button( label => 'Filter commits' ) %> |
<% $filter->button( label => 'Filter commits' ) %> |
39 |
<% $filter->form_field('show_actions', default_value => $show_actions ) %> |
</div> |
40 |
<% $filter->form_field('per_page', default_value => $per_page ) %> |
|
41 |
<% $filter->form_field('from_date', default_value => $from_date ) %> |
% if ( $filter->result and my $revisions = $filter->result->content('revisions') ) { |
|
<% $filter->form_field('to_date', default_value => $to_date ) %> |
|
|
<% $filter->form_field('search', default_value => $search ) %> |
|
|
|
|
|
<%perl> |
|
|
if (my $nr = $revisions->pager->total_entries) { |
|
|
$m->out("$nr revisions found"); |
|
|
} else { |
|
|
$m->out("No revisions found in repository"); |
|
|
} |
|
|
</%perl> |
|
42 |
|
|
43 |
<dl> |
<dl> |
44 |
% while (my $r = $revisions->next) { |
% while (my $r = $revisions->next) { |
45 |
<dt><% Jifty->web->tangent( |
<& /actions, |
46 |
url => '/rev/' . $r->revision, |
revision => $r->revision, |
47 |
label => $r->revision, |
rel_path => $filter->argument_value('rel_path'), |
48 |
) %> |
next => $next, |
49 |
<span class="author"><% $r->author %></span> |
show_actions => $filter->argument_value('show_actions'), |
50 |
<span class="commit_date"><% $r->commit_date %></span> |
r => $r |
51 |
</dt> |
&> |
|
<dd> |
|
|
<pre class="commit_message"><% $r->message %></pre> |
|
|
% if ($show_actions) { |
|
|
<ul class="actions"> |
|
|
% $actions->unlimit; |
|
|
% $actions->limit( column => 'revision', value => $r->revision ); |
|
|
% while (my $a = $actions->next) { |
|
|
% my $full_path = $a->branch . $a->rel_path ; |
|
|
<li><tt class="action-<% $a->type %>"><% $a->type %> <% $full_path %> |
|
|
<% Jifty->web->tangent( url => '/rev/' . $r->revision . $full_path, label => 'diff' ) %> |
|
|
</tt></li> |
|
|
% } |
|
|
</ul> |
|
|
% } |
|
|
|
|
|
</dd> |
|
52 |
% } |
% } |
53 |
</dl> |
</dl> |
54 |
|
|
63 |
% } |
% } |
64 |
|
|
65 |
% if ($revisions->pager->last_page > 1) { |
% if ($revisions->pager->last_page > 1) { |
66 |
page <% $page %> of <% $revisions->pager->last_page %> |
page <% $revisions->pager->current_page %> of <% $revisions->pager->last_page %> |
67 |
% } |
% } |
68 |
|
|
69 |
% if ($revisions->pager->next_page) { |
% if ($revisions->pager->next_page) { |
76 |
) %> |
) %> |
77 |
% } |
% } |
78 |
|
|
79 |
|
<!-- no $revisions --> |
80 |
|
% } |
81 |
|
|
82 |
<% Jifty->web->form->end %> |
<% Jifty->web->form->end %> |
83 |
|
|
84 |
</&> |
</&> |