Vulcan/packages/telescope-lib/lib/base.js
2015-05-06 12:56:59 +09:00

41 lines
1.4 KiB
JavaScript

// ------------------------------------- Schemas -------------------------------- //
SimpleSchema.extendOptions({
private: Match.Optional(Boolean),
editable: Match.Optional(Boolean), // editable: true means the field can be edited by the document's owner
hidden: Match.Optional(Boolean), // hidden: true means the field is never shown in a form no matter what
editableBy: Match.Optional([String]),
publishedTo: Match.Optional([String]),
required: Match.Optional(Boolean) // required: true means the field is required to have a complete profile
// editableBy: Match.Optional(String)
});
// ------------------------------------- Views -------------------------------- //
STATUS_APPROVED = 2;
// ------------------------------ Dynamic Templates ------------------------------ //
templates = {}
// note: not used anymore, but keep for backwards compatibility
getTemplate = function (name) {
// for now, always point back to the original template
var originalTemplate = (_.invert(templates))[name];
return !!originalTemplate ? originalTemplate : name;
// if template has been overwritten, return this; else return template name
// return !!templates[name] ? templates[name] : name;
};
// ------------------------------- Vote Power -------------------------------- //
// The equation to determine voting power
// Default to returning 1 for everybody
getVotePower = function (user) {
return 1;
};