我想自定义流星登录按钮助手以添加"我的帐户"选项,就像在望远镜中一样:
- https://github.com/SachaG/Telescope
在这个项目中,他们使用登录按钮助手:
- https://github.com/SachaG/Telescope/blob/master/client/views/common/nav.html
并有一些用于登录和注册的自定义模板:
- https://github.com/SachaG/Telescope/blob/master/client/views/users/user_signin.html
- https://github.com/SachaG/Telescope/blob/master/client/views/users/user_signup.html
但是我没有看到我可以在哪里为用户登录创建自定义模板,该模板将显示:
- 更改密码
- 我的帐户
- 注销
我读过:如何设置流星.js登录按钮的样式?
但这只与CSS有关
并观看:https://www.eventedmind.com/feed/97d0164c-8f71-46fe-819b-df8df3704546
但它不使用 {{loginButtons}} 帮助程序
我使用bootstrap和accounts-ui-bootstrap-dropdown。
您正在寻找的代码在这里:
Template.nav.rendered = function() {
if(!Meteor.user()) {
$('.login-link-text').text("Sign Up/Sign In");
} else {
$('#login-buttons-logout').before('<a href="/account" class="account-link button">My Account</a>');
}
};