do not load accounts on controller init

This commit is contained in:
Sven Fuchs 2012-09-27 23:09:00 +02:00
parent ccff457296
commit abb5ed181e
5 changed files with 36 additions and 36 deletions

View File

@ -42,7 +42,7 @@ GIT
GIT GIT
remote: git://github.com/travis-ci/travis-api.git remote: git://github.com/travis-ci/travis-api.git
revision: 8924ebffffceb5869622e0c73cda90779750c881 revision: 5271f21d3cf2c393377308a2717ecf83fa7c7580
specs: specs:
travis-api (0.0.1) travis-api (0.0.1)
backports (~> 2.5) backports (~> 2.5)

View File

@ -1,16 +1,12 @@
Travis.AccountsController = Ember.ArrayController.extend Travis.AccountsController = Ember.ArrayController.extend
defaultTab: 'accounts' tab: 'accounts'
init: -> init: ->
@_super() @_super()
@activate(@defaultTab)
activate: (tab, params) -> content: (->
@set('tab', tab) Travis.Account.find()
this["view#{$.camelize(tab)}"](params) ).property()
viewAccounts: ->
@set('content', Travis.Account.find())
findByLogin: (login) -> findByLogin: (login) ->
@find (account) -> account.get('login') == 'login' @find (account) -> account.get('login') == 'login'

View File

@ -29,12 +29,12 @@ require 'travis/model'
).property() ).property()
sync: -> sync: ->
@post('/user/sync') @post('/users/sync')
@set('isSyncing', true) @setWithSession('isSyncing', true)
@poll() @poll()
poll: -> poll: ->
@ajax '/user', 'get', success: (data) => @ajax '/users', 'get', success: (data) =>
if data.user.is_syncing if data.user.is_syncing
Ember.run.later(this, this.poll.bind(this), 3000) Ember.run.later(this, this.poll.bind(this), 3000)
else else
@ -46,6 +46,6 @@ require 'travis/model'
setWithSession: (name, value) -> setWithSession: (name, value) ->
@set(name, value) @set(name, value)
user = JSON.parse(sessionStorage?.getItem('travis.user')) data = JSON.parse(sessionStorage?.getItem('travis.user'))
user[$.underscore(name)] = @get(name) data.user[$.underscore(name)] = @get(name)
sessionStorage?.setItem('travis.user', JSON.stringify(user)) sessionStorage?.setItem('travis.user', JSON.stringify(data))

File diff suppressed because one or more lines are too long

View File

