summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--public/assets/javascripts/ui/site/EditSubscriptionModal.js21
-rw-r--r--views/partials/edit-subscription.ejs45
2 files changed, 53 insertions, 13 deletions
diff --git a/public/assets/javascripts/ui/site/EditSubscriptionModal.js b/public/assets/javascripts/ui/site/EditSubscriptionModal.js
new file mode 100644
index 0000000..1b3b859
--- /dev/null
+++ b/public/assets/javascripts/ui/site/EditSubscriptionModal.js
@@ -0,0 +1,21 @@
+
+var EditSubscriptionModal = ModalFormView.extend({
+ el: ".mediaDrawer.editSubscription",
+ action: "/api/subscription",
+ method: "put",
+
+ fixedClose: true,
+
+ events: {
+ "click [data-role='changePasswordToggle']": 'togglePasswordFields'
+ },
+
+ load: function(){
+ this.reset()
+ $.get("/api/subscription", function(data){
+
+ this.show()
+ }.bind(this))
+ },
+
+})
diff --git a/views/partials/edit-subscription.ejs b/views/partials/edit-subscription.ejs
index 0aa5281..1f8db62 100644
--- a/views/partials/edit-subscription.ejs
+++ b/views/partials/edit-subscription.ejs
@@ -7,24 +7,43 @@
<li class="section_break">
<h3>Edit Subscription</h3>
</li>
- <li>
- [[ if (! user.plan_level) { ]]
+ <div id="free_plan">
You are currently using the free plan. For access to all of Vvalls features,
consider upgrading to a paid plan.
<p>
<a href="/about/brochure">View the Plans</a>
- [[ } else { ]]
- Your current plan level is XXX
- You have been a member since XXX
- $cost/month OR $cost/year
+ </div>
+ <div id="free_plan">
+ Your current plan level is <span id="user_plan_type"></span>
+
+ <table>
+ <tr>
+ <td>Basic plan</td>
+ <td></td>
+ <td>@ $<span></span>/<span></span></td>
+ </tr>
+ <tr>
+ <td>Additional basic layouts</td>
+ <td></td>
+ <td>@ $<span></span>/<span></span></td>
+ <td>Buy more</td>
+ </tr>
+ <tr>
+ <td>Additional PRO layouts</td>
+ <td></td>
+ <td>$<span></span>/<span></span></td>
+ <td>Buy more</td>
+ </tr>
+ <tr>
+ <td>Total</td>
+ <td></td>
+ <td>$<span></span>/<span></span></td>
+ </tr>
+ </table>
+
+ <button>Upgrade your subscription</button>
- You are using N basic layouts
- Buy more
-
- You are using N pro layouts
- Buy more / Upgrade your account
-
- Cancel your subscription
+ <button>Cancel your subscription</button>
[[ } ]]
</li>
</ul>