add user auth data to dashboard
This commit is contained in:
parent
81493fc479
commit
2a87f73648
|
@ -130,6 +130,14 @@ window.Auth = Ember.Object.extend
|
||||||
unless error.message =~ /Can't trigger action/
|
unless error.message =~ /Can't trigger action/
|
||||||
throw error
|
throw error
|
||||||
|
|
||||||
|
userName: (->
|
||||||
|
@get('currentUser.name') || @get('currentUser.login')
|
||||||
|
).property('currentUser.login', 'currentUser.name')
|
||||||
|
|
||||||
|
gravatarUrl: (->
|
||||||
|
"#{location.protocol}//www.gravatar.com/avatar/#{@get('currentUser.gravatarId')}?s=48&d=mm"
|
||||||
|
).property('currentUser.gravatarId')
|
||||||
|
|
||||||
Ember.onLoad 'Ember.Application', (Application) ->
|
Ember.onLoad 'Ember.Application', (Application) ->
|
||||||
Application.initializer
|
Application.initializer
|
||||||
name: "auth",
|
name: "auth",
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
<a class="signed-out" href="#" {{action "signIn" target="auth"}}>Sign in with GitHub</a>
|
<a class="signed-out" href="#" {{action "signIn" target="auth"}}>Sign in with GitHub</a>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{#if auth.signedIn}}
|
{{#if auth.signedIn}}
|
||||||
{{#link-to "profile" class="signed-in"}}<img {{bind-attr src="gravatarUrl"}}/>{{auth.currentUser.userName}}{{/link-to}}
|
{{#link-to "profile" class="signed-in"}}<img {{bind-attr src="auth.gravatarUrl"}}/>{{auth.userName}}{{/link-to}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{#if auth.signingIn}}
|
{{#if auth.signingIn}}
|
||||||
<span class="signing-in">Signing In</span>
|
<span class="signing-in">Signing In</span>
|
||||||
|
@ -29,7 +29,7 @@
|
||||||
</p>
|
</p>
|
||||||
<ul>
|
<ul>
|
||||||
<li>Help</li>
|
<li>Help</li>
|
||||||
<li>Sign Out</li>
|
<li><a href="/" {{action "signOut" target="auth"}}>Sign Out</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
|
@ -28,7 +28,7 @@ a {
|
||||||
color : #e9e9e9;
|
color : #e9e9e9;
|
||||||
line-height : 28px;
|
line-height : 28px;
|
||||||
background : #404650;
|
background : #404650;
|
||||||
overflow: hidden;
|
// overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
#logo {
|
#logo {
|
||||||
|
@ -88,7 +88,7 @@ a {
|
||||||
|
|
||||||
#top img {
|
#top img {
|
||||||
float : right;
|
float : right;
|
||||||
margin : 5px 10px 0 10px;
|
margin : -7px 10px 0 10px;
|
||||||
width : 30px;
|
width : 30px;
|
||||||
height : 30px;
|
height : 30px;
|
||||||
border-radius : 100px;
|
border-radius : 100px;
|
||||||
|
@ -108,7 +108,7 @@ a {
|
||||||
#user ul li ul {
|
#user ul li ul {
|
||||||
padding : 0;
|
padding : 0;
|
||||||
position : absolute;
|
position : absolute;
|
||||||
top : 45px;
|
top : 55px;
|
||||||
right : 0;
|
right : 0;
|
||||||
width : 150px;
|
width : 150px;
|
||||||
display : none;
|
display : none;
|
||||||
|
@ -133,6 +133,9 @@ a {
|
||||||
#user ul li ul li:hover {
|
#user ul li ul li:hover {
|
||||||
background : #5e869a;
|
background : #5e869a;
|
||||||
color : #ffffff;
|
color : #ffffff;
|
||||||
|
a {
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#user ul li:hover ul {
|
#user ul li:hover ul {
|
||||||
|
@ -140,6 +143,9 @@ a {
|
||||||
opacity : 1;
|
opacity : 1;
|
||||||
visibility : visible;
|
visibility : visible;
|
||||||
}
|
}
|
||||||
|
#user .handle a {
|
||||||
|
display: inline;
|
||||||
|
}
|
||||||
|
|
||||||
.current-org-avatar {
|
.current-org-avatar {
|
||||||
display : inline-block;
|
display : inline-block;
|
||||||
|
@ -615,7 +621,7 @@ a {
|
||||||
|
|
||||||
@media only screen and (min-width: 64.063em) {
|
@media only screen and (min-width: 64.063em) {
|
||||||
#top img {
|
#top img {
|
||||||
margin : 5px 0 0 10px;
|
margin : -7px 0 0 10px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user