publish and subscribe
This commit is contained in:
parent
2c4b480e9d
commit
cdd2cd99ab
@ -17,7 +17,6 @@ standard-minifier-js@1.1.8 # JS minifier run for production mode
|
|||||||
es5-shim@4.6.13 # ECMAScript 5 compatibility for older browsers.
|
es5-shim@4.6.13 # ECMAScript 5 compatibility for older browsers.
|
||||||
ecmascript@0.5.7 # Enable ECMAScript2015+ syntax in app code
|
ecmascript@0.5.7 # Enable ECMAScript2015+ syntax in app code
|
||||||
|
|
||||||
autopublish@1.0.7 # Publish all data to the clients (for prototyping)
|
|
||||||
insecure@1.0.7 # Allow all DB writes from clients (for prototyping)
|
insecure@1.0.7 # Allow all DB writes from clients (for prototyping)
|
||||||
fortawesome:fontawesome
|
fortawesome:fontawesome
|
||||||
session
|
session
|
||||||
|
|||||||
@ -6,7 +6,6 @@ accounts-ui-unstyled@1.1.12
|
|||||||
alanning:roles@1.2.15
|
alanning:roles@1.2.15
|
||||||
aldeed:simple-schema@1.5.3
|
aldeed:simple-schema@1.5.3
|
||||||
allow-deny@1.0.5
|
allow-deny@1.0.5
|
||||||
autopublish@1.0.7
|
|
||||||
autoupdate@1.2.11
|
autoupdate@1.2.11
|
||||||
babel-compiler@6.9.0
|
babel-compiler@6.9.0
|
||||||
babel-runtime@0.1.10
|
babel-runtime@0.1.10
|
||||||
|
|||||||
@ -4,7 +4,9 @@ import {
|
|||||||
|
|
||||||
import './main.html';
|
import './main.html';
|
||||||
|
|
||||||
|
Meteor.subscribe('schools');
|
||||||
|
Meteor.subscribe('classes');
|
||||||
|
Meteor.subscribe('work');
|
||||||
var openValues = {
|
var openValues = {
|
||||||
"menu": "-25%",
|
"menu": "-25%",
|
||||||
"options": "-20%"
|
"options": "-20%"
|
||||||
|
|||||||
@ -2,6 +2,11 @@ import {
|
|||||||
Template
|
Template
|
||||||
} from 'meteor/templating';
|
} from 'meteor/templating';
|
||||||
|
|
||||||
|
|
||||||
|
Meteor.subscribe('schools');
|
||||||
|
Meteor.subscribe('classes');
|
||||||
|
Meteor.subscribe('work');
|
||||||
|
|
||||||
Session.set("profInputOpen", null);
|
Session.set("profInputOpen", null);
|
||||||
Session.set("profClassTab", "manClass");
|
Session.set("profClassTab", "manClass");
|
||||||
Session.set("modifying", null);
|
Session.set("modifying", null);
|
||||||
|
|||||||
@ -6,7 +6,6 @@ schools.schema = new SimpleSchema({
|
|||||||
name: {type: String},
|
name: {type: String},
|
||||||
status: {type: Boolean},
|
status: {type: Boolean},
|
||||||
creator: {type: String},
|
creator: {type: String},
|
||||||
aliases: {type: [String]}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
classes.schema = new SimpleSchema({
|
classes.schema = new SimpleSchema({
|
||||||
@ -30,7 +29,6 @@ work.schema = new SimpleSchema({
|
|||||||
name: {type: String},
|
name: {type: String},
|
||||||
class: {type: String},
|
class: {type: String},
|
||||||
dueDate: {type: Date},
|
dueDate: {type: Date},
|
||||||
aliases: {type: [String], optional: true},
|
|
||||||
submittor: {type: String, optional: true},
|
submittor: {type: String, optional: true},
|
||||||
confirmations: {type: [String], optional: true},
|
confirmations: {type: [String], optional: true},
|
||||||
reports: {type: [String], optional: true},
|
reports: {type: [String], optional: true},
|
||||||
|
|||||||
@ -32,7 +32,7 @@ Meteor.publish('schools', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
Meteor.publish('classes', function() {
|
Meteor.publish('classes', function() {
|
||||||
if (Roles.userIsInRole(Meteor.userId(), ['superadmin', 'admin'])) {
|
if (Roles.userIsInRole(this.userId, ['superadmin', 'admin'])) {
|
||||||
return classes.find();
|
return classes.find();
|
||||||
} else {
|
} else {
|
||||||
return classes.find({
|
return classes.find({
|
||||||
@ -40,7 +40,7 @@ Meteor.publish('classes', function() {
|
|||||||
privacy: false
|
privacy: false
|
||||||
}, {
|
}, {
|
||||||
_id: {
|
_id: {
|
||||||
$in: Meteor.user().profile.classes
|
$in: this.user().profile.classes
|
||||||
}
|
}
|
||||||
}]
|
}]
|
||||||
}, {
|
}, {
|
||||||
@ -63,12 +63,12 @@ Meteor.publish('classes', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
Meteor.publish('work', function() {
|
Meteor.publish('work', function() {
|
||||||
if (Roles.userIsInRole(Meteor.userId(), ['superadmin', 'admin'])) {
|
if (Roles.userIsInRole(this.userId, ['superadmin', 'admin'])) {
|
||||||
return work.find();
|
return work.find();
|
||||||
} else {
|
} else {
|
||||||
return work.find({
|
return work.find({
|
||||||
class: {
|
class: {
|
||||||
$in: Meteor.user().profile.classes
|
$in: this.user().profile.classes
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user