Skip to content

Commit e804948

Browse files
moacirmodarenzon
authored andcommitted
Implemented Django Webdev Langing Page
close #2405 Implemented Django Webdev Langing Page close #2405
1 parent 5ebbd9c commit e804948

10 files changed

Lines changed: 363 additions & 5 deletions

File tree

Lines changed: 322 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,322 @@
1+
{% extends 'core/base_without_nav.html' %}
2+
{% load bootstrap4 %}
3+
{% load static %}
4+
{% load django_pagarme %}
5+
6+
{% block title %}MATRÍCULA REALIZADA!{% endblock %}
7+
{% block description %}Curso de Python Grátis. Aprenda a programar de forma rápida, fácil e simples!{% endblock %}
8+
9+
{% block body %}
10+
{% block first_block %}
11+
<div class='bg-primary'>
12+
<div class="container">
13+
<div class="row text-center">
14+
<div class="col hero">
15+
16+
<div class='desktop d-none d-sm-block d-md-block'>
17+
<h1 class='font-weight-bold text-light'>Sua matrícula foi realizada!</h1>
18+
<p class='mb-5 text-light title-sub'>
19+
Assista o vídeo abaixo para saber como acessar os vídeos do Curso Grátis.
20+
</p>
21+
<iframe width="100%" height='523px' src="https://www.youtube.com/embed/0rzm6NjyoSw" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
22+
</div>
23+
24+
<div class='mobile d-block d-lg-none d-xl-none'>
25+
<h1 class='font-weight-bold text-light'>Sua matrícula foi realizada!</h1>
26+
<p class='mb-5 text-light title-sub'>
27+
Assista o vídeo abaixo para saber como acessar os vídeos do Curso Grátis.
28+
</p>
29+
<iframe width="100%" height='208px' src="https://www.youtube.com/embed/0rzm6NjyoSw" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
30+
</div>
31+
</div>
32+
33+
</div>
34+
</div>
35+
</div>
36+
{% endblock %}
37+
38+
{% block second_block %}
39+
<div>
40+
<div class="container">
41+
42+
<div class='desktop d-none d-sm-block d-md-block'>
43+
<div class="row">
44+
<div class="col mb-5 mt-5">
45+
<h2 class='text-center text-uppercase mb-5 '>
46+
Você já imaginou que bom seria se você estivesse preparado o suficiente para
47+
<b><u>empregos que pagam 5... 10... 15... até 20 mil reais por mês de salário?</u></b>
48+
</h2>
49+
50+
<h4 class='text-center'>
51+
A faculdade não te prepara para o mercado de trabalho...
52+
<b class='text-uppercase'>Mas, fique tranquilo, o <u>Curso Django Pro</u> vai te preparar!</b>
53+
</h4>
54+
</div>
55+
</div>
56+
57+
<div class="row text-center mb-3">
58+
<div class="col">
59+
<h1 class='price-parcelado'>
60+
<span class='parcela'>12x</span>
61+
<b>{{ payment_item_config.max_installment_amount_after_interest|cents_to_brl}}</b>
62+
</h1>
63+
<p class='price-a-vista'>(ou à vista com 15% de desconto, por {{ payment_item_config.price|cents_to_brl}})</p>
64+
</div>
65+
</div>
66+
67+
<div class="row text-center mb-5">
68+
<div class="col">
69+
<div class='text-center initiate-checkout d-none d-sm-block d-md-block'>
70+
<a href="#lead-form-header" class="cta-compra btn btn-warning initiate-checkout" data-toggle="modal" data-target="#modal-waiting-capture">
71+
EU QUERO SER UM <b class='initiate-checkout'>PROGRAMADOR PROFISSIONAL!</b>
72+
<br><span class='sub'>Clique aqui para fazer sua matrícula com acesso vitalício!</span>
73+
</a>
74+
</div>
75+
</div>
76+
</div>
77+
78+
<div class="row mt-5 mb-5 text-center">
79+
<div class="col">
80+
<img src='https://inglespdesesperados.com/wp-content/uploads/2018/06/garantia-de-15-dias-ou-seu-dinheiro-de-volta-300x261.png'>
81+
</div>
82+
83+
<div class="col">
84+
<img src='https://cdnstatic8.com/cursounipre.com.br/wp-content/uploads/2017/04/bannerpagpagarme.png'>
85+
</div>
86+
87+
</div>
88+
</div>
89+
90+
<div class='mobile d-block d-lg-none d-xl-none'>
91+
<div class="row">
92+
<div class="col mb-5 mt-5">
93+
<h2 class='text-center text-uppercase mb-5 '>
94+
Você já imaginou que bom seria se você estivesse preparado o suficiente para
95+
<b><u>empregos que pagam 5... 10... 15... até 20 mil reais por mês de salário?</u></b>
96+
</h2>
97+
98+
<h4 class='text-center'>
99+
A faculdade não te prepara para o mercado de trabalho...
100+
<b class='text-uppercase'>Mas, fique tranquilo, o <u>Cusro Django Pro</u> vai te preparar!</b>
101+
</h4>
102+
</div>
103+
</div>
104+
105+
<div class="row text-center mb-3">
106+
<div class="col">
107+
<h1 class='price-parcelado'>
108+
<span class='parcela'>12x</span>
109+
<b>R$ 49,70</b>
110+
</h1>
111+
<p class='price-a-vista'>(ou à vista com 15% de desconto, por R$ 497,00)</p>
112+
</div>
113+
</div>
114+
115+
<div class="row text-center mb-5">
116+
<div class="col">
117+
<div class='text-center initiate-checkout d-block d-lg-none d-xl-none'>
118+
<a href="#lead-form-header" class="cta-compra btn btn-warning initiate-checkout" data-toggle="modal" data-target="#modal-waiting-capture">
119+
SIM! EU QUERO SER UM <br><b class='initiate-checkout'>PROGRAMADOR PROFISSIONAL!</b>
120+
</a>
121+
</div>
122+
</div>
123+
</div>
124+
125+
<div class="row mt-5 mb-5 text-center">
126+
<div class="col">
127+
<img src='https://inglespdesesperados.com/wp-content/uploads/2018/06/garantia-de-15-dias-ou-seu-dinheiro-de-volta-300x261.png'>
128+
</div>
129+
130+
<div class="col">
131+
<img src='https://cdnstatic8.com/cursounipre.com.br/wp-content/uploads/2017/04/bannerpagpagarme.png'>
132+
</div>
133+
134+
</div>
135+
</div>
136+
</div>
137+
</div>
138+
139+
<div class="modal fade" id="modal-waiting-capture" tabindex="-1" role="dialog"
140+
aria-labelledby="exampleModalCenterTitle" aria-hidden="true">
141+
<div class="modal-dialog modal-dialog-centered" role="document">
142+
<div class="modal-content">
143+
<div class="modal-header">
144+
<h5 class="modal-title">Vamos lá!</h5>
145+
</div>
146+
<div class="modal-body">
147+
<p>
148+
Preencha os dados abaixo e em seguida clique no botão <i>Continuar</i> para que possamos reservar sua vaga.
149+
</p>
150+
151+
<form id="contact_form" action="{% url 'django_pagarme:contact_info' slug=payment_item_config.slug %}" method="post">
152+
{% csrf_token %}
153+
{% bootstrap_form contact_form %}
154+
<button id="submit_button" type="submit" disabled="disabled" class="btn float-right">Continuar →</button>
155+
</form>
156+
</div>
157+
</div>
158+
</div>
159+
</div>
160+
161+
<script type="application/javascript" src="{% static 'js/jquery-3.2.1.min.js' %}"></script>
162+
<script type="application/javascript" src="{% static 'js/bootstrap.bundle.min.js' %}"></script>
163+
<script type="application/javascript">
164+
165+
166+
167+
let phoneInput = document.getElementById('id_phone');
168+
phoneInput.addEventListener('input', function (e) {
169+
var x = e.target.value.replace(/\D/g, '').match(/(\d{0,2})(\d{0,5})(\d{0,4})/);
170+
e.target.value = !x[2] ? x[1] : '(' + x[1] + ') ' + x[2] + (x[3] ? '-' + x[3] : '');
171+
});
172+
173+
let submitButton = document.getElementById('submit_button');
174+
document.getElementById('contact_form').addEventListener('input', function (e) {
175+
if (phoneInput.value.search(/\(\d\d\) \d\d\d\d\d-\d\d\d\d/) === 0) {
176+
submitButton.removeAttribute('disabled');
177+
} else {
178+
submitButton.setAttribute('disabled', 'disabled');
179+
}
180+
});
181+
</script>
182+
183+
184+
{% endblock %}
185+
186+
{% block testimonials %}
187+
<div class='bg-secondary'>
188+
<div class="container">
189+
<div class="row">
190+
<div class="col mt-5 mb-5">
191+
<div class='social-proof'>
192+
{% include 'core/social_proof.html' %}
193+
</div>
194+
</div>
195+
</div>
196+
</div>
197+
</div>
198+
{% endblock %}
199+
{% endblock body %}
200+
201+
{% block footer %}
202+
<div class=''>
203+
<div class="container">
204+
<div class="row">
205+
<div class="col mt-5 mb-5 text-center">
206+
<i>
207+
{% now "Y" %} Python Pro. Todos os direitos reservados. <br>
208+
CNPJ: 31.080.715/0001-25<br>
209+
+55 84 99419-4414 - {{ DEFAULT_FROM_EMAIL }}
210+
</i>
211+
212+
</div>
213+
</div>
214+
</div>
215+
</div>
216+
217+
{% endblock %}
218+
219+
{% block styles %}
220+
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
221+
222+
<style>
223+
@font-face {
224+
font-family: 'Gilroy-Bold';
225+
font-style: normal;
226+
font-weight: normal;
227+
src: local('Gilroy-Bold ☞'), url('{% static "fonts/Gilroy-Bold.woff" %}') format('woff');
228+
}
229+
230+
@font-face {
231+
font-family: 'Gilroy-Heavy';
232+
font-style: normal;
233+
font-weight: normal;
234+
src: local('Gilroy-Heavy ☞'), url('{% static "fonts/Gilroy-Heavy.woff" %}') format('woff');
235+
}
236+
237+
@font-face {
238+
font-family: 'Gilroy-Light';
239+
font-style: normal;
240+
font-weight: normal;
241+
src: local('Gilroy-Light ☞'), url('{% static "fonts/Gilroy-Light.woff" %}') format('woff');
242+
}
243+
244+
@font-face {
245+
font-family: 'Gilroy-Medium';
246+
font-style: normal;
247+
font-weight: normal;
248+
src: local('Gilroy-Medium ☞'), url('{% static "fonts/Gilroy-Medium.woff" %}') format('woff');
249+
}
250+
251+
@font-face {
252+
font-family: 'Gilroy-Regular';
253+
font-style: normal;
254+
font-weight: normal;
255+
src: local('Gilroy-Regular ☞'), url('{% static "fonts/Gilroy-Regular.woff" %}') format('woff');
256+
}
257+
258+
.text-red {
259+
color: #AF1B3F !important;
260+
}
261+
262+
.container {
263+
max-width: 960px;
264+
}
265+
</style>
266+
267+
<link rel="stylesheet" href="{% static 'css/client.css' %}"/>
268+
269+
<style>
270+
271+
.desktop .title-sub {
272+
font-size: 1.5rem;
273+
}
274+
.desktop .price-parcelado {
275+
font-size: 60pt;
276+
}
277+
.desktop .price-parcelado .parcela {
278+
font-size: 30pt;
279+
margin-right: -10px;
280+
}
281+
.desktop .price-a-vista {
282+
margin-top: -15px;
283+
font-size: 12pt;
284+
}
285+
.desktop .cta-compra {
286+
line-height: 25px;
287+
padding: 20px 50px;
288+
font-size: 20pt;
289+
}
290+
.desktop .cta-compra .sub {
291+
font-size: 12pt;
292+
}
293+
294+
.mobile h1 {
295+
font-size: 1.5rem;
296+
}
297+
.mobile .title-sub {
298+
font-size: 1rem;
299+
margin: 0;
300+
}
301+
.mobile h2 {
302+
font-size: 1.5rem;
303+
}
304+
.mobile h4 {
305+
font-size: 1.2rem;
306+
}
307+
.mobile .price-parcelado {
308+
font-size: 50pt;
309+
}
310+
.mobile .price-parcelado .parcela {
311+
font-size: 14pt;
312+
}
313+
.mobile .price-a-vista {
314+
font-size: 10pt;
315+
}
316+
.mobile .cta-compra {
317+
padding: 20px 40px;
318+
font-size: 14pt;
319+
}
320+
</style>
321+
322+
{% endblock %}

