Updated to nearly fully functional. Pre-release 1. Still needs some UI changes in the slideshow and admin pages (move the save button & fix the save detection for the internship list). Customer had one more page change request which I need to re-define and handle.

This commit is contained in:
Wynne Crisman
2018-12-12 11:04:00 -08:00
parent c0e971774e
commit 3fc374eda3
108 changed files with 3472 additions and 628 deletions

View File

@@ -0,0 +1,33 @@
import './EditablePage.html';
let routeData = {
Appreciation: {name: "Appreciation"},
News: {name: "News"},
ImportantDates: {name: "Dates"},
CurrentBoard: {name: "Board"}
};
Tracker.autorun(function() {
Meteor.subscribe("pages");
});
Template.EditablePage.onCreated(function() {
let template = this;
this.pageName = new ReactiveVar();
Tracker.autorun(function() {
if(routeData[FlowRouter.getRouteName()]) {
//Save the page's name (indexes the page HTML in the collection) to the reactive variable so that all the content changes automatically.
template.pageName.set(routeData[FlowRouter.getRouteName()].name);
}
});
});
Template.EditablePage.helpers({
editableHTML: function() {
let doc = Meteor.collections.Pages.findOne({name: Template.instance().pageName.get()});
return doc === undefined ? "" : doc.html;
}
});