1 |
<%args> |
<%args> |
|
$page => undef; |
|
|
$author => undef; |
|
|
$show_actions => undef; |
|
|
$per_page => undef; |
|
|
$from_date => undef; |
|
|
$to_date => undef; |
|
|
$search => undef; |
|
2 |
</%args> |
</%args> |
3 |
|
|
4 |
<%init> |
<%init> |
5 |
my $filter = Jifty->web->new_action( |
my $filter = Jifty->web->new_action( |
6 |
class => 'Filter', |
class => 'Filter', |
7 |
moniker => 'filer_list', |
moniker => 'filter_list', |
8 |
# arguments => { |
arguments => { %ARGS }, |
|
# author => $author, |
|
|
# show_actions => $show_actions, |
|
|
# }, |
|
9 |
); |
); |
10 |
|
|
11 |
my $revisions = SVNBrowser::Model::RevisionCollection->new(); |
$filter->take_action if (%ARGS); |
|
|
|
|
$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(); |
|
12 |
|
|
13 |
</%init> |
</%init> |
14 |
|
|
15 |
<&| /_elements/wrapper, title => "SVN Reporitory Browser" &> |
<&| /_elements/wrapper, title => "SVN Reporitory Browser" &> |
16 |
|
|
17 |
<% Jifty->web->form->start %> |
<% Jifty->web->form->start %> |
18 |
<% $filter->form_field('author', default_value => $author ) %> |
|
19 |
|
<% $filter->form_field('author') %> |
20 |
|
<% $filter->form_field('branch') %> |
21 |
|
<% $filter->form_field('search') %> |
22 |
|
|
23 |
|
<div class="inline"> |
24 |
|
<% $filter->form_field('from_date') %> |
25 |
|
<% $filter->form_field('to_date') %> |
26 |
|
<% $filter->form_field('per_page') %> |
27 |
|
<% $filter->form_field('show_actions') %> |
28 |
|
</div> |
29 |
|
|
30 |
|
<div style="clear: left"> |
31 |
<% $filter->button( label => 'Filter commits' ) %> |
<% $filter->button( label => 'Filter commits' ) %> |
32 |
<% $filter->form_field('show_actions', default_value => $show_actions ) %> |
</div> |
33 |
<% $filter->form_field('per_page', default_value => $per_page ) %> |
|
34 |
<% $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> |
|
35 |
|
|
36 |
|
% my $actions = SVNBrowser::Model::ActionCollection->new(); |
37 |
<dl> |
<dl> |
38 |
% while (my $r = $revisions->next) { |
% while (my $r = $revisions->next) { |
39 |
<dt><% Jifty->web->tangent( |
<dt><% Jifty->web->tangent( |
40 |
url => '/revision/' . $r->revision, |
url => '/rev/' . $r->revision, |
41 |
label => $r->revision, |
label => $r->revision, |
42 |
) %> |
) %> |
43 |
<span class="author"><% $r->author %></span> |
<span class="author"><% $r->author %></span> |
45 |
</dt> |
</dt> |
46 |
<dd> |
<dd> |
47 |
<pre class="commit_message"><% $r->message %></pre> |
<pre class="commit_message"><% $r->message %></pre> |
48 |
% if ($show_actions) { |
% if ($filter->argument_value('show_actions')) { |
49 |
<ul class="actions"> |
<ul class="actions"> |
50 |
|
% $actions->unlimit; |
51 |
% $actions->limit( column => 'revision', value => $r->revision ); |
% $actions->limit( column => 'revision', value => $r->revision ); |
52 |
% while (my $a = $actions->next) { |
% while (my $a = $actions->next) { |
53 |
<li><tt class="action-<% $a->type %>"><% $a->type %> <% $a->branch %> <% $a->rel_path %></tt></li> |
% my $full_path = $a->branch . $a->rel_path ; |
54 |
|
<li><tt class="action-<% $a->type %>"><% $a->type %> <% $full_path %> |
55 |
|
<% Jifty->web->tangent( url => '/rev/' . $r->revision . $full_path, label => 'diff' ) %> |
56 |
|
</tt></li> |
57 |
% } |
% } |
58 |
</ul> |
</ul> |
59 |
% } |
% } |
73 |
% } |
% } |
74 |
|
|
75 |
% if ($revisions->pager->last_page > 1) { |
% if ($revisions->pager->last_page > 1) { |
76 |
page <% $page %> of <% $revisions->pager->last_page %> |
page <% $revisions->pager->current_page %> of <% $revisions->pager->last_page %> |
77 |
% } |
% } |
78 |
|
|
79 |
% if ($revisions->pager->next_page) { |
% if ($revisions->pager->next_page) { |
86 |
) %> |
) %> |
87 |
% } |
% } |
88 |
|
|
89 |
|
<!-- no $revisions --> |
90 |
|
% } |
91 |
|
|
92 |
<% Jifty->web->form->end %> |
<% Jifty->web->form->end %> |
93 |
|
|
94 |
</&> |
</&> |