Add first_sync template
First sync will be displayed when user is logged in and first sync is still taking place
This commit is contained in:
parent
b40d0acf9c
commit
33bce774a3
|
@ -42,6 +42,12 @@ Travis.AccountProfileController = Em.Controller.extend
|
|||
needs: ['currentUser']
|
||||
userBinding: 'controllers.currentUser'
|
||||
|
||||
Travis.FirstSyncController = Em.Controller.extend
|
||||
needs: ['currentUser']
|
||||
user: Ember.computed.alias('controllers.currentUser')
|
||||
|
||||
isSyncing: Ember.computed.alias('user.isSyncing')
|
||||
|
||||
require 'controllers/accounts'
|
||||
require 'controllers/build'
|
||||
require 'controllers/builds'
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
Travis.CurrentUserController = Em.ObjectController.extend
|
||||
sync: ->
|
||||
@get('content').sync()
|
||||
|
||||
syncingDidChange: (->
|
||||
if (user = @get('content')) && user.get('isSyncing') && !user.get('syncedAt')
|
||||
@container.lookup('router:main').send('renderFirstSync')
|
||||
).observes('isSyncing', 'content')
|
||||
|
|
|
@ -24,6 +24,9 @@ Ember.Route.reopen
|
|||
renderNoOwnedRepos: ->
|
||||
@render('no_owned_repos', outlet: 'main')
|
||||
|
||||
renderFirstSync: ->
|
||||
@renderFirstSync()
|
||||
|
||||
error: (error) ->
|
||||
if error == 'needs-auth'
|
||||
authController = @container.lookup('controller:auth') || @generateController('auth')
|
||||
|
@ -48,6 +51,9 @@ Ember.Route.reopen
|
|||
afterSignOut: ->
|
||||
@transitionTo('index.current')
|
||||
|
||||
renderFirstSync: ->
|
||||
@transitionTo 'first_sync'
|
||||
|
||||
beforeModel: (transition) ->
|
||||
Travis.autoSignIn() unless @signedIn()
|
||||
|
||||
|
@ -92,6 +98,7 @@ Travis.Router.map ->
|
|||
@resource 'branches', path: '/branches'
|
||||
|
||||
@route 'getting_started'
|
||||
@route 'first_sync'
|
||||
@route 'stats', path: '/stats'
|
||||
@route 'auth', path: '/auth'
|
||||
@route 'notFound', path: '/not-found'
|
||||
|
@ -141,6 +148,17 @@ Travis.GettingStartedRoute = Ember.Route.extend
|
|||
@render 'repos', outlet: 'left'
|
||||
@_super.apply(this, arguments)
|
||||
|
||||
Travis.FirstSyncRoute = Ember.Route.extend
|
||||
setupController: ->
|
||||
$('body').attr('id', 'home')
|
||||
@container.lookup('controller:repos').activate()
|
||||
@container.lookup('controller:application').connectLayout 'simple'
|
||||
@_super.apply(this, arguments)
|
||||
|
||||
renderTemplate: ->
|
||||
@render 'top', outlet: 'top'
|
||||
@_super.apply(this, arguments)
|
||||
|
||||
Travis.IndexCurrentRoute = Ember.Route.extend Travis.SetupLastBuild,
|
||||
renderTemplate: ->
|
||||
@render 'repo'
|
||||
|
|
9
assets/scripts/app/templates/first_sync.hbs
Normal file
9
assets/scripts/app/templates/first_sync.hbs
Normal file
|
@ -0,0 +1,9 @@
|
|||
This is the first time you log in to Travis and we're still syncing your repositories.
|
||||
|
||||
{{#if isSyncing}}
|
||||
--- big indicator ---
|
||||
{{else}}
|
||||
Syncing has finished, you may check out your
|
||||
{{#linkTo "profile.index"}}profile{{/linkTo}}
|
||||
now
|
||||
{{/if}}
|
Loading…
Reference in New Issue
Block a user