Upgraded to Meteor 1.6.0.1 and NodeJS 8.9.3. Added weekly/daily property to venues to support graphing and tracking of actual income from farmers markets (they don't usually match with expected income). Added workers objects to help illustrate who did what work (who was at the market on a specific week for example, or who prep'd and who canned a batch of jam). Fixed some bugs in the venue page. Re-design of the menu to allow for more menu options.
This commit is contained in:
@@ -181,7 +181,16 @@ Template.Venue.events({
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Template.VenueEditor.onCreated(function() {
|
||||
this.selectedType = new ReactiveVar(this.data.type);
|
||||
this.selectedFrequency = new ReactiveVar(this.data.frequency);
|
||||
});
|
||||
Template.VenueEditor.onRendered(function() {
|
||||
let schema = Meteor.collections.Venues.simpleSchema();
|
||||
|
||||
this.$('[name="type"]').buildCombo({set: schema.constants.types, selection: this.selectedType, comparator: function(a, b) {return a === b;}, textAttr: undefined, listClass: 'comboList'});
|
||||
this.$('[name="frequency"]').buildCombo({set: schema.constants.frequencies, selection: this.selectedFrequency, comparator: function(a, b) {return a === b;}, textAttr: undefined, listClass: 'comboList'});
|
||||
});
|
||||
Template.VenueEditor.helpers({
|
||||
});
|
||||
Template.VenueEditor.events({
|
||||
@@ -193,10 +202,11 @@ Template.VenueEditor.events({
|
||||
"click .editorApply": function(event, template) {
|
||||
let name = template.$("input[name='name']").val().trim();
|
||||
let type = template.$("input[name='type']").val().trim();
|
||||
let frequency = template.$("input[name='frequency']").val().trim();
|
||||
let order = 0; //TODO:
|
||||
|
||||
if(Session.get(PREFIX + 'displayNewVenue')) {
|
||||
Meteor.call("createVenue", name, type, order, function(error, result) {
|
||||
Meteor.call("createVenue", name, type, frequency, order, function(error, result) {
|
||||
if(error) sAlert.error(error);
|
||||
else {
|
||||
sAlert.success("Venue created.");
|
||||
@@ -206,7 +216,7 @@ Template.VenueEditor.events({
|
||||
});
|
||||
}
|
||||
else {
|
||||
Meteor.call("updateVenue", this._id, name, type, order, function(error, result) {
|
||||
Meteor.call("updateVenue", this._id, name, type, frequency, order, function(error, result) {
|
||||
if(error) sAlert.error(error);
|
||||
else {
|
||||
sAlert.success("Venue updated.");
|
||||
|
||||
Reference in New Issue
Block a user