mirror of https://github.com/zulip/zulip.git
parent
fe1a40279c
commit
482b5d8871
|
@ -539,6 +539,7 @@ class UpgradePageContext(TypedDict):
|
|||
email: str
|
||||
exempt_from_license_number_check: bool
|
||||
free_trial_days: Optional[int]
|
||||
free_trial_end_date: Optional[str]
|
||||
is_demo_organization: bool
|
||||
manual_license_management: bool
|
||||
min_invoiced_licenses: int
|
||||
|
@ -1315,13 +1316,23 @@ class BillingSession(ABC):
|
|||
seat_count = self.current_count_for_billed_licenses()
|
||||
signed_seat_count, salt = sign_string(str(seat_count))
|
||||
tier = initial_upgrade_request.tier
|
||||
|
||||
free_trial_days = settings.FREE_TRIAL_DAYS
|
||||
free_trial_end_date = None
|
||||
if free_trial_days is not None:
|
||||
_, _, free_trial_end, _ = compute_plan_parameters(
|
||||
CustomerPlan.STANDARD, False, CustomerPlan.ANNUAL, None, True
|
||||
)
|
||||
free_trial_end_date = f"{free_trial_end:%B} {free_trial_end.day}, {free_trial_end.year}"
|
||||
|
||||
context: UpgradePageContext = {
|
||||
"customer_name": customer_specific_context["customer_name"],
|
||||
"default_invoice_days_until_due": DEFAULT_INVOICE_DAYS_UNTIL_DUE,
|
||||
"discount_percent": format_discount_percentage(percent_off),
|
||||
"email": customer_specific_context["email"],
|
||||
"exempt_from_license_number_check": exempt_from_license_number_check,
|
||||
"free_trial_days": settings.FREE_TRIAL_DAYS,
|
||||
"free_trial_days": free_trial_days,
|
||||
"free_trial_end_date": free_trial_end_date,
|
||||
"is_demo_organization": customer_specific_context["is_demo_organization"],
|
||||
"manual_license_management": initial_upgrade_request.manual_license_management,
|
||||
"min_invoiced_licenses": max(seat_count, MIN_INVOICED_LICENSES),
|
||||
|
|
|
@ -1031,7 +1031,7 @@ class StripeTest(StripeTestCase):
|
|||
free_trial_end_date = self.now + timedelta(days=60)
|
||||
|
||||
self.assert_in_success_response(
|
||||
["You won't be charged", "Free Trial", "60 day"], response
|
||||
["You won't be charged", "Free Trial", "60-day"], response
|
||||
)
|
||||
self.assertNotEqual(user.realm.plan_type, Realm.PLAN_TYPE_STANDARD)
|
||||
self.assertFalse(Customer.objects.filter(realm=user.realm).exists())
|
||||
|
@ -1249,7 +1249,7 @@ class StripeTest(StripeTestCase):
|
|||
response = self.client_get("/upgrade/")
|
||||
|
||||
self.assert_in_success_response(
|
||||
["You won't be charged", "Free Trial", "60 day"], response
|
||||
["You won't be charged", "Free Trial", "60-day"], response
|
||||
)
|
||||
self.assertNotEqual(user.realm.plan_type, Realm.PLAN_TYPE_STANDARD)
|
||||
self.assertFalse(Customer.objects.filter(realm=user.realm).exists())
|
||||
|
|
|
@ -9,11 +9,11 @@
|
|||
<div id="upgrade-page" class="register-account flex full-page">
|
||||
<div class="center-block new-style">
|
||||
<div class="pitch">
|
||||
<h1>Upgrade {{ customer_name }} to
|
||||
<h1>
|
||||
{% if free_trial_days %}
|
||||
Zulip Cloud Standard free trial
|
||||
Start free trial of Zulip Cloud Standard
|
||||
{% else %}
|
||||
{{ plan }}
|
||||
Upgrade {{ customer_name }} to {{ plan }}
|
||||
{% endif %}
|
||||
</h1>
|
||||
</div>
|
||||
|
@ -28,11 +28,9 @@
|
|||
|
||||
<div id="free-trial-top-banner" class="input-box upgrade-page-field">
|
||||
{% if free_trial_days %}
|
||||
<div id="free-trial-alert-message" class="alert alert-info">
|
||||
Upgrade now to start your {{ free_trial_days }} day free trial
|
||||
of Zulip Cloud Standard!
|
||||
</div>
|
||||
<div class="not-editable-realm-field">
|
||||
Start your {{ free_trial_days }}-day free trial, with no upfront payment.
|
||||
<br /><br />
|
||||
You won't be charged during the free trial. You can also downgrade to
|
||||
Zulip Cloud Free, our forever free plan, at any time.
|
||||
</div>
|
||||
|
@ -71,7 +69,7 @@
|
|||
<div class="input-box upgrade-page-field no-validation">
|
||||
<label for="due-today" class="inline-block label-title">Due
|
||||
{% if free_trial_days %}
|
||||
after free trial
|
||||
on {{ free_trial_end_date }}
|
||||
{% else %}
|
||||
today
|
||||
{% endif %}
|
||||
|
@ -160,7 +158,7 @@
|
|||
<button id="org-upgrade-button{% if is_demo_organization %} permanent-disabled{% endif %}" {% if not payment_method %}disabled{% endif %}>
|
||||
<span id="org-upgrade-button-text">
|
||||
{% if free_trial_days %}
|
||||
Start {{ free_trial_days }} day free trial
|
||||
Start {{ free_trial_days }}-day free trial
|
||||
{% else %}
|
||||
Purchase Zulip Cloud Standard
|
||||
{% endif %}
|
||||
|
|
|
@ -561,6 +561,10 @@ input[name="licenses"] {
|
|||
}
|
||||
}
|
||||
|
||||
#upgrade-page-details #free-trial-top-banner {
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
#billing-page-details .billing-frequency-message.not-editable-realm-field,
|
||||
#free-trial-top-banner .not-editable-realm-field,
|
||||
#upgrade-page-details .license-management-section .not-editable-realm-field {
|
||||
|
|
Loading…
Reference in New Issue