diff options
Diffstat (limited to 'client/components/users/helpers.js')
-rw-r--r-- | client/components/users/helpers.js | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/client/components/users/helpers.js b/client/components/users/helpers.js new file mode 100644 index 00000000..33867298 --- /dev/null +++ b/client/components/users/helpers.js @@ -0,0 +1,27 @@ +Template.userAvatar.helpers({ + userData: function() { + if (! this.user) { + this.user = Users.findOne(this.userId); + } + return this.user; + }, + memberType: function() { + var userId = this.userId || this.user._id; + var user = Users.findOne(userId); + return user && user.isBoardAdmin() ? 'admin' : 'normal'; + } +}); + +Template.setLanguagePopup.helpers({ + languages: function() { + return _.map(TAPi18n.getLanguages(), function(lang, tag) { + return { + tag: tag, + name: lang.name + }; + }); + }, + isCurrentLanguage: function() { + return this.tag === TAPi18n.getLanguage(); + } +}); |