travis-web/assets/scripts/app/views/accounts.coffee

35 lines
1021 B
CoffeeScript

@Travis.reopen
ProfileAccountsView: Travis.BasicView.extend
tabBinding: 'controller.tab'
templateName: 'profile/accounts'
classAccounts: (->
'active' if @get('tab') == 'accounts'
).property('tab')
AccountsListView: Em.CollectionView.extend
elementId: 'accounts'
accountBinding: 'content'
tagName: 'ul'
emptyView: Ember.View.extend
template: Ember.Handlebars.compile('<div class="loading"><span>Loading</span></div>')
itemViewClass: Travis.BasicView.extend
accountBinding: 'content'
typeBinding: 'content.type'
selectedBinding: 'account.selected'
classNames: ['account']
classNameBindings: ['type', 'selected']
name: (->
@get('content.name') || @get('content.login')
).property('content.login', 'content.name')
urlAccount: (->
Travis.Urls.account(@get('account.login'))
).property('account.login')
click: ->
@get('controller').transitionToRoute("account", @get('account.login'))