diff options
| -rw-r--r-- | server/lib/views/index.js | 20 | ||||
| -rw-r--r-- | views/about/brochure.ejs | 12 |
2 files changed, 24 insertions, 8 deletions
diff --git a/server/lib/views/index.js b/server/lib/views/index.js index 5f9088b..2a8f921 100644 --- a/server/lib/views/index.js +++ b/server/lib/views/index.js @@ -4,6 +4,7 @@ var User = require('../schemas/User'), Project = require('../schemas/Project'), Documentation = require('../schemas/Documentation'), Collaborator = require('../schemas/Collaborator'), + Plan = require('../schemas/Plan'), config = require('../../../config'), marked = require('marked'), util = require('../util'), @@ -111,9 +112,11 @@ var views = module.exports = { res.render('about/' + name) return } - if (name == "brochure") { + if (name == "brochure" || name == "plans") { // TODO: fetch plans - res.render('about/' + name) + views_middleware.ensurePlans(req, res, function(){ + res.render('about/' + name) + }) return } if (name == "about" || name == "index") { @@ -224,6 +227,19 @@ var views = module.exports = { } var views_middleware = { + ensurePlans: function(req, res, next){ + Plan.find(function (err, plans) { + res.locals.plans = {} + plans.forEach(function(plan){ + res.locals.plans[ plan.slug ] = plan + "monthly_price yearly_price basic_layout_monthly_price basic_layout_yearly_price pro_layout_monthly_price pro_layout_yearly_price".split(" ").forEach(function(key){ + plan[key] = (plan[key]/100).toFixed(2)+"" + }) + }) + next() + }) + }, + fetchProjects: function (criteria, limit, offset, next) { limit = limit || 7 offset = offset || 0 diff --git a/views/about/brochure.ejs b/views/about/brochure.ejs index d816dc4..4ce558a 100644 --- a/views/about/brochure.ejs +++ b/views/about/brochure.ejs @@ -19,7 +19,7 @@ <div> <h3>[[- plans.free.name ]]</h3> <ul> - <li> One exhibition with pre-designed template floor plan + <li> [[- plans.free.stock_project_limit ]] exhibition with pre-designed template floor plan </ul> </div> @@ -27,10 +27,10 @@ <h3>[[- plans.premium.name ]]</h3> <ul> <li> $[[- plans.premium.monthly_price ]]/mo or $[[- plans.premium.yearly_price ]]/year - <li> [[- plans.premium.stock_layout_project_limit ]] exhibitions included with pre-designed template floor plans + <li> [[- plans.premium.stock_project_limit ]] exhibitions included with pre-designed template floor plans <li> Each new basic floor plan costs $[[- plans.premium.basic_layout_monthly_price ]]/mo or $[[- plans.premium.basic_layout_yearly_price ]]/year, minimum 3 months - <li> Each new basic floor plan can have up to [[- plans.premium.basic_layout_project_limit ]] exhibitions + <li> Each new basic floor plan can have up to [[- plans.premium.basic_project_limit ]] exhibitions <li> VValls logo appears when embedding an exhibition on a web page </ul> </div> @@ -39,10 +39,10 @@ <h3>[[- plans.pro.name ]]</h3> <ul> <li> $[[- plans.pro.monthly_price ]]/mo or $[[- plans.pro.yearly_price ]]/year - <li> Comes with [[- plans.premium.pro_layout_limit ]] pro floor plan and [[- plans.premium.pro_layout_project_limit ]] exhibitions + <li> Comes with [[- plans.premium.pro_layout_limit ]] pro floor plan and [[- plans.premium.pro_project_limit ]] exhibitions <li> Each new pro floor plan costs $[[- plans.pro.pro_layout_monthly_price ]]/mo or $[[- plans.pro.pro_layout_yearly_price ]]/year, minimum 3 months - <li> Each new pro floor plan can have up to [[- plans.pro.pro_layout_project_limit ]] exhibitions + <li> Each new pro floor plan can have up to [[- plans.pro.pro_project_limit ]] exhibitions <li> Includes planning for 3D objects in the room <li> No VValls logo on embed </ul> @@ -57,7 +57,7 @@ </div> <div> - Pro Floor plan: Trace an arbitrary floor plan. + Pro Floor plan: Trace an arbitrary floor plan from image. </div> |
