mirror of
https://github.com/vale981/Vulcan
synced 2025-03-10 04:26:41 -04:00
23 lines
No EOL
622 B
JavaScript
23 lines
No EOL
622 B
JavaScript
Template[getTemplate('postViewsNav')].helpers({
|
|
viewsMenu: function () {
|
|
return viewsMenu;
|
|
},
|
|
itemRoute: function () {
|
|
return Router.path(this.route);
|
|
},
|
|
itemClass: function () {
|
|
var itemClass = "";
|
|
if (this.adminOnly) {
|
|
itemClass += " admin-item";
|
|
}
|
|
return itemClass;
|
|
},
|
|
showItem: function () {
|
|
// if item is not in postsViews setting, or item is adminOnly but current user is not admin
|
|
if (!_.contains(getSetting('postsViews'), this.route) || (this.adminOnly && !isAdmin(Meteor.user()))) {
|
|
// don't show the item
|
|
return false
|
|
}
|
|
return true;
|
|
}
|
|
}); |