From 5bfdedf2b92728dcead42e2ddd2b2e07311231ce Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Fri, 30 Jan 2015 17:27:31 -0500 Subject: inject brochure page onto billing if on free plan --- .../javascripts/ui/site/EditSubscriptionModal.js | 11 ++-- public/assets/stylesheets/app.css | 32 ++++++++++- server/lib/api/subscription.js | 1 + server/lib/views/index.js | 1 - views/about/_plans.ejs | 63 ++++++++++++++++++++++ views/partials/edit-subscription.ejs | 8 +-- views/staff/_users.ejs | 3 +- 7 files changed, 109 insertions(+), 10 deletions(-) create mode 100644 views/about/_plans.ejs diff --git a/public/assets/javascripts/ui/site/EditSubscriptionModal.js b/public/assets/javascripts/ui/site/EditSubscriptionModal.js index d5eb9ac..e7e1fa5 100644 --- a/public/assets/javascripts/ui/site/EditSubscriptionModal.js +++ b/public/assets/javascripts/ui/site/EditSubscriptionModal.js @@ -17,12 +17,13 @@ var EditSubscriptionModal = ModalFormView.extend({ // this.parent = opt.parent this.__super__.initialize.call(this) - this.$freePlan = this.$("#free_plan") - this.$paidPlan = this.$("#paid_plan") + this.$freePlan = this.$(".freePlan") + this.$paidPlan = this.$(".paidPlan") this.$planRow = this.$(".planRow") this.$basicLayoutRow = this.$(".basicLayoutRow") this.$proLayoutRow = this.$(".proLayoutRow") this.$totalRow = this.$(".totalRow") + this.$planList = this.$(".planList") this.$billingInterval = this.$("[data-role=billingInterval]") @@ -71,11 +72,15 @@ var EditSubscriptionModal = ModalFormView.extend({ return this.show() }, + show: function(){ if (! this.subscriber) { this.$freePlan.show() this.$paidPlan.hide() - this.__super__.show.call(this) + this.$planList.load("/partials/plans", function(){ + this.$(".free_plan_info").remove() + this.__super__.show.call(this) + }.bind(this)) return } diff --git a/public/assets/stylesheets/app.css b/public/assets/stylesheets/app.css index 5d7199c..8184032 100755 --- a/public/assets/stylesheets/app.css +++ b/public/assets/stylesheets/app.css @@ -904,6 +904,30 @@ iframe.embed { /* PLANS BROCHURE */ /* nb these styles should be fixed for narrower screens/mobile layout */ +.planList { + position: absolute; + left: 50%; + transform: translateX(-48%); +} +.planList .about_custom { + width: 56vw; + margin: 1vw 4vw; +} +.planList .planbox { + padding: 0; +} +.mediaDrawer .planList h3 { + margin-top: 3px; + font-size: 21px; + font-weight: bold +} +.freePlan { + text-align: left; +} +.planList .planbox li:first-child { + font-size: 1.9vw; + padding: 0; +} .about_plan { width: 28vw; margin: 2vw; @@ -940,7 +964,13 @@ iframe.embed { } .planbox li { list-style-type: none; - margin-bottom: 5px; + margin-bottom: 0; + font-size: 1.3vw; + padding: 0 5.6vw; +} +.about_custom.planbox li { + padding: 10px; + font-size: 17px; } .planbox.miscbox { border: 0; diff --git a/server/lib/api/subscription.js b/server/lib/api/subscription.js index b7b3434..9c77dfc 100644 --- a/server/lib/api/subscription.js +++ b/server/lib/api/subscription.js @@ -7,6 +7,7 @@ var _ = require('lodash'), User = require('../schemas/User'), Project = require('../schemas/Project'), Layout = require('../schemas/Layout'), + Plan = require('../schemas/Plan'); Subscription = require('../schemas/Subscription'); var plan_levels = { diff --git a/server/lib/views/index.js b/server/lib/views/index.js index 89167f7..9f244c8 100644 --- a/server/lib/views/index.js +++ b/server/lib/views/index.js @@ -107,7 +107,6 @@ var views = module.exports = { partials: { plans: function (req, res){ views_middleware.ensurePlans(req, res, function(){ - console.log("<<<< +

[[- plans.free.name ]]

+ + + +
+

[[- plans.basic.name ]]

+
    +
  • $[[- plans.basic.monthly_price ]]/mo or $[[- plans.basic.yearly_price ]]/year +
  • Comes with [[- plans.basic.basic_layout_limit ]] basic floor plan and [[- plans.basic.basic_project_limit ]] exhibitions +
  • Each new basic floor plan costs $[[- plans.basic.basic_layout_monthly_price ]]/mo + or $[[- plans.basic.basic_layout_yearly_price ]]/year, minimum 3 months +
  • Each new floor plan can have up to [[- plans.basic.basic_project_limit ]] exhibitions +
  • VValls logo appears when embedding an exhibition on a web page +
  • + [[ if (! logged_in) { ]] + + [[ } else if (! user.plan_level) { ]] + + [[ } else if (user.plan_level == plan.level) { ]] + Current Level + [[ } ]] +
+
+ +
+

[[- plans.pro.name ]]

+
    +
  • $[[- plans.pro.monthly_price ]]/mo or $[[- plans.pro.yearly_price ]]/year +
  • Comes with [[- plans.pro.pro_layout_limit ]] pro floor plan and [[- plans.pro.pro_project_limit ]] exhibitions +
  • Each new pro floor plan costs $[[- plans.pro.pro_layout_monthly_price ]]/mo + or $[[- plans.pro.pro_layout_yearly_price ]]/year, minimum 3 months +
  • Each new pro floor plan can have up to [[- plans.pro.pro_project_limit ]] exhibitions +
  • Includes planning for 3D objects in the room +
  • No VValls logo on embed +
  • + [[ if (! logged_in) { ]] + + [[ } else if (! user.plan_level) { ]] + + [[ } else if (user.plan_level == plan.level) { ]] + Current Level + [[ } else if (user.plan_level < plan.level) { ]] + + [[ } ]] +
+
+ +
+
    +
  • Buying any extra floor plan unlocks collaboration.
    Invite an artist or curator to work on the exhibition with you. +
  • Basic Floor plan: Rectangle-based design of any dimension. +
  • Pro Floor plan: Trace an arbitrary floor plan from image. +
+
+ +
+

Want Something Custom?

+
  • We offer customized white-label options for business and educational uses. +
  • Contact us for more information. +
  • diff --git a/views/partials/edit-subscription.ejs b/views/partials/edit-subscription.ejs index 2f6e4c1..cc296f6 100644 --- a/views/partials/edit-subscription.ejs +++ b/views/partials/edit-subscription.ejs @@ -1,19 +1,19 @@
    X
    -
    +
    • Edit Subscription

    • -
    • +
    • You are currently using the free version of Vvalls. For access to all of Vvalls features, consider upgrading to a paid plan.

      - +
    • -
    • Your current plan level is diff --git a/views/staff/_users.ejs b/views/staff/_users.ejs index 053e289..46811b6 100644 --- a/views/staff/_users.ejs +++ b/views/staff/_users.ejs @@ -12,7 +12,8 @@
      [[- user.last_seen ]] -- cgit v1.2.3-70-g09d2