This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{{#each activities}} | |
{{# if equals this.verb 'cook'}} | |
{{> activity}} | |
{{else}} | |
{{> bookmark}} | |
{{/if}} | |
{{else}} | |
<div class="wrapper-message"> | |
<div class="title-message">No one is cooking yet!</div> | |
<div class="subtitle-message">Share that you made a recipe and it will show up here.</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Handlebars.registerHelper('equals', function(a1, a2) { | |
return a1 === a2; | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Template.bookmark.helpers({ | |
path: function() { | |
return Router.path('recipe', { name: this.object }); | |
}, | |
recipe: function() { | |
return RecipesData[this.object]; | |
}, | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template name="activity"> | |
{{#with object}} | |
<a href="{{path}}" class="item-activity"> | |
<span class="attribution"> | |
<span class="avatar"> | |
<img src="{{userAvatar}}" class="image-avatar"> | |
</span> | |
<span class="meta"> | |
<span class="author">{{firstName}}</span> made <span class="recipe">{{recipeTitle}}</span>: {{text}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (! this.isSimulation && loc && loc.coords) | |
activity.place = getLocationPlace(loc); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if(! this.isSimulation) { | |
var feed = Stream.feedManager.getUserFeed(this.userId); | |
feed.addActivity({ | |
'verb': 'bookmark', | |
'actor': 'users:' + Meteor.userId(), | |
'object': recipeName, | |
}).catch(function(reason) { | |
console.error('failed with reason', reason.error); | |
}); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template name="bookmark"> | |
<a href="{{path}}" class="item-activity"> | |
<span class="attribution"> | |
<span class="avatar"> | |
<img src="{{actor.services.twitter.profile_image_url_https}}" class="image-avatar"> | |
</span> | |
<span class="meta"> | |
<span class="author">{{actor.profile.name}}</span> bookmarked <span class="recipe">{{object}}</span> | |
</span> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
activities: function() { | |
return Stream.feeds.flat.find({}, {sort: {time: -1}}); | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template name="activity"> | |
{{#if equals this.verb 'cook'}} | |
{{> cook object}} | |
{{/if}} | |
{{#if equals this.verb 'bookmark'}} | |
{{> bookmark}} | |
{{/if}} | |
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template name="cook"> | |
<a href="{{path}}" class="item-activity"> | |
<span class="attribution"> | |
<span class="avatar"> | |
<img src="{{userAvatar}}" class="image-avatar"> | |
</span> | |
<span class="meta"> | |
<span class="author">{{firstName}}</span> made <span class="recipe">{{recipeTitle}}</span>: {{text}} | |
{{#if place}}<span class="location">—{{place}}</span>{{/if}} |