|
@@ -6,6 +6,23 @@
|
|
Meteor.subscribe("documents");
|
|
Meteor.subscribe("documents");
|
|
Meteor.subscribe("editingUsers");
|
|
Meteor.subscribe("editingUsers");
|
|
|
|
|
|
|
|
+Router.configure({
|
|
|
|
+ layoutTemplate: "ApplicationLayout"
|
|
|
|
+});
|
|
|
|
+
|
|
|
|
+Router.route("/", function () {
|
|
|
|
+ Meteor._debug("Routing /");
|
|
|
|
+ this.render("navbar", { to: "header" });
|
|
|
|
+ this.render("docList", { to: "main" });
|
|
|
|
+});
|
|
|
|
+Router.route("/documents/:_id", function () {
|
|
|
|
+ Meteor._debug("Routing /documents/" + this.params._id);
|
|
|
|
+ Session.set("docid", this.params._id);
|
|
|
|
+ this.render("navbar", { to: "header" });
|
|
|
|
+ this.render("docItem", { to: "main" });
|
|
|
|
+});
|
|
|
|
+
|
|
|
|
+
|
|
Template.editor.helpers({
|
|
Template.editor.helpers({
|
|
// Return the id of the first document you can find.
|
|
// Return the id of the first document you can find.
|
|
docid: function () {
|
|
docid: function () {
|
|
@@ -61,6 +78,13 @@ Template.navbar.helpers({
|
|
}
|
|
}
|
|
});
|
|
});
|
|
|
|
|
|
|
|
+Template.docList.helpers({
|
|
|
|
+ // Retrieve a list of documents.
|
|
|
|
+ documents: function () {
|
|
|
|
+ return Documents.find();
|
|
|
|
+ }
|
|
|
|
+});
|
|
|
|
+
|
|
Template.docMeta.helpers({
|
|
Template.docMeta.helpers({
|
|
// Find current document.
|
|
// Find current document.
|
|
document: function () {
|
|
document: function () {
|