@ -6007,75 +6007,79 @@ pre#log .fold.open {
color: #666666; color: #666666;
} }
/* line 19, /Users/sven/Development/projects/travis/travis-ember/assets/stylesheets/status.sass */ /* line 20, /Users/sven/Development/projects/travis/travis-ember/assets/stylesheets/status.sass */
#repositories .green .status, #repositories .green .status,
.green .number .status { .summary .green .number .status,
.list .green .number .status {
background-color: #368c2a; background-color: #368c2a;
} }
/* line 21, /Users/sven/Development/projects/travis/travis-ember/assets/stylesheets/status.sass */ /* line 22, /Users/sven/Development/projects/travis/travis-ember/assets/stylesheets/status.sass */
#repositories .green a, #repositories .green a,
.green .number a { .summary .green .number a,
.list .green .number a {
color: #038035; color: #038035;
} }
/* line 26, /Users/sven/Development/projects/travis/travis-ember/assets/stylesheets/status.sass */ /* line 28, /Users/sven/Development/projects/travis/travis-ember/assets/stylesheets/status.sass */
#repositories .red .status, #repositories .red .status,
.red .number .status { .summary .red .number .status,
.list .red .number .status {
background-color: #cc3d3d; background-color: #cc3d3d;
} }
/* line 28, /Users/sven/Development/projects/travis/travis-ember/assets/stylesheets/status.sass */ /* line 30, /Users/sven/Development/projects/travis/travis-ember/assets/stylesheets/status.sass */
#repositories .red a, #repositories .red a,
.red .number a { .summary .red .number a,
.list .red .number a {
color: #cc0000; color: #cc0000;
} }
/* line 33, /Users/sven/Development/projects/travis/travis-ember/assets/stylesheets/status.sass */ /* line 35, /Users/sven/Development/projects/travis/travis-ember/assets/stylesheets/status.sass */
table.list tbody td { table.list tbody td {
cursor: pointer; cursor: pointer;
background-color: #fffcf4; background-color: #fffcf4;
} }
/* line 36, /Users/sven/Development/projects/travis/travis-ember/assets/stylesheets/status.sass */ /* line 38, /Users/sven/Development/projects/travis/travis-ember/assets/stylesheets/status.sass */
table.list tbody tr:hover td { table.list tbody tr:hover td {
background-color: #ffffe1; background-color: #ffffe1;
} }
/* line 40, /Users/sven/Development/projects/travis/travis-ember/assets/stylesheets/status.sass */ /* line 42, /Users/sven/Development/projects/travis/travis-ember/assets/stylesheets/status.sass */
table.list .green td { table.list .green td {
background-color: #fafffa; background-color: #fafffa;
} }
/* line 42, /Users/sven/Development/projects/travis/travis-ember/assets/stylesheets/status.sass */ /* line 44, /Users/sven/Development/projects/travis/travis-ember/assets/stylesheets/status.sass */
table.list .green:hover td { table.list .green:hover td {
background-color: #dcffdc; background-color: #dcffdc;
} }
/* line 44, /Users/sven/Development/projects/travis/travis-ember/assets/stylesheets/status.sass */ /* line 46, /Users/sven/Development/projects/travis/travis-ember/assets/stylesheets/status.sass */
table.list .green .number a { table.list .green .number a {
color: #038035; color: #038035;
} }
/* line 48, /Users/sven/Development/projects/travis/travis-ember/assets/stylesheets/status.sass */ /* line 50, /Users/sven/Development/projects/travis/travis-ember/assets/stylesheets/status.sass */
table.list .red td { table.list .red td {
background-color: snow; background-color: snow;
} }
/* line 50, /Users/sven/Development/projects/travis/travis-ember/assets/stylesheets/status.sass */ /* line 52, /Users/sven/Development/projects/travis/travis-ember/assets/stylesheets/status.sass */
table.list .red:hover td { table.list .red:hover td {
background-color: #ffdcdc; background-color: #ffdcdc;
} }
/* line 52, /Users/sven/Development/projects/travis/travis-ember/assets/stylesheets/status.sass */ /* line 54, /Users/sven/Development/projects/travis/travis-ember/assets/stylesheets/status.sass */
table.list .red .number a { table.list .red .number a {
color: #cc0000; color: #cc0000;
} }
/* line 56, /Users/sven/Development/projects/travis/travis-ember/assets/stylesheets/status.sass */ /* line 58, /Users/sven/Development/projects/travis/travis-ember/assets/stylesheets/status.sass */
#workers .status { #workers .status {
background-color: #368c2a; background-color: #368c2a;
} }
/* line 59, /Users/sven/Development/projects/travis/travis-ember/assets/stylesheets/status.sass */ /* line 61, /Users/sven/Development/projects/travis/travis-ember/assets/stylesheets/status.sass */
#workers .waiting .status { #workers .waiting .status {
background-color: #368c2a; background-color: #368c2a;
} }
/* line 62, /Users/sven/Development/projects/travis/travis-ember/assets/stylesheets/status.sass */ /* line 64, /Users/sven/Development/projects/travis/travis-ember/assets/stylesheets/status.sass */
#workers .errored .status { #workers .errored .status {
background-color: #cc3d3d; background-color: #cc3d3d;
} }
/* line 65, /Users/sven/Development/projects/travis/travis-ember/assets/stylesheets/status.sass */ /* line 67, /Users/sven/Development/projects/travis/travis-ember/assets/stylesheets/status.sass */
#workers .stopped .status { #workers .stopped .status {
background-color: #999999; background-color: #999999;
} }