Don't show default branch in inactive branches

This commit is contained in:
Piotr Sarnacki 2015-12-10 12:12:42 +01:00
parent 830211444b
commit 598f6a02fb
2 changed files with 6 additions and 5 deletions

View File

@ -7,15 +7,16 @@ BranchesController = Ember.Controller.extend
defaultBranch: (-> defaultBranch: (->
repos = @get('model') repos = @get('model')
output = repos.filter (item, index) -> output = repos.filter (item, index) ->
item if item.default_branch == true item.default_branch
if output.length if output.length
output[0] output[0]
).property('model') ).property('model')
activeBranches: (-> activeBranches: (->
repos = @get('model') repos = @get('model')
console.log repos
repos = repos.filter (item, index) -> repos = repos.filter (item, index) ->
item if item.exists_on_github == true && item.default_branch == false item.exists_on_github && !item.default_branch
.sortBy('last_build.finished_at') .sortBy('last_build.finished_at')
.reverse() .reverse()
).property('model') ).property('model')
@ -23,7 +24,7 @@ BranchesController = Ember.Controller.extend
inactiveBranches: (-> inactiveBranches: (->
repos = @get('model') repos = @get('model')
repos = repos.filter (item, index) -> repos = repos.filter (item, index) ->
item if item.exists_on_github == false !item.exists_on_github && !item.default_branch
.sortBy('last_build.finished_at') .sortBy('last_build.finished_at')
.reverse() .reverse()
).property('model') ).property('model')

View File

@ -6,7 +6,7 @@
</ul> </ul>
</section> </section>
{{#if activeBranches}} {{#if activeBranches.length}}
<section> <section>
<h2 class="small-title">Active Branches</h2> <h2 class="small-title">Active Branches</h2>
<ul class="blank-list"> <ul class="blank-list">
@ -17,7 +17,7 @@
</section> </section>
{{/if}} {{/if}}
{{#if inactiveBranches}} {{#if inactiveBranches.length}}
<section> <section>
<h2 class="small-title">Inactive Branches</h2> <h2 class="small-title">Inactive Branches</h2>
<ul class="blank-list"> <ul class="blank-list">