Skip to content

Commit 52b7c86

Browse files
committed
changing youtube videos, extending promotion limit, implement new landing page
1 parent 9e7e519 commit 52b7c86

7 files changed

Lines changed: 81 additions & 16 deletions

File tree

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{% extends 'checkout/webdev_landing_page_oto.html' %}
2+
3+
{% block title %}MATRÍCULAS ABERTAS | Curso de Django com 50% de Desconto{% endblock %}
4+
{% block description %}
5+
Prepare-se para salários de até R$ 20 mil mensais!
6+
{% endblock %}
7+
8+
{% block hero %}
9+
<div class='desktop d-none d-sm-block d-md-block'>
10+
<h1 class='font-weight-bold text-light mb-5'>
11+
VOCÊ JÁ IMAGINOU QUE BOM SERIA SE VOCÊ ESTIVESSE PREPARADO PARA EMPREGOS QUE PAGAM
12+
<u>ATÉ 20 MIL REAIS POR MÊS DE SALÁRIO?</u>
13+
</h1>
14+
<iframe width="100%" height='523px' src="https://www.youtube.com/embed/L5YQSE9IE3o" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
15+
</div>
16+
17+
<div class='mobile d-block d-lg-none d-xl-none'>
18+
<h1 class='font-weight-bold text-light mb-5'>
19+
VOCÊ JÁ IMAGINOU QUE BOM SERIA SE VOCÊ ESTIVESSE PREPARADO PARA EMPREGOS QUE PAGAM
20+
<u>ATÉ 20 MIL REAIS POR MÊS DE SALÁRIO?</u>
21+
</h1>
22+
<iframe width="100%" height='208px' src="https://www.youtube.com/embed/L5YQSE9IE3o" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
23+
</div>
24+
{% endblock hero %}
25+
26+
{% block show_after %}{% endblock show_after %}

‎pythonpro/checkout/templates/checkout/webdev_landing_page_oto.html‎

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,25 +12,23 @@
1212
<div class='bg-primary'>
1313
<div class="container">
1414
<div class="row text-center">
15-
<div class="col hero">
16-
15+
<div class="col hero">{% block hero %}
1716
<div class='desktop d-none d-sm-block d-md-block'>
1817
<h1 class='font-weight-bold text-light'><u>SUA MATRÍCULA FOI REALIZADA!</u></h1>
1918
<p class='mb-5 text-light title-sub'>
2019
Assista o vídeo abaixo para saber como acessar os vídeos do curso grátis.
2120
</p>
22-
<iframe width="100%" height='523px' src="https://www.youtube.com/embed/I7ki8XTdkw4?autoplay=1" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
21+
<iframe width="100%" height='523px' src="https://www.youtube.com/embed/Fx8KxGIJOL4?autoplay=1" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
2322
</div>
2423

2524
<div class='mobile d-block d-lg-none d-xl-none'>
2625
<h1 class='font-weight-bold text-light'><u>SUA MATRÍCULA FOI REALIZADA!</u></h1>
2726
<p class='mb-5 text-light title-sub'>
2827
Assista o vídeo abaixo para saber como acessar os vídeos do curso grátis.
2928
</p>
30-
<iframe width="100%" height='208px' src="https://www.youtube.com/embed/I7ki8XTdkw4" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
29+
<iframe width="100%" height='208px' src="https://www.youtube.com/embed/Fx8KxGIJOL4" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
3130
</div>
32-
</div>
33-
31+
{% endblock hero %}</div>
3432
</div>
3533
</div>
3634
</div>
@@ -65,6 +63,7 @@ <h1 class='price-parcelado'>
6563
</div>
6664
</div>
6765

66+
{% if not is_promotion_expired %}
6867
<div class="row text-center mb-5">
6968
<div class="col">
7069
<div class='text-center initiate-checkout d-none d-sm-block d-md-block'>
@@ -75,14 +74,15 @@ <h1 class='price-parcelado'>
7574
</div>
7675
</div>
7776
</div>
77+
{% endif %}
7878

7979
<div class="row mt-5 mb-5 text-center">
8080
<div class="col">
81-
<img src='https://inglespdesesperados.com/wp-content/uploads/2018/06/garantia-de-15-dias-ou-seu-dinheiro-de-volta-300x261.png'>
81+
<img src='{% static "img/garantia.png" %}'>
8282
</div>
8383

8484
<div class="col">
85-
<img src='https://cdnstatic8.com/cursounipre.com.br/wp-content/uploads/2017/04/bannerpagpagarme.png'>
85+
<img src='{% static "img/banner-pagarme.png" %}'>
8686
</div>
8787

8888
</div>
@@ -113,6 +113,7 @@ <h1 class='price-parcelado'>
113113
</div>
114114
</div>
115115

116+
{% if not is_promotion_expired %}
116117
<div class="row text-center mb-5">
117118
<div class="col">
118119
<div class='text-center initiate-checkout d-block d-lg-none d-xl-none'>
@@ -122,14 +123,15 @@ <h1 class='price-parcelado'>
122123
</div>
123124
</div>
124125
</div>
126+
{% endif %}
125127

126128
<div class="row mt-5 mb-5 text-center">
127129
<div class="col">
128-
<img src='https://inglespdesesperados.com/wp-content/uploads/2018/06/garantia-de-15-dias-ou-seu-dinheiro-de-volta-300x261.png'>
130+
<img src='{% static "img/garantia.png" %}'>
129131
</div>
130132

