Merge branch 'landing-page' of github.com:travis-ci/travis-web into landing-page

This commit is contained in:
Lisa Passing 2015-04-07 16:07:08 +02:00
commit 99d609cc23
4 changed files with 25 additions and 10 deletions

View File

@ -108,12 +108,12 @@ Repo = Model.extend
).property('_lastBuildDuration', 'lastBuildStartedAt', 'lastBuildFinishedAt') ).property('_lastBuildDuration', 'lastBuildStartedAt', 'lastBuildFinishedAt')
sortOrder: (-> sortOrder: (->
# cuz sortAscending seems buggy when set to false state = @get('lastBuildState')
if lastBuildFinishedAt = @get('lastBuildFinishedAt') if state != 'passed' && state != 'failed'
- new Date(lastBuildFinishedAt).getTime() 0
else else
- new Date('9999').getTime() - parseInt(@get('lastBuildId')) parseInt(@get('lastBuildId'))
).property('lastBuildFinishedAt', 'lastBuildId') ).property('lastBuildId', 'lastBuildState')
stats: (-> stats: (->
if @get('slug') if @get('slug')

View File

@ -9,10 +9,14 @@ Route = BasicRoute.extend
isLoadedBinding: 'repos.isLoaded' isLoadedBinding: 'repos.isLoaded'
repos: @store.filter 'repo', (repo) -> repos: @store.filter 'repo', (repo) ->
buildId = repo.get('lastBuildId') buildId = repo.get('lastBuildId')
store.hasRecordForId('build', buildId) if store.hasRecordForId('build', buildId)
sorted: Ember.computed.sort('repos', 'sortedReposKeys') state = repo.get('lastBuild.state')
state == 'passed' || state == 'failed'
external: []
withExternal: Ember.computed.union('repos', 'external')
sorted: Ember.computed.sort('withExternal', 'sortedReposKeys')
content: limit('sorted', 'limit') content: limit('sorted', 'limit')
sortedReposKeys: ['sortOrder:asc'] sortedReposKeys: ['sortOrder:desc']
limit: 3 limit: 3
).create() ).create()
@ -22,6 +26,12 @@ Route = BasicRoute.extend
@set('letMoreReposThrough', true) @set('letMoreReposThrough', true)
, 5000 , 5000
setTimeout =>
unless repos.get('length')
@store.find('repo').then (reposFromRequest) ->
repos.get('external').pushObjects reposFromRequest.toArray().slice(0, 3)
, 10000
@_super.apply this, arguments @_super.apply this, arguments
activate: -> activate: ->
@ -40,7 +50,9 @@ Route = BasicRoute.extend
if @get('repos.length') < 3 if @get('repos.length') < 3
return true return true
if event == 'build:started' && @get('letMoreReposThrough') if event == 'build:finished' &&
['passed', 'failed'].indexOf(data.build.state) != -1 &&
@get('letMoreReposThrough')
@set('letMoreReposThrough', false) @set('letMoreReposThrough', false)
return true return true

View File

@ -146,6 +146,9 @@
text-align: right text-align: right
margin: 0 margin: 0
a
color: #828282
p p
text-align: right text-align: right
margin-top: 0.5em margin-top: 0.5em

View File

@ -169,7 +169,7 @@ class Travis::Web::App
end end
def title def title
default_title = "Travis CI - Free Hosted Continuous Integration Platform for the Open Source Community" default_title = "Travis CI - Test and deploy your code in confidence"
ENV['SITE_TITLE'] || default_title ENV['SITE_TITLE'] || default_title
end end