I'm trying to create a Member Directory. This is a public list of all invited users with links back to their complete profiles.
// server/member_publication.js
Meteor.publish("members", function () {
return Meteor.users.find({isInvited: true});
});
// members.js
Router.route('/members', {
name: 'members',
loadingTemplate: 'loadingWeld',
template: getTemplate('membersPage'),
waitOn: function() {
return Meteor.subscribe('members');
},
fastRender: true
});
<!-- members_page.html -->
<template name="membersPage">
{{#each members}}
{{> memberItem}}
{{/each}}
</template>
<!-- member_item.html -->
<template name="memberItem">
<a class="member-wrap" href="{{profileUrl this}}" target="_blank">
<div class="member">
{{> avatar user=this size="large" shape="circle"}}
<div class="username">{{profile.name}}</div>
<div class="profile-skills">Specialties: {{profile.skills}}</div>
<div class="profile-location">Location: {{profile.location}}</div>
</div>
<div class="about">
<div class="username">{{profile.name}}</div>
<p class="profile-blurb truncate">{{profile.bio}}</p>
<p class="view-more">View Profile</p>
</div>
</a>
</template>
// members_page.js
Template[getTemplate('membersPage')].helpers({
members: function () {
return Meteor.users.find();
}
});
Template.memberItem.rendered = function (){
$("p.truncate").dotdotdot({
watch: "window"
});
};