‎pythonpro/checkout/tests/conftest.py‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,14 @@
66
# Workaround since module beginning with number can't be imported in regular way
77

88
migration_module = import_module('pythonpro.checkout.migrations.0001_payment_setup')
9+
webdev_migration_module = import_module('pythonpro.checkout.migrations.0002_webdev_setup')
910

1011

1112
@pytest.fixture(autouse=True)
1213
def execute_migration(db, pytestconfig):
1314
if pytestconfig.known_args_namespace.nomigrations:
1415
migration_module.setup_payment_configs_function(PagarmeFormConfig, PagarmeItemConfig)
16+
webdev_migration_module.setup_payment_configs_function(PagarmeFormConfig, PagarmeItemConfig)
1517

1618

1719
@pytest.fixture(autouse=True)
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, db):
8+
return client.get(reverse('webdev_landing_page'), secure=True)
9+
10+
11+
def test_should_page_exists(resp):
12+
assert resp.status_code == 200

‎pythonpro/checkout/urls.py‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
from django.urls import path
22

3-
from . import views
3+
from pythonpro.checkout import views
44

55
app_name = 'checkout'
66
urlpatterns = [
77
path('inscricao', views.membership_lp, name='membership_lp'),
88
path('lista-de-espera', views.waiting_list_ty, name='waiting_list_ty'),
9+
path('curso-desenvolvimento-web-django', views.webdev_landing_page, name='webdev_landing_page'),
910
]

