Merge pull request #899 from grahamc/horses
Projects, jobsets: order jobsets with disabled, hidden rows at the end
This commit is contained in:
commit
0693cc713e
|
@ -104,7 +104,7 @@ sub deserialize :ActionClass('Deserialize') { }
|
|||
sub index :Path :Args(0) {
|
||||
my ($self, $c) = @_;
|
||||
$c->stash->{template} = 'overview.tt';
|
||||
$c->stash->{projects} = [$c->model('DB::Projects')->search({}, {order_by => 'name'})];
|
||||
$c->stash->{projects} = [$c->model('DB::Projects')->search({}, {order_by => ['enabled DESC', 'name']})];
|
||||
$c->stash->{newsItems} = [$c->model('DB::NewsItems')->search({}, { order_by => ['createtime DESC'], rows => 5 })];
|
||||
$self->status_ok($c,
|
||||
entity => $c->stash->{projects}
|
||||
|
|
|
@ -113,7 +113,7 @@ sub registerRoot {
|
|||
sub jobsetOverview_ {
|
||||
my ($c, $jobsets) = @_;
|
||||
return $jobsets->search({},
|
||||
{ order_by => "name"
|
||||
{ order_by => ["hidden ASC", "enabled DESC", "name"]
|
||||
, "+select" =>
|
||||
[ "(select count(*) from Builds as a where a.finished = 0 and me.project = a.project and me.name = a.jobset and a.isCurrent = 1)"
|
||||
, "(select count(*) from Builds as a where a.finished = 1 and me.project = a.project and me.name = a.jobset and buildstatus <> 0 and a.isCurrent = 1)"
|
||||
|
|
Loading…
Reference in a new issue