-
Notifications
You must be signed in to change notification settings - Fork 5
/
upgrade_plan.html
204 lines (194 loc) · 8.23 KB
/
upgrade_plan.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
{% extends 'base.html' %} {% load static %} {% block title %}Update Plan
information{% endblock %} {% block content %}
<div class="card card-body card-inner">
{% if banner_msg %}
<div class="row w-100 justify-content-left mb-4">
<div class="col text-center">
<div class="alert alert-primary" role="alert">
<p class="lead" style="font-weight:600">{{banner_msg}}</p>
</div>
</div>
</div>
{% endif %}
<div class="row w-100 justify-content-between mb-4">
<div class="col col-auto">
<a class="btn btn-link" href="{% url 'user_settings' %}"><i class="fas fa-arrow-left"></i> Settings</a>
</div>
<div class="col col-auto">
<div class="row">
{% if plan_duration == "monthly" %}
<div class="col m-0 pr-0">
<a class="btn btn-primary border-right-0 rounded-right-0" href="/billing/upgrade/monthly/">Monthly</a>
</div>
<div class="col m-0 pl-0">
<a class="btn btn-outline-primary border-left-0 rounded-left-0" href="/billing/upgrade/yearly/">Yearly</a>
</div>
{% else %}
<div class="col m-0 pr-0">
<a class="btn btn-outline-primary border-right-0 rounded-right-0" href="/billing/upgrade/monthly/">Monthly</a>
</div>
<div class="col m-0 pl-0">
<a class="btn btn-primary border-left-0 rounded-left-0" href="/billing/upgrade/yearly/">Yearly</a>
</div>
{% endif %}
</div>
</div>
</div>
<div class="container justify-content-center">
<div class="card-deck px-0">
<div class="card card-outer {% if current_plan.name == 'Free' %}selected-plan{% endif %}">
<div class="card-body">
<h2 class="card-title" style="font-weight:500">
Free {% if current_plan.name == 'free' %}<a href="#" class="btn btn-link float-right my-0">
<i class="fas fa-check-circle"></i> </a>{% endif %}
</h2>
<p class="lead">Public viewing and publishing for everyone.</p>
<ul class="my-4 pl-3">
<li>Unlimited public publishing.</li>
<li>Unlimited public modeling with free apps.</li>
<li>Unlimited public collaborators and teams.</li>
<li>3 free private simulations per month.</li>
</ul>
{% if current_plan.name != 'free' %}
{% if cancel_at_period_end %}
<div class="text-center">
<button type="button" class="btn btn-primary text-center" style="white-space: normal" data-toggle="modal"
data-target="#freeModal" disabled>
<strong>
Downgrade scheduled for {{cancel_at}}
</strong>
</a>
</div>
{% else %}
<div class="text-center">
<button type="button" class="btn btn-primary text-center" data-toggle="modal" data-target="#freeModal">
<strong>
Downgrade
</strong>
</a>
</div>
{% endif %}
{% endif %}
</div>
<div class="card-footer border-top-0 background-color-inherit">
<h2 class="text-center">$0</h2>
<h4 class="text-center">Per month</h4>
<small class="text-center text-muted">Additional fees may apply for using paid apps.</small>
</div>
</div>
<div class="card card-outer">
<div class="card-body">
<h2 class="card-title" style="font-weight:500">Pro
{% if current_plan.name == 'pro' and current_plan.plan_duration == plan_duration %}<a href="#"
class="btn btn-link float-right my-0">
<i class="fas fa-check-circle"></i> </a>{% endif %}</h2>
<p class="lead">Unlimited private collaboration for pros.</p>
<ul class="my-4 pl-3">
<li>Unlimited private publishing.</li>
<li>Unlimited private modeling.</li>
<li>Unlimited private collaborators and teams.</li>
<li>Choose which sites are allowed to embed your apps.</li>
<li class="pt-4">Support the open source development of Compute Studio!</li>
</ul>
{% if current_plan.name != 'pro'%}
<div class="text-center">
<button type="button" class="btn btn-primary text-center" data-toggle="modal" data-target="#proModal">
<strong>
{% if current_plan.name == "free" or current_plan.name == "plus" %}
Upgrade
{% else %}
Select
{% endif %}
</strong>
</a>
</div>
{% endif %}
</div>
<div class="card-footer border-top-0 background-color-inherit">
{% if plan_duration == "monthly" %}
<h2 class="text-center">$9</h2>
<h4 class="text-center">Per month</h4>
<small class="text-center text-muted">Save $9 by getting 1 month free with <a
href="/billing/upgrade/yearly/">annual pre-pay.</a></small>
{% else %}
<h2 class="text-center">$99</h2>
<h4 class="text-center">Per year</h4>
{% endif %}
</div>
</div>
</div>
</div>
<div class="modal fade" id="freeModal" tabindex="-1" role="dialog" aria-labelledby="freeModalLabel"
aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="freeModalLabel">Downgrade to Free Plan</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<p class="lead">This plan is free.</p>
<p>Your Pro account will expire at the end of this billing cycle and not renew.</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
<a href="/billing/upgrade/{{plan_duration}}/?upgrade_plan=free" class="btn btn-primary">Downgrade</a>
</div>
</div>
</div>
</div>
<div class="modal fade" id="proModal" tabindex="-1" role="dialog" aria-labelledby="proModalLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="proModalLabel">Upgrade to Pro</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
{% if plan_duration == "monthly" %}
<p class="lead">You will be charged $9 per month.</p>
{% else %}
<p class="lead">You will be charged $99 per year.</p>
{% endif %}
{% if not has_payment_method %}
<p><a href="{% url 'update_payment' %}?next=/billing/upgrade/{{plan_duration}}/?selected_plan=pro">Add
payment
method</a></p>
{% else %}
<p>Payment method:</p>
<p><i class="far fa-credit-card mr-1"></i><strong>{{card_info.brand}}</strong> ending **** **** ****
{{card_info.last4}}</p>
<p>Expires: {{card_info.exp_month}}/{{card_info.exp_year}}</p>
<p><a href="{% url 'update_payment' %}?next=/billing/upgrade/{{plan_duration}}/?selected_plan=pro">Update
payment method</a></p>
{% endif %}
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
{% if not has_payment_method %}
<a href="{% url 'update_payment' %}?next=/billing/upgrade/{{plan_duration}}/?selected_plan=pro"
class="btn btn-primary">Add payment method</a>
{% else %}
<a href="/billing/upgrade/{{plan_duration}}/?upgrade_plan=pro" class="btn btn-primary">Buy
now</a>
{% endif %}
</div>
</div>
</div>
</div>
</div>
{% endblock %}
{% block bottom_scripts %}
<script>
var searchParams = (new URL(document.location)).searchParams;
if (searchParams.get("selected_plan") === "pro") {
$(document).ready(function () {
$("#proModal").modal("show");
});
}
</script>
{% endblock %}