From 8cd7a9a97cc69284458ac0b72e2a6afc4345b247 Mon Sep 17 00:00:00 2001 From: Ben Ramey Date: Sat, 24 May 2014 17:28:44 -0500 Subject: [PATCH] Fixed about page by adding static pages controller --- api/controllers/StaticPagesController.js | 29 +++++++++++++++++++ .../templates/invitee/update-order.jade | 2 +- config/policies.js | 4 +++ config/routes.js | 3 +- views/{ => staticPages}/about.jade | 3 +- 5 files changed, 38 insertions(+), 3 deletions(-) create mode 100644 api/controllers/StaticPagesController.js rename views/{ => staticPages}/about.jade (96%) diff --git a/api/controllers/StaticPagesController.js b/api/controllers/StaticPagesController.js new file mode 100644 index 0000000..9fbc1f4 --- /dev/null +++ b/api/controllers/StaticPagesController.js @@ -0,0 +1,29 @@ +/** + * StaticPagesController + * + * @module :: Controller + * @description :: A set of functions called `actions`. + * + * Actions contain code telling Sails how to respond to a certain type of request. + * (i.e. do stuff, then send some JSON, show an HTML page, or redirect to another URL) + * + * You can configure the blueprint URLs which trigger these actions (`config/controllers.js`) + * and/or override them with custom routes (`config/routes.js`) + * + * NOTE: The code you write here supports both HTTP and Socket.io automatically. + * + * @docs :: http://sailsjs.org/#!documentation/controllers + */ + +module.exports = { + /** + * Overrides for the settings in `config/controllers.js` + * (specific to StaticPagesController) + */ + _config: {}, + + about: function(req, res) { + return res.view(); + } + +}; diff --git a/assets/linker/templates/invitee/update-order.jade b/assets/linker/templates/invitee/update-order.jade index 0524c80..9e77e84 100644 --- a/assets/linker/templates/invitee/update-order.jade +++ b/assets/linker/templates/invitee/update-order.jade @@ -37,7 +37,7 @@ block modals .modal-dialog.modal-lg .modal-content .modal-header -   + |   button.close(type='button',data-dismiss='modal',aria-hidden='true') × .modal-body h4.hidden.modal-title#menuModalLabel Menu diff --git a/config/policies.js b/config/policies.js index fbbe360..ac02324 100644 --- a/config/policies.js +++ b/config/policies.js @@ -16,6 +16,10 @@ module.exports.policies = { '*': false, + StaticPagesController: { + '*': true + }, + RunController: { '*': false, 'find': true, diff --git a/config/routes.js b/config/routes.js index 5ba8335..e00cd59 100644 --- a/config/routes.js +++ b/config/routes.js @@ -36,7 +36,8 @@ module.exports.routes = { view: 'home/index' }, '/about': { - view: 'about' + controller: 'staticPagesController', + action: 'about' }, /* diff --git a/views/about.jade b/views/staticPages/about.jade similarity index 96% rename from views/about.jade rename to views/staticPages/about.jade index a8b8223..5bb7456 100644 --- a/views/about.jade +++ b/views/staticPages/about.jade @@ -1,4 +1,4 @@ -extends interior-page-layout +extends ../interior-page-layout block pagetitle span.glyphicon.glyphicon-question-sign @@ -41,6 +41,7 @@ block interiorcontent .col-xs-12.col-sm-4 h2 Recent updates ul + li [5/24/14] Fixed this page! li [5/15/14] Moved nav, "rebranded" lunch run me to lunch run|me li [5/13/14] Added meta tags li [5/13/14] Added validation messaging to create-run form