sort branches by date
This commit is contained in:
parent
b5648b864b
commit
4dc5c03077
|
@ -16,26 +16,16 @@ BranchesController = Ember.Controller.extend
|
||||||
repos = repos.filter (item, index) ->
|
repos = repos.filter (item, index) ->
|
||||||
console.log(item)
|
console.log(item)
|
||||||
item if item.exists_on_github == true && item.repository.default_branch.name != undefined
|
item if item.exists_on_github == true && item.repository.default_branch.name != undefined
|
||||||
.sort (a, b) ->
|
.sortBy('last_build.finished_at')
|
||||||
# if a.last_build && b.last_build
|
.reverse()
|
||||||
|
|
||||||
# if a.last_build.finished_at == null
|
|
||||||
# return 1
|
|
||||||
# else
|
|
||||||
# if a.last_build.finished_at > b.last_build.finished_at
|
|
||||||
# return -1
|
|
||||||
# else if a.last_build.finished_at < b.last_build.finished_at
|
|
||||||
# return 1
|
|
||||||
# else
|
|
||||||
# return 0
|
|
||||||
# else
|
|
||||||
# return -1
|
|
||||||
).property('model')
|
).property('model')
|
||||||
|
|
||||||
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 if item.exists_on_github == false
|
||||||
|
.sortBy('last_build.finished_at')
|
||||||
|
.reverse()
|
||||||
).property('model')
|
).property('model')
|
||||||
|
|
||||||
`export default BranchesController`
|
`export default BranchesController`
|
||||||
|
|
Loading…
Reference in New Issue
Block a user