logout button on your profile [ci skip]

This commit is contained in:
danielgrippi 2012-04-28 11:50:58 -07:00
parent 9a547b8161
commit accd507f36
3 changed files with 15 additions and 2 deletions

View file

@ -12,7 +12,8 @@ app.pages.Profile = app.views.Base.extend({
},
events : {
"click #edit-mode-toggle" : "toggleEdit"
"click #edit-mode-toggle" : "toggleEdit",
"click #logout-button" : "logOutConfirm"
},
tooltipSelector : "*[rel=tooltip]",
@ -49,6 +50,11 @@ app.pages.Profile = app.views.Base.extend({
this.$el.toggleClass("edit-mode")
},
logOutConfirm : function(evt) {
if(!confirm("Are you sure you want to log out?"))
evt.preventDefault();
},
isOwnProfile : function() {
return(app.currentUser.get("guid") == this.personGUID)
}

View file

@ -472,7 +472,6 @@ div[data-template=flow] {
.label {
padding : 2px 5px;
padding-right : 7px;
padding-bottom : 3px;
span {

View file

@ -19,6 +19,14 @@
</span>
</span>
</a>
{{#if isOwnProfile}}
<a href="/users/sign_out" title="Log out" id="logout-button">
<span class="label label-inverse">
<i class="icon-off icon-white"></i>
</span>
</a>
{{/if}}
</div>