Skip to content

Instantly share code, notes, and snippets.

View lamalex's full-sized avatar

Alex Launi lamalex

View GitHub Profile
extends layout
block body
div
div(ng-controller="BrassCanklesController")
h2 PAST
div(ng-repeat="video in videos")
| {{video.content}}
div(ng-view)
h2 PRESENT
extends layout
block body
div
div(ng-controller="BrassCanklesController")
h2 PAST
div(ng-repeat="video in videos")
!= {{video.content}}
div(ng-view)
h2 PRESENT
Handlebars.registerHelper('ifCond', function (v1, operator, v2, options) {
switch (operator) {
case '==':
return (v1 == v2) ? options.fn(this) : options.inverse(this);
break;
case '===':
return (v1 === v2) ? options.fn(this) : options.inverse(this);
break;
case '<':
Exception while bundling application:
Error: Parse error on line 3:
...t"> {{#ifCond 1 === 1}} <a href
----------------------^
Expecting 'CLOSE', 'DATA', 'STRING', 'INTEGER', 'BOOLEAN', 'ID', got 'EQUALS'
at Object.parseError (/Users/alexlauni/.meteorite/meteors/meteor/meteor/5d736d4bf0448c7db1f9b47124dfafc34a9631bb/dev_bundle/lib/node_modules/handlebars/lib/handlebars/compiler/parser.js:103:11)
at Object.parse (/Users/alexlauni/.meteorite/meteors/meteor/meteor/5d736d4bf0448c7db1f9b47124dfafc34a9631bb/dev_bundle/lib/node_modules/handlebars/lib/handlebars/compiler/parser.js:155:22)
at Object.Handlebars.parse (/Users/alexlauni/.meteorite/meteors/meteor/meteor/5d736d4bf0448c7db1f9b47124dfafc34a9631bb/dev_bundle/lib/node_modules/handlebars/lib/handlebars/compiler/base.js:9:28)
at Object.Handlebars.to_json_ast (/Users/alexlauni/.meteorite/meteors/meteor/meteor/5d736d4bf0448c7db1f9b47124dfafc34a9631bb/packages/handlebars/parse.js:40:31)
at Object.html_scanner._handleTag (/Users/alexlauni/
Handlebars.registerHelper('isYoutubeIframe', function (type) {
return type == "youtube/iframe";
});
<template name="relicItem">
<div class="post">
<div class="post-content">
<a href="{{relicPagePath this}}">
{{#isYoutubeIframe type}}
{{resource}}
{{/isYoutubeIframe}}
{{#isImage type}}
<img src="{{resource}}" />
{{/isImage}}
Meteor.Router.add({
'/': 'relicsList',
'/:_id': {
to: 'relicPage',
and: function(id) { Session.set('currentRelicId', id); }
},
'/new': 'newRelic'
});
<template name="newRelic">
<div class="droparea">
Drag and drop a picture, sound, or video if you want to show it to Portland DIY
</div>
</template>
<template name="relicsPast">
<div class="relics past">
<h2>PAST</h2>
{{#each relics}}
{{#if published}}
<div class="post">
<div class="post-content">
{{> relicItem}}
</div>
</div>
Template.relicsPast.helpers({
relics: function() {
return Relics.find({datestamp: {$lt: getYesterday() }}, {limit: pastRelicsHandle.limit()});
},
relicsReady: function() {
console.log(pastRelicsHandle.loading());
return !pastRelicsHandle.loading();
},
allRelicsLoaded: function() {
return !pastRelicsHandle.loading() && Relics.find({datestamp: {$lt: getYesterday()}}).count() < pastRelicsHandle.loaded();