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) {
|
sub index :Path :Args(0) {
|
||||||
my ($self, $c) = @_;
|
my ($self, $c) = @_;
|
||||||
$c->stash->{template} = 'overview.tt';
|
$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 })];
|
$c->stash->{newsItems} = [$c->model('DB::NewsItems')->search({}, { order_by => ['createtime DESC'], rows => 5 })];
|
||||||
$self->status_ok($c,
|
$self->status_ok($c,
|
||||||
entity => $c->stash->{projects}
|
entity => $c->stash->{projects}
|
||||||
|
|
|
@ -113,7 +113,7 @@ sub registerRoot {
|
||||||
sub jobsetOverview_ {
|
sub jobsetOverview_ {
|
||||||
my ($c, $jobsets) = @_;
|
my ($c, $jobsets) = @_;
|
||||||
return $jobsets->search({},
|
return $jobsets->search({},
|
||||||
{ order_by => "name"
|
{ order_by => ["hidden ASC", "enabled DESC", "name"]
|
||||||
, "+select" =>
|
, "+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 = 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)"
|
, "(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