mirror of
https://github.com/vale981/Vulcan
synced 2025-03-06 10:01:40 -05:00
improving blank package
This commit is contained in:
parent
5a868730da
commit
4155fb22a1
8 changed files with 61 additions and 12 deletions
|
@ -1,14 +1,36 @@
|
|||
// Custom Post Property
|
||||
|
||||
var customProperty = {
|
||||
propertyName: 'customProperty',
|
||||
propertySchema: {
|
||||
type: String, // property type
|
||||
label: 'customLabel', // key string used for internationalization
|
||||
optional: true, // make this property optional
|
||||
type: String, // property type
|
||||
label: 'customLabel', // key string used for internationalization
|
||||
optional: true, // make this property optional
|
||||
autoform: {
|
||||
editable: true, // make this property editable by users
|
||||
group: 'xyz', // assign a custom form group
|
||||
type: "bootstrap-datetimepicker" // assign a custom input type
|
||||
editable: true, // make this property editable by users
|
||||
type: "bootstrap-datetimepicker" // assign a custom input type
|
||||
}
|
||||
}
|
||||
}
|
||||
addToPostSchema.push(customProperty);
|
||||
|
||||
// Custom Setting
|
||||
|
||||
var customSetting = {
|
||||
propertyName: 'customSetting',
|
||||
propertySchema: {
|
||||
type: String,
|
||||
optional: true,
|
||||
autoform: {
|
||||
group: 'customGroup', // assign custom group (fieldset) in Settings form
|
||||
private: true // mark as private (not published to client)
|
||||
}
|
||||
}
|
||||
}
|
||||
addToSettingsSchema.push(customSetting);
|
||||
|
||||
// Global Function
|
||||
|
||||
myFunction = function (a, b) {
|
||||
return a + b;
|
||||
}
|
|
@ -0,0 +1,3 @@
|
|||
<template name="customTemplate">
|
||||
Hi there, {{name}}!
|
||||
</template>
|
|
@ -0,0 +1,9 @@
|
|||
Meteor.startup(function () {
|
||||
|
||||
Template[getTemplate('customTemplate')].helpers({
|
||||
name: function () {
|
||||
return "Bruce Willis";
|
||||
}
|
||||
});
|
||||
|
||||
});
|
8
packages/telescope-blank/lib/routes.js
Normal file
8
packages/telescope-blank/lib/routes.js
Normal file
|
@ -0,0 +1,8 @@
|
|||
Meteor.startup(function () {
|
||||
|
||||
Router.route('/custom-path', {
|
||||
name: 'customRoute',
|
||||
template: getTemplate('customTemplate')
|
||||
});
|
||||
|
||||
});
|
3
packages/telescope-blank/lib/server/publications.js
Normal file
3
packages/telescope-blank/lib/server/publications.js
Normal file
|
@ -0,0 +1,3 @@
|
|||
Meteor.publish('customPublication', function (limit) {
|
||||
return Posts.find({}, {limit: limit});
|
||||
});
|
|
@ -19,7 +19,8 @@ Package.onUse(function (api) {
|
|||
'iron:router', // routing package
|
||||
'telescope-base', // basic Telescope hooks and objects
|
||||
'telescope-lib', // useful functions
|
||||
'telescope-i18n' // internationalization wrapper
|
||||
'telescope-i18n', // internationalization wrapper
|
||||
'fourseven:scss' // SCSS compilation package
|
||||
]);
|
||||
|
||||
// client
|
||||
|
@ -47,19 +48,22 @@ Package.onUse(function (api) {
|
|||
// both
|
||||
|
||||
api.add_files([
|
||||
'lib/both.js'
|
||||
'lib/both.js',
|
||||
'lib/routes.js'
|
||||
], ['client', 'server']);
|
||||
|
||||
// client
|
||||
|
||||
api.add_files([
|
||||
'lib/client/client_only.js'
|
||||
'lib/client/templates/template.html',
|
||||
'lib/client/templates/template.js',
|
||||
'lib/client/scss/package.scss'
|
||||
], ['client']);
|
||||
|
||||
// server
|
||||
|
||||
api.add_files([
|
||||
'lib/server/server_only.js'
|
||||
'lib/server/publications.js'
|
||||
], ['server']);
|
||||
|
||||
// i18n languages (must come last)
|
||||
|
@ -76,7 +80,7 @@ Package.onUse(function (api) {
|
|||
// -------------------------------- 3. Variables to export --------------------------------
|
||||
|
||||
api.export([
|
||||
//
|
||||
'myFunction'
|
||||
]);
|
||||
|
||||
});
|
Loading…
Add table
Reference in a new issue