start adding current user data to dashboard

This commit is contained in:
Lisa Passing 2015-01-26 12:58:55 +01:00
parent 8ee3f43fec
commit 81493fc479
3 changed files with 15 additions and 4 deletions

View File

@ -3,6 +3,7 @@ require 'routes/route'
TravisRoute = Travis.Route
Route = TravisRoute.extend
needsAuth: true
activate: ->
@get('stylesheetsManager').disable('main')
@get('stylesheetsManager').enable('dashboard')

View File

@ -7,7 +7,8 @@ Route = TravisRoute.extend
filter: { replace: true }
model: ->
apiEndpoint = @get('config').api_endpoint
$.ajax(apiEndpoint + '/repos?member=lislis', {
login = @controllerFor('currentUser').get('login')
$.ajax(apiEndpoint + '/repos?member='+ login, {
beforeSend: (xhr) ->
xhr.setRequestHeader('accept', 'application/json; version=2')
}).then (response) ->

View File

@ -15,9 +15,18 @@
</div> -->
<div class="small-2 medium-5 columns no-padding" id="user">
<ul>
<li>
<p>Justine Arreche</p>
<img src="images/dashboard/gravatar.png">
<li class="menu">
<p class="handle">
{{#if auth.signedOut}}
<a class="signed-out" href="#" {{action "signIn" target="auth"}}>Sign in with GitHub</a>
{{/if}}
{{#if auth.signedIn}}
{{#link-to "profile" class="signed-in"}}<img {{bind-attr src="gravatarUrl"}}/>{{auth.currentUser.userName}}{{/link-to}}
{{/if}}
{{#if auth.signingIn}}
<span class="signing-in">Signing In</span>
{{/if}}
</p>
<ul>
<li>Help</li>
<li>Sign Out</li>