--- trunk/lib/SVNBrowser/View.pm 2008/01/31 20:03:43 73 +++ trunk/lib/SVNBrowser/View.pm 2008/01/31 21:13:49 74 @@ -21,7 +21,7 @@ render_param( $filter => 'author' ); render_param( $filter => 'branch' ); - render_param( $filter => 'rel_path' ); + render_param( $filter => 'rel_path', default => get('rel_path') ); render_param( $filter => 'search' ); div { attr { class => 'inline' } @@ -31,7 +31,7 @@ render_param( $filter => 'per_page' ); render_param( $filter => 'show_actions' ); - } + }; form_submit( label => _("Filter commits") @@ -43,36 +43,38 @@ if ( $revisions ) { sub pager { - my $revisions = shift; + my ( $action, $collection ) = @_; + + return if $collection->pager->last_page == 1; div { attr { class => 'pager' }; - if ( $revisions->pager->previous_page ) { - outs_raw $filter->button( - submit => $filter, + if ( $collection->pager->previous_page ) { + outs_raw $action->button( + submit => $action, label => _("previous page"), - arguments => { page => $revisions->pager->previous_page }, + arguments => { page => $collection->pager->previous_page }, ); } - if ($revisions->pager->last_page > 1) { + if ($collection->pager->last_page > 1) { span { - _("page"), ' ', $revisions->pager->current_page, ' ',_("of"), ' ', $revisions->pager->last_page + _("page"), ' ', $collection->pager->current_page, ' ',_("of"), ' ', $collection->pager->last_page } }; - if ($revisions->pager->next_page) { - outs_raw( $filter->button( - submit => $filter, + if ($collection->pager->next_page) { + outs_raw( $action->button( + submit => $action, label => _("next page"), - arguments => { page => $revisions->pager->next_page }, + arguments => { page => $collection->pager->next_page }, ) ); } } } - pager( $revisions ); + pager( $filter, $revisions ); my $show_actions = get('show_actions') || $filter->argument_value('show_actions'); my $rel_path = get('rel_path') || $filter->argument_value('rel_path'); @@ -80,29 +82,39 @@ dl { attr { class => 'results' }; + while (my $r = $revisions->next ) { dt { + attr { class => 'commit' } tt { $r->revision } span { attr { class => 'author' } $r->author } span { attr { class => 'commit_date' } $r->commit_date } } + dd { - pre { attr { class => 'commit_message' } $r->message } - }; + pre { attr { class => 'commit_message' } $r->message }; - if ( $show_actions ) { - my $actions = SVNBrowser::Model::ActionCollection->new(); - $actions->unlimit; - $actions->limit( column => 'revision', value => $r->revision ); - $actions->limit( column => 'rel_path', value => $rel_path, operator => 'STARTSWITH' ) if ($rel_path); - - ul { attr { class => 'actions' }; - while (my $a = $actions->next) { - li { - tt { attr { class => 'action-' . $a->type } - $a->type, - $a->branch, - $a->rel_path + if ( $show_actions ) { + my $actions = SVNBrowser::Model::ActionCollection->new(); + $actions->unlimit; + $actions->limit( column => 'revision', value => $r->revision ); + $actions->limit( column => 'rel_path', value => $rel_path, operator => 'STARTSWITH' ) if ($rel_path); + + ul { attr { class => 'actions' }; + while (my $a = $actions->next) { + li { + tt { attr { class => 'action-' . $a->type } + outs ( + $a->type, ' ', + $a->branch + ); + hyperlink( + label => $a->rel_path, + parameters => { + rel_path => $a->rel_path, + } + ); + } } } } @@ -111,7 +123,7 @@ } } - pager( $revisions ); + pager( $filter, $revisions ); }