Merge branch 'profile-new' of github.com:travis-ci/travis-web into profile-new

This commit is contained in:
Lisa Passing 2015-03-25 13:00:24 +01:00
commit de41d97229
3 changed files with 15 additions and 8 deletions

View File

@ -3,4 +3,8 @@
Controller = Ember.ArrayController.extend
tab: 'accounts'
userName: (->
@get('user.name') || @get('user.login')
).property('user.login', 'user.name')
`export default Controller`

View File

@ -4,6 +4,13 @@ Route = TravisRoute.extend
model: ->
@store.find('account', { all: true })
setupController: (controller, model) ->
user = model.filterBy('type', 'user')[0]
orgs = model.filterBy('type', 'organization')
controller.set('user', user)
controller.set('organizations', orgs)
renderTemplate: ->
@_super.apply(this, arguments)
@render 'profile_accounts', outlet: 'left', into: 'profile'

View File

@ -5,19 +5,15 @@
<img src="//placehold.it/50x50" alt="">
</div>
<div class="media-body">
<h1>Justine Arreche</h1>
<p>Repositories <strong>12</strong></p>
<p class="profile-user-last">Token: <strong>dfigsd90u34r2hwa9ru239ur2</strong></p>
<h1>{{userName}}</h1>
<p>Repositories <strong>{{user.reposCount}}</strong></p>
<p class="profile-user-last">Token: <strong>{{auth.currentUser.token}}</strong></p>
</div>
</div>
</section>
<section class="profile-orgs">
<h1>Organizations</h1>
{{#collection "accounts-list" contentBinding="controller"}}
{{#if view.account.type == user}}
hello user
{{/if}}
{{#collection "accounts-list" contentBinding="organizations"}}
{{#link-to "account" view.account class="name"}}
<div class="media">
<div class="media-elem">