‎pythonpro/checkout/views.py‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,3 +101,20 @@ def membership_lp(request):
101101

102102
def waiting_list_ty(request):
103103
return render(request, 'checkout/waiting_list_ty.html', {'email': request.user.email})
104+
105+
106+
def webdev_landing_page(request):
107+
no_discount_item_config = facade.find_payment_item_config('webdev')
108+
payment_item_config = facade.find_payment_item_config('webdev-oto')
109+
user = request.user
110+
if user.is_authenticated:
111+
data = {'name': user.first_name, 'email': user.email}
112+
form = facade.ContactForm(data)
113+
else:
114+
form = facade.ContactForm()
115+
116+
ctx = {
117+
'payment_item_config': payment_item_config,
118+
'contact_form': form,
119+
}
120+
return render(request, 'checkout/webdev_landing_page.html', ctx)

‎pythonpro/core/tests/test_lead_landing_page.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,5 +209,5 @@ def resp_lead_creation_with_no_offer(client, db, fake: Faker, create_lead_mock,
209209
)
210210

211211

212-
def test_should_not_redirect_to_any_offer(resp_lead_creation_with_no_offer):
213-
assert resp_lead_creation_with_no_offer['Location'] == reverse('core:thanks')
212+
def test_should_redirect_to_one_time_offer(resp_lead_creation):
213+
assert resp_lead_creation['Location'] == reverse('payments:webdev_landing_page')

0 commit comments

Comments
 (0)