Allow filtering jobs in eval pages
This commit is contained in:
parent
d0bcaa6284
commit
07747b7e88
|
@ -26,6 +26,9 @@ sub view : Chained('eval') PathPart('') Args(0) {
|
|||
|
||||
my $eval = $c->stash->{eval};
|
||||
|
||||
$c->stash->{filter} = $c->request->params->{filter} // "";
|
||||
my $filter = $c->stash->{filter} eq "" ? {} : { job => { ilike => "%" . $c->stash->{filter} . "%" } };
|
||||
|
||||
my $compare = $c->req->params->{compare};
|
||||
my $eval2;
|
||||
|
||||
|
@ -62,8 +65,8 @@ sub view : Chained('eval') PathPart('') Args(0) {
|
|||
|| $a->get_column('system') cmp $b->get_column('system')
|
||||
}
|
||||
|
||||
my @builds = $eval->builds->search({}, { columns => [@buildListColumns] });
|
||||
my @builds2 = defined $eval2 ? $eval2->builds->search({}, { columns => [@buildListColumns] }) : ();
|
||||
my @builds = $eval->builds->search($filter, { columns => [@buildListColumns] });
|
||||
my @builds2 = defined $eval2 ? $eval2->builds->search($filter, { columns => [@buildListColumns] }) : ();
|
||||
|
||||
@builds = sort { cmpBuilds($a, $b) } @builds;
|
||||
@builds2 = sort { cmpBuilds($a, $b) } @builds2;
|
||||
|
|
|
@ -36,6 +36,12 @@ c.uri_for(c.controller('JobsetEval').action_for('view'),
|
|||
|
||||
<div id="tabs-status" class="tab-pane active">
|
||||
|
||||
<form class="form-search">
|
||||
<input name="filter" type="text" class="input-large search-query" placeholder="Search jobs by name..." [% HTML.attributes(value => filter) %]/>
|
||||
<input name="compare" type="hidden" [% HTML.attributes(value => otherEval.id) %]/>
|
||||
<input name="full" type="hidden" [% HTML.attributes(value => full) %]/>
|
||||
</form>
|
||||
|
||||
[% BLOCK renderSome %]
|
||||
[% size = builds.size; max = full ? size : 30; %]
|
||||
[% INCLUDE renderBuildListBody builds=builds.slice(0, (size > max ? max : size) - 1)
|
||||
|
|
Loading…
Reference in a new issue