summaryrefslogtreecommitdiff
path: root/public/assets
diff options
context:
space:
mode:
Diffstat (limited to 'public/assets')
-rw-r--r--public/assets/javascripts/ui/site/EditSubscriptionModal.js31
-rwxr-xr-xpublic/assets/stylesheets/app.css11
2 files changed, 38 insertions, 4 deletions
diff --git a/public/assets/javascripts/ui/site/EditSubscriptionModal.js b/public/assets/javascripts/ui/site/EditSubscriptionModal.js
index 0f72995..619bff8 100644
--- a/public/assets/javascripts/ui/site/EditSubscriptionModal.js
+++ b/public/assets/javascripts/ui/site/EditSubscriptionModal.js
@@ -35,6 +35,11 @@ var EditSubscriptionModal = ModalView.extend({
this.$planCost = this.$("[data-role=planCost]")
this.$planTotal = this.$("[data-role=planTotal]")
+ this.$basicPlanName = this.$("[data-role=basicPlanName]")
+ this.$proPlanName = this.$("[data-role=proPlanName]")
+ this.$basicPlanCost = this.$("[data-role=basicPlanCost]")
+ this.$proPlanCost = this.$("[data-role=proPlanCost]")
+
this.$basicLayoutCost = this.$("[data-role=basicLayoutCost]")
this.$basicLayoutQuantity = this.$("[data-role=basicLayoutQuantity]")
this.$basicLayoutTotal = this.$("[data-role=basicLayoutTotal]")
@@ -43,8 +48,24 @@ var EditSubscriptionModal = ModalView.extend({
this.$proLayoutQuantity = this.$("[data-role=proLayoutQuantity]")
this.$proLayoutTotal = this.$("[data-role=proLayoutTotal]")
+ this.$showLayoutsMenu = this.$("[data-role=showLayoutsMenu]")
+ this.$showPlanMenu = this.$("[data-role=showPlanMenu]")
+
+ this.$layoutsMenu = this.$("[data-role=layoutsMenu]")
+ this.$planMenu = this.$("[data-role=planMenu]")
+ this.$closeMenu = this.$("[data-role=closeMenu]")
+
+ this.$buyLayouts = this.$("[data-role=buyLayouts]")
+
+ this.$changePlan = this.$("[data-role=changePlan]")
+
+ this.$basicLayoutInput = this.$("[data-role=basicLayoutInput]")
+ this.$proLayoutInput = this.$("[data-role=proLayoutInput]")
+ this.$planRadio = this.$("[name=planRadio]")
+
this.$upgradeSubscription = this.$("[data-role=upgradeSubscription]")
this.$cancelSubscription = this.$("[data-role=cancelSubscription]")
+
this.$gear = this.$(".gear")
},
@@ -100,7 +121,7 @@ var EditSubscriptionModal = ModalView.extend({
var t = {}
t.is_pro = plan.name == "pro"
t.is_monthly = subscriber.plan_period == "monthly"
- t.plan_price = t.is_monthly ? plan.monthly_price : plan.yearly_price
+ t.plan_price = t.is_monthly ? plan.basic_layout_monthly_price : plan.yearly_price
t.basic_layout_price = t.is_monthly ? plan.basic_layout_monthly_price : plan.basic_layout_yearly_price
t.basic_layout_total = subscriber.basic_layouts * t.basic_layout_price
t.pro_layout_price = t.is_monthly ? plan.pro_layout_monthly_price : plan.pro_layout_yearly_price
@@ -113,12 +134,18 @@ var EditSubscriptionModal = ModalView.extend({
var subscriber = this.subscriber
var plan = this.plans[ this.plan_levels[ subscriber.plan_type ] ]
var totals = this.calculateTotals(subscriber, plan)
+
+ this.$basicPlanName.html ( this.plans[1].name )
+ this.$proPlanName.html ( this.plans[2].name )
+ this.$basicPlanCost.toDollars ( totals.is_monthly ? this.plans[1].monthly_price : this.plans[2].yearly_price)
+ this.$proPlanCost.toDollars ( totals.is_monthly ? this.plans[2].monthly_price : this.plans[2].yearly_price)
this.$planName.html ( plan.name )
this.$planCost.toDollars ( totals.plan_price )
this.$billingInterval.html ( totals.is_monthly ? "mo." : "yr." )
- this.$proLayoutRow.toggle ( totals.is_pro )
+ this.$basicLayoutRow.toggle ( subscriber.basic_layouts > 0 )
+ this.$proLayoutRow.toggle ( totals.is_pro && subscriber.pro_layouts > 0)
this.$basicLayoutCost.toDollars ( totals.basic_layout_price )
this.$basicLayoutQuantity.html ( subscriber.basic_layouts )
diff --git a/public/assets/stylesheets/app.css b/public/assets/stylesheets/app.css
index 082a2d4..4144b8b 100755
--- a/public/assets/stylesheets/app.css
+++ b/public/assets/stylesheets/app.css
@@ -987,6 +987,8 @@ iframe.embed {
font-size: 1.9vw;
padding: 0;
}
+
+/* debug sync button */
.editSubscription .gear {
position: absolute;
top: 10px;
@@ -1053,8 +1055,13 @@ iframe.embed {
background: red;
border-color: red;
}
-
-
+/* purchase mode */
+.paidPlan input[type=number] { display: none }
+.paidPlan.editing input[type=number] { display: inline-block }
+.paidPlan.editing input[type=number]+span { display: none }
+form .paidPlan div { float: none; }
+form .paidPlan label { float: none; font-size: 2vw; margin: 0 10px; }
+.paidPlan .upgradeMenu div { padding: 5px 10px; }
/* LAYOUTS MODAL */