summaryrefslogtreecommitdiff
path: root/public/assets/javascripts/ui/site/EditSubscriptionModal.js
diff options
context:
space:
mode:
authorJules Laplace <jules@okfoc.us>2015-01-30 01:26:46 -0500
committerJules Laplace <jules@okfoc.us>2015-01-30 01:26:46 -0500
commit1d88890a988b255c915d0472297b18a2635f6433 (patch)
tree19792d2dfd6769a2e5d2b86c7a626fa7f5b459e7 /public/assets/javascripts/ui/site/EditSubscriptionModal.js
parentf55d634b7b24b6af0fb7dd017544a79672bb1bc7 (diff)
ui boilerplate
Diffstat (limited to 'public/assets/javascripts/ui/site/EditSubscriptionModal.js')
-rw-r--r--public/assets/javascripts/ui/site/EditSubscriptionModal.js40
1 files changed, 38 insertions, 2 deletions
diff --git a/public/assets/javascripts/ui/site/EditSubscriptionModal.js b/public/assets/javascripts/ui/site/EditSubscriptionModal.js
index 1b3b859..342e8be 100644
--- a/public/assets/javascripts/ui/site/EditSubscriptionModal.js
+++ b/public/assets/javascripts/ui/site/EditSubscriptionModal.js
@@ -7,15 +7,51 @@ var EditSubscriptionModal = ModalFormView.extend({
fixedClose: true,
events: {
- "click [data-role='changePasswordToggle']": 'togglePasswordFields'
+ "click [data-role='']": 'togglePasswordFields'
+ },
+
+ initialize: function(){
+ this.$freePlan = this.$("#free_plan")
+ this.$paidPlan = this.$("#paid_plan")
+ this.$proLayoutRow = this.$("#proLayoutRow")
+
+ this.$billingInterval = this.$("[data-role=billingInterval]")
+
+ this.$planType = this.$("[data-role=planType]")
+ this.$planName = this.$("[data-role=planName]")
+ this.$planCost = this.$("[data-role=planCost]")
+
+ this.$basicLayoutCost = this.$("[data-role=basicLayoutCost]")
+ this.$basicLayoutQuantity = this.$("[data-role=basicLayoutQuantity]")
+
+ this.$proLayoutCost = this.$("[data-role=proLayoutCost]")
+ this.$proLayoutQuantity = this.$("[data-role=proLayoutQuantity]")
+
+ this.$upgradeSubscription = this.$("[data-role=upgradeSubscription]")
+ this.$cancelSubscription = this.$("[data-role=cancelSubscription]")
},
load: function(){
this.reset()
$.get("/api/subscription", function(data){
-
+ if (data.error) {
+ this.$freePlan.show()
+ this.$paidPlan.hide()
+ this.show()
+ return
+ }
+ this.$freePlan.show()
+ this.$paidPlan.hide()
+
+ var plan = data.plans[ data.subscription.plan_name ]
+
this.show()
+
+ // layouts
}.bind(this))
},
+
+ updateTotals: function(){
+ },
})