client.js 577 B

123456789101112131415161718192021222324252627282930
  1. /**
  2. * Configure accounts-ui.
  3. */
  4. Accounts.ui.config({
  5. passwordSignupFields: "USERNAME_ONLY"
  6. });
  7. // Routing.
  8. Router.configure({
  9. layoutTemplate: "layout"
  10. });
  11. Router.route("/", function () {
  12. this.render("page_home", { to: "contents" });
  13. });
  14. Router.route("/site/:id", function () {
  15. console.log(this.parms);
  16. const id = this.params.id;
  17. const doc = _.extend({ onPage: true }, Websites.findOne({ _id: id }));
  18. this.render("page_site", {
  19. to: "contents",
  20. data: function () {
  21. return doc;
  22. }
  23. });
  24. this.render("comments", {
  25. to: "comments"
  26. });
  27. });