This commit is contained in:
Sacha Greif 2014-07-13 11:32:37 +09:00
parent fe3745e1e3
commit fabdf09c7b
2 changed files with 9 additions and 6 deletions

View file

@ -4,6 +4,7 @@ Some of the improvements planned for the next versions of Telescope. Email [hell
[Fixing issues](https://github.com/TelescopeJS/Telescope/issues) is also a great way to pitch in :)
- Get rid of default user account dropdown.
- Better user profiles.
- Better user dashboard (with search).
- Implement real reactive joins.

View file

@ -31,13 +31,9 @@ Template[getTemplate('nav')].helpers({
}
});
Template[getTemplate('nav')].rendered=function(){
if(!Meteor.user()){
Template[getTemplate('nav')].rendered = function(){
if(!Meteor.loggingIn() && !Meteor.user()){
$('.login-link-text').text("Sign Up/Sign In");
}else{
$('#login-buttons-logout').before('<a href="/users/'+Meteor.user().slug+'" class="account-link button">View Profile</a>');
$('#login-buttons-logout').before('<a href="/account" class="account-link button">Edit Account</a>');
}
};
@ -53,5 +49,11 @@ Template[getTemplate('nav')].events({
'click .login-header': function(e){
e.preventDefault();
Router.go('/account');
},
'click #login-name-link': function(e){
if(Meteor.user() && !$('account-link').exists()){
$('#login-buttons-logout').before('<a href="/users/'+Meteor.user().slug+'" class="account-link button">View Profile</a>');
$('#login-buttons-logout').before('<a href="/account" class="account-link button">Edit Account</a>');
}
}
});