131133
<div class="col">
132-
<img src='https://cdnstatic8.com/cursounipre.com.br/wp-content/uploads/2017/04/bannerpagpagarme.png'>
134+
<img src='{% static "img/banner-pagarme.png" %}'>
133135
</div>
134136

135137
</div>
@@ -167,13 +169,13 @@ <h2 class='font-weight-bold mb-5' style='font-size: 30pt'>
167169

168170
<div class='initiate-checkout d-none d-sm-block d-md-block mt-5 mb-5'>
169171
<a href='/pagamento/curso-de-python-intermediario' class="cta btn btn-warning initiate-checkout mt-10">
170-
<b>Comprar o PyTools pelo preço normal</b>
172+
<b>Comprar o Django Pro pelo preço normal</b>
171173
</a>
172174
</div>
173175

174176
<div class='initiate-checkout d-block d-lg-none d-xl-none mt-5 mb-5'>
175177
<a href='/pagamento/curso-de-python-intermediario' class="cta-mobile btn initiate-checkout btn-warning mt-10">
176-
<b>Comprar o PyTools pelo preço normal</b>
178+
<b>Comprar o Django Pro pelo preço normal</b>
177179
</a >
178180
</div>
179181
{% endif %}
@@ -232,7 +234,7 @@ <h5 class="modal-title">Vamos lá!</h5>
232234
all[i].style.display = "block";
233235
}
234236
}
235-
setTimeout("showIt()", {% if request.GET.debug %}1{% else %}90{% endif %} * 1000);
237+
setTimeout("showIt()", {% if request.GET.debug %}1{% else %}{{ seconds_to_show_full_page }}{% endif %} * 1000);
236238

237239
{% localtime on %}
238240
// Set the date we're counting down to
@@ -266,9 +268,12 @@ <h5 class="modal-title">Vamos lá!</h5>
266268
seconds = "0" + seconds
267269
}
268270

271+
days_in_hours = days * 24
272+
hours += days_in_hours
273+
269274
// Display the result in the element with id="demo"
270275
$(".countdown").html(hours + ":" + minutes + ":" + seconds);
271-
276+
272277
// If the count down is finished, write some text
273278
if (distance < 0) {
274279
clearInterval(x);
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import pytest
2+
3+
from django.urls import reverse
4+
5+
6+
@pytest.fixture
7+
def resp(client_with_lead, db):
8+
return client_with_lead.get(reverse('checkout:webdev_landing_page_50_off'), secure=True)
9+
10+
11+
def test_should_page_exists(resp):
12+
assert resp.status_code == 200

‎pythonpro/checkout/urls.py‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,8 @@
77
path('inscricao', views.membership_lp, name='membership_lp'),
88
path('lista-de-espera', views.waiting_list_ty, name='waiting_list_ty'),
99
path('curso-desenvolvimento-web-django', views.webdev_landing_page_oto, name='webdev_landing_page_oto'),
10+
path(
11+
'curso-desenvolvimento-web-django-50-off', views.webdev_landing_page_50_off, name='webdev_landing_page_50_off'
12+
),
1013
path('curso-de-django', views.webdev_landing_page, name='webdev_landing_page'),
1114
]

‎pythonpro/checkout/views.py‎

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
from django.urls import reverse
77
from django.utils.http import urlencode
88
from django_pagarme import facade
9+
from django.utils import timezone
910

1011
from pythonpro.checkout import facade as checkout_facade
1112
from pythonpro.checkout import forms as checkout_forms
@@ -107,6 +108,17 @@ def waiting_list_ty(request):
107108

108109
@login_required
109110
def webdev_landing_page_oto(request):
111+
template_name = 'checkout/webdev_landing_page_oto.html'
112+
return _webdev_landing_page_50_off(request, template_name)
113+
114+
115+
@login_required
116+
def webdev_landing_page_50_off(request):
117+
template_name = 'checkout/webdev_landing_page_50_off.html'
118+
return _webdev_landing_page_50_off(request, template_name, seconds_to_show_full_page=0)
119+
120+
121+
def _webdev_landing_page_50_off(request, template_name, seconds_to_show_full_page=90):
110122
payment_item_config = facade.find_payment_item_config('webdev-oto')
111123
user = request.user
112124
if user.is_authenticated:
@@ -115,12 +127,19 @@ def webdev_landing_page_oto(request):
115127
else:
116128
form = facade.ContactForm()
117129

130+
countdown_limit = request.user.date_joined + timedelta(days=5)
131+
is_promotion_expired = timezone.now() > countdown_limit
132+
if request.GET.get('debug') is not None:
133+
is_promotion_expired = False
134+
118135
ctx = {
119136
'payment_item_config': payment_item_config,
120137
'contact_form': form,
121-
'countdown_limit': request.user.date_joined + timedelta(seconds=30 * 60)
138+
'countdown_limit': countdown_limit,
139+
'is_promotion_expired': is_promotion_expired,
140+
'seconds_to_show_full_page': seconds_to_show_full_page
122141
}
123-
return render(request, 'checkout/webdev_landing_page_oto.html', ctx)
142+
return render(request, template_name, ctx)
124143

125144

126145
def webdev_landing_page(request):
8.9 KB
Loading
23.6 KB
Loading

0 commit comments

Comments
 (0)