2014-07-08 09:06:49 +09:00
|
|
|
var filteredModules = function (group) {
|
|
|
|
// return the modules whose positions start with group
|
|
|
|
return _.filter(postModules, function(module){return module.position.indexOf(group) == 0});
|
2014-07-07 11:49:21 +09:00
|
|
|
}
|
|
|
|
|
2014-07-04 14:07:50 +09:00
|
|
|
var post = {};
|
|
|
|
|
2014-07-05 11:24:28 +09:00
|
|
|
Template[getTemplate('post_item')].created = function () {
|
2014-07-04 14:07:50 +09:00
|
|
|
post = this.data;
|
2013-10-28 13:35:20 +09:00
|
|
|
};
|
2012-09-04 18:57:07 +09:00
|
|
|
|
2014-07-05 11:24:28 +09:00
|
|
|
Template[getTemplate('post_item')].helpers({
|
2014-07-07 09:06:32 +09:00
|
|
|
leftPostModules: function () {
|
2014-07-08 09:06:49 +09:00
|
|
|
return filteredModules('left');
|
2014-07-07 09:06:32 +09:00
|
|
|
},
|
|
|
|
centerPostModules: function () {
|
2014-07-08 09:06:49 +09:00
|
|
|
return filteredModules('center');
|
2014-07-07 09:06:32 +09:00
|
|
|
},
|
|
|
|
rightPostModules: function () {
|
2014-07-08 09:06:49 +09:00
|
|
|
return filteredModules('right');
|
2013-10-25 11:23:16 +09:00
|
|
|
},
|
2014-07-23 10:25:16 +09:00
|
|
|
getTemplate: function () {
|
|
|
|
return getTemplate(this.template);
|
|
|
|
},
|
2014-07-08 09:06:49 +09:00
|
|
|
moduleContext: function () { // not used for now
|
|
|
|
var module = this;
|
|
|
|
module.templateClass = camelToDash(this.template) + ' ' + this.position + ' cell';
|
|
|
|
module.post = post;
|
|
|
|
return module;
|
2014-07-07 11:51:59 +09:00
|
|
|
},
|
2014-07-07 12:22:42 +09:00
|
|
|
moduleClass: function () {
|
|
|
|
return camelToDash(this.template) + ' ' + this.position + ' cell';
|
2013-04-25 22:11:26 -07:00
|
|
|
}
|
2012-10-01 14:52:32 +09:00
|
|
|
});
|