1 |
<%args> |
<%args> |
2 |
$page => undef; |
$next |
|
$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 |
); |
); |
|
|
|
|
my $revisions = SVNBrowser::Model::RevisionCollection->new(); |
|
|
|
|
|
$author ||= $filter->argument_value('author'); |
|
|
$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(); |
|
|
|
|
11 |
</%init> |
</%init> |
12 |
|
|
13 |
<&| /_elements/wrapper, title => "SVN Reporitory Browser" &> |
<&| /_elements/wrapper, title => "SVN Reporitory Browser" &> |
14 |
|
|
15 |
<% Jifty->web->form->start %> |
<% Jifty->web->form->start %> |
16 |
<% $filter->form_field('author', default_value => $author ) %> |
|
17 |
|
<% $filter->form_field('author') %> |
18 |
|
<% $filter->form_field('branch') %> |
19 |
|
<% $filter->form_field('search') %> |
20 |
|
|
21 |
|
<div class="inline"> |
22 |
|
<% $filter->form_field('from_date') %> |
23 |
|
<% $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' ) %> |
<% $filter->button( label => 'Filter commits' ) %> |
30 |
<% $filter->form_field('show_actions', default_value => $show_actions ) %> |
</div> |
|
<% $filter->form_field('per_page', default_value => $per_page ) %> |
|
|
<% $filter->form_field('from_date', default_value => $from_date ) %> |
|
|
<% $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> |
|
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; |
% $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 |
% } |
% } |
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) { |
85 |
) %> |
) %> |
86 |
% } |
% } |
87 |
|
|
88 |
|
<!-- no $revisions --> |
89 |
|
% } |
90 |
|
|
91 |
<% Jifty->web->form->end %> |
<% Jifty->web->form->end %> |
92 |
|
|
93 |
</&> |
</&> |