start adding current user data to dashboard
This commit is contained in:
parent
8ee3f43fec
commit
81493fc479
|
@ -3,6 +3,7 @@ require 'routes/route'
|
||||||
TravisRoute = Travis.Route
|
TravisRoute = Travis.Route
|
||||||
|
|
||||||
Route = TravisRoute.extend
|
Route = TravisRoute.extend
|
||||||
|
needsAuth: true
|
||||||
activate: ->
|
activate: ->
|
||||||
@get('stylesheetsManager').disable('main')
|
@get('stylesheetsManager').disable('main')
|
||||||
@get('stylesheetsManager').enable('dashboard')
|
@get('stylesheetsManager').enable('dashboard')
|
||||||
|
|
|
@ -7,7 +7,8 @@ Route = TravisRoute.extend
|
||||||
filter: { replace: true }
|
filter: { replace: true }
|
||||||
model: ->
|
model: ->
|
||||||
apiEndpoint = @get('config').api_endpoint
|
apiEndpoint = @get('config').api_endpoint
|
||||||
$.ajax(apiEndpoint + '/repos?member=lislis', {
|
login = @controllerFor('currentUser').get('login')
|
||||||
|
$.ajax(apiEndpoint + '/repos?member='+ login, {
|
||||||
beforeSend: (xhr) ->
|
beforeSend: (xhr) ->
|
||||||
xhr.setRequestHeader('accept', 'application/json; version=2')
|
xhr.setRequestHeader('accept', 'application/json; version=2')
|
||||||
}).then (response) ->
|
}).then (response) ->
|
||||||
|
|
|
@ -15,9 +15,18 @@
|
||||||
</div> -->
|
</div> -->
|
||||||
<div class="small-2 medium-5 columns no-padding" id="user">
|
<div class="small-2 medium-5 columns no-padding" id="user">
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li class="menu">
|
||||||
<p>Justine Arreche</p>
|
<p class="handle">
|
||||||
<img src="images/dashboard/gravatar.png">
|
{{#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>
|
<ul>
|
||||||
<li>Help</li>
|
<li>Help</li>
|
||||||
<li>Sign Out</li>
|
<li>Sign Out</li>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user