Created
April 15, 2015 11:31
-
-
Save guidouil/9ccbf598fb0eef8c6d3e to your computer and use it in GitHub Desktop.
Cover page (intro) schema
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
Schemas.CoverPages = new SimpleSchema({ | |
title: { | |
type: String, | |
label: 'Presentation title' | |
}, | |
date: { | |
type: Date, | |
optional: true, | |
label: "Date" | |
}, | |
logo: { | |
type: String, | |
optional: true, | |
label: "Logo" | |
}, | |
clientLogo: { | |
type: String, | |
optional: true, | |
label: "Client logo" | |
}, | |
background: { | |
type: String, | |
optional: true, | |
label: "Background picture" | |
}, | |
createdAt: { | |
type: Date, | |
autoValue: function() { | |
if (this.isInsert) { | |
return new Date(); | |
} else if (this.isUpsert) { | |
return {$setOnInsert: new Date()}; | |
} else { | |
this.unset(); | |
} | |
} | |
}, | |
updatedAt: { | |
type: Date, | |
autoValue: function() { | |
if (this.isUpdate) { | |
return new Date(); | |
} | |
}, | |
denyInsert: true, | |
optional: true | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment