This commit is contained in:
Joseph Schorr 2014-03-05 16:28:00 -05:00
commit a1e7e69706
2 changed files with 7 additions and 13 deletions

View file

@ -1413,6 +1413,7 @@ def list_repository_builds(namespace_name, repository_name, limit,
.join(BuildTriggerService, JOIN_LEFT_OUTER)
.where(Repository.name == repository_name,
Repository.namespace == namespace_name)
.order_by(RepositoryBuild.started.desc())
.limit(limit))
if not include_inactive:
@ -1423,18 +1424,11 @@ def list_repository_builds(namespace_name, repository_name, limit,
def get_recent_repository_build(namespace_name, repository_name):
query = (RepositoryBuild.select(RepositoryBuild)
.join(Repository)
.where(Repository.name == repository_name,
Repository.namespace == namespace_name)
.order_by(RepositoryBuild.started.desc())
.limit(1))
results = list(query)
if results:
return results[0]
return None
query = list_repository_builds(namespace_name, repository_name, 1)
try:
return query.get()
except RepositoryBuild.DoesNotExist:
return None
def create_repository_build(repo, access_token, job_config_obj, dockerfile_id,

View file

@ -26,7 +26,7 @@
<!-- Side tabs -->
<div class="col-sm-2">
<ul class="nav nav-pills nav-stacked">
<li ng-class="currentBuild == build ? 'active' : ''" ng-repeat="build in builds | reverse">
<li ng-class="currentBuild == build ? 'active' : ''" ng-repeat="build in builds">
<a class="build-tab-link" href="javascript:void(0)" ng-click="setCurrentBuild(build.id, true)">
<span class="phase-icon" ng-class="build.phase"></span>
<span>{{ build.display_name }}</span>