Browse Source

Don't mention whatsapp in the pricing page if it's not enabled in settings.

pull/272/head
Pēteris Caune 5 years ago
parent
commit
e386ccaa0a
No known key found for this signature in database GPG Key ID: E28D7679E9A9EDE2
2 changed files with 8 additions and 3 deletions
  1. +6
    -1
      hc/payments/views.py
  2. +2
    -2
      templates/payments/pricing.html

+ 6
- 1
hc/payments/views.py View File

@ -1,5 +1,6 @@
from io import BytesIO from io import BytesIO
from django.conf import settings
from django.contrib import messages from django.contrib import messages
from django.contrib.auth.decorators import login_required from django.contrib.auth.decorators import login_required
from django.http import ( from django.http import (
@ -33,7 +34,11 @@ def pricing(request):
# subscription object is not created just by viewing a page. # subscription object is not created just by viewing a page.
sub = Subscription.objects.filter(user_id=request.user.id).first() sub = Subscription.objects.filter(user_id=request.user.id).first()
ctx = {"page": "pricing", "sub": sub}
ctx = {
"page": "pricing",
"sub": sub,
"enable_whatsapp": settings.TWILIO_USE_WHATSAPP,
}
return render(request, "payments/pricing.html", ctx) return render(request, "payments/pricing.html", ctx)


+ 2
- 2
templates/payments/pricing.html View File

@ -110,7 +110,7 @@
<li class="list-group-item">10 Team Members</li> <li class="list-group-item">10 Team Members</li>
<li class="list-group-item">1000 Log Entries per Check</li> <li class="list-group-item">1000 Log Entries per Check</li>
<li class="list-group-item">API Access</li> <li class="list-group-item">API Access</li>
<li class="list-group-item">50 SMS &amp; WhatsApp Alerts per Month</li>
<li class="list-group-item">50 SMS {% if enable_whatsapp %}&amp; WhatsApp{% endif %} Alerts per Month</li>
<li class="list-group-item">Email Support</li> <li class="list-group-item">Email Support</li>
</ul> </ul>
{% if not request.user.is_authenticated %} {% if not request.user.is_authenticated %}
@ -139,7 +139,7 @@
<li class="list-group-item">Unlimited Team Members</li> <li class="list-group-item">Unlimited Team Members</li>
<li class="list-group-item">1000 Log Entries per Check</li> <li class="list-group-item">1000 Log Entries per Check</li>
<li class="list-group-item">API Access</li> <li class="list-group-item">API Access</li>
<li class="list-group-item">500 SMS &amp; WhatsApp Alerts per Month</li>
<li class="list-group-item">500 SMS {% if enable_whatsapp %}&amp; WhatsApp{% endif %} Alerts per Month</li>
<li class="list-group-item">Priority Email Support</li> <li class="list-group-item">Priority Email Support</li>
</ul> </ul>
{% if not request.user.is_authenticated %} {% if not request.user.is_authenticated %}


Loading…
Cancel
Save