Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
69 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
www/md_base/src/app/common/directives/builditem/builditem.directive.coffee
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
class BuildItem extends Directive | ||
|
||
constructor: -> | ||
return { | ||
restrict: 'E' | ||
templateUrl: 'views/builditem.html' | ||
controller: '_BuildItemController' | ||
controllerAs: 'builditem' | ||
bindToController: true | ||
scope: | ||
build: '=' | ||
outBuilder: '=builder' | ||
showBuilder: '=' | ||
} | ||
|
||
class _BuildItem extends Controller | ||
constructor: (buildbotService) -> | ||
if @outBuilder | ||
@builder = outBuilder | ||
else if @showBuilder | ||
buildbotService.one('builders', @build.builderid).get().then (data) => | ||
@builder = data | ||
|
||
|
25 changes: 25 additions & 0 deletions
25
www/md_base/src/app/common/directives/builditem/builditem.less
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
build-item { | ||
display: block; | ||
margin: 5px 0; | ||
padding: 5px; | ||
background: rgba(0, 0, 0, 0.05); | ||
|
||
.inner { | ||
line-height: 30px; | ||
font-size: 16px; | ||
color: #999; | ||
|
||
span { | ||
padding: 0 5px; | ||
} | ||
} | ||
|
||
.builder-name { | ||
white-space: nowrap; | ||
text-overflow: ellipsis; | ||
overflow: hidden; | ||
width: 20%; | ||
min-width: 100px; | ||
border-right: 1px solid #ddd; | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
www/md_base/src/app/common/directives/builditem/builditem.spec.coffee
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
beforeEach module 'app' | ||
|
||
describe 'panel', -> | ||
|
||
$rootScope = $compile = null | ||
|
||
injected = ($injector) -> | ||
$compile = $injector.get('$compile') | ||
$rootScope = $injector.get('$rootScope') | ||
|
||
beforeEach inject injected | ||
|
5 changes: 5 additions & 0 deletions
5
www/md_base/src/app/common/directives/builditem/builditem.tpl.jade
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
div.inner(layout="row") | ||
build-status(build="builditem.build") | ||
span.builder-name(ng-if="builditem.showBuilder") {{ builditem.builder.name }} | ||
span.number(flex) \#{{ builditem.build.number }} | ||
span.time(am-time-ago="builditem.build.started_at", am-preprocess="unix") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
www/md_base/src/app/home/panels/recent_builds/recent_builds_panel.tpl.jade
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
div.build(ng-repeat="build in recent.builds") | ||
build-status(build="build") | ||
build-item(build="build", show-builder="recent.showBuilders") |