Skip to content

Commit 8c4f582

Browse files
committed
creating structure to make easy to create landing pages. Creates also CarreiraPro landing page. close #2420
1 parent 3e0e6e0 commit 8c4f582

File tree

15 files changed

+420
-6
lines changed

15 files changed

+420
-6
lines changed

Pipfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ django-bootstrap4 = "*"
3131
celery = "*"
3232
redis = "*"
3333
django-pagarme = "*"
34+
inflection = "*"
3435

3536
[dev-packages]
3637
faker = "*"

Pipfile.lock

Lines changed: 15 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pythonpro/pages/__init__.py

Whitespace-only changes.

pythonpro/pages/apps.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
from django.apps import AppConfig
2+
3+
4+
class PagesConfig(AppConfig):
5+
name = 'pages'

pythonpro/pages/forms.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
from django import forms
2+
3+
4+
class NameEmailForm(forms.Form):
5+
name = forms.CharField(label='', widget=forms.TextInput(attrs={'placeholder': 'Insira seu Nome'}))
6+
email = forms.EmailField(label='', widget=forms.TextInput(attrs={'placeholder': 'Insira seu Email'}))
Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
{% extends 'core/base_without_nav.html' %}
2+
{% load static %}
3+
4+
{% block body %}
5+
{% block content %}{% endblock %}
6+
7+
{% block professor %}
8+
<div class='bg-secondary block-professor mt-5'>
9+
<div class="container">
10+
<div class="row">
11+
<div class="col">
12+
13+
<img class="img-renzo float-right" src="{% static 'img/spp/renzo/about-renzo-nuccitelli-desktop.png' %}" alt="Renzo Nuccitelli com braços cruzados, olhando para foto. Fundo verde abacate com códigos escritos em branco. Imagem grande">
14+
<h2 class='mt-5 mb-5 font-weight-bold'><u>CONHEÇA SEU PROFESSOR!</u></h2>
15+
16+
<p>
17+
Olá! Eu me chamo <b>Renzo Nuccitelli</b>. Muito prazer!
18+
</p>
19+
<p>
20+
Sou programador há 13 anos, palestrante, consultor,
21+
diretor de tecnologia e, principalmente, professor.
22+
</p>
23+
<p>
24+
Meu sonho sempre foi que as pessoas pudessem construir as mesmas oportunidades que construí...
25+
</p>
26+
27+
<p>
28+
Sou Engenheiro de Computação formado pelo ITA. Especialista em programação web.
29+
</p>
30+
31+
<p>
32+
Fui Diretor de Tecnologia na startup de educação QMagico e Pricez. Por lá, estruturei os times de tecnologia e todo o processo de desenvolvimento.
33+
</p>
34+
35+
<p>
36+
Sou apaixonado por dar aula! Fui professor da Fatec durante 4 anos, ministrando as matérias de "Orientação a Objetos", "Aplicações para Internet", "Estrutura de Dados" e "Javascript".
37+
</p>
38+
39+
<p>
40+
Já palestrei em eventos como Pycon US, Google Developer Bus, DevFest, Rupy e Python Brasil.
41+
</p>
42+
43+
<p>
44+
Também sou especialista em teste automáticos. Fui Engenheiro de Qualidade Sênior na Red Hat durante 2 anos.
45+
</p>
46+
47+
</div>
48+
</div>
49+
</div>
50+
</div>
51+
{% endblock professor %}
52+
{% endblock %}
53+
54+
{% block styles %}
55+
{{ block.super }}
56+
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
57+
58+
<style>
59+
@font-face {
60+
font-family: 'Gilroy-Bold';
61+
font-style: normal;
62+
font-weight: normal;
63+
src: local('Gilroy-Bold ☞'), url('{% static "fonts/Gilroy-Bold.woff" %}') format('woff');
64+
}
65+
66+
@font-face {
67+
font-family: 'Gilroy-Heavy';
68+
font-style: normal;
69+
font-weight: normal;
70+
src: local('Gilroy-Heavy ☞'), url('{% static "fonts/Gilroy-Heavy.woff" %}') format('woff');
71+
}
72+
73+
@font-face {
74+
font-family: 'Gilroy-Light';
75+
font-style: normal;
76+
font-weight: normal;
77+
src: local('Gilroy-Light ☞'), url('{% static "fonts/Gilroy-Light.woff" %}') format('woff');
78+
}
79+
80+
@font-face {
81+
font-family: 'Gilroy-Medium';
82+
font-style: normal;
83+
font-weight: normal;
84+
src: local('Gilroy-Medium ☞'), url('{% static "fonts/Gilroy-Medium.woff" %}') format('woff');
85+
}
86+
87+
@font-face {
88+
font-family: 'Gilroy-Regular';
89+
font-style: normal;
90+
font-weight: normal;
91+
src: local('Gilroy-Regular ☞'), url('{% static "fonts/Gilroy-Regular.woff" %}') format('woff');
92+
}
93+
94+
.bg-secondary.block-professor {
95+
margin-top: 80px !important;
96+
background-color: #A9CD5D !important;
97+
}
98+
.img-renzo {
99+
max-width: 400px;
100+
margin-top: -80px;
101+
margin-bottom: -100px;
102+
}
103+
.container {
104+
max-width: 960px;
105+
}
106+
</style>
107+
108+
<link rel="stylesheet" href="{% static 'css/client.css' %}"/>
109+
{% endblock styles %}
Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
{% extends 'pages/base.html' %}
2+
{% load bootstrap4 %}
3+
{% load static %}
4+
5+
{% block title %}Carreira PRO! Inscreva-se Grátis!{% endblock %}
6+
{% block description %}{% endblock %}
7+
8+
{% block content %}
9+
<div class='bg-primary'>
10+
<div class="container">
11+
<div class="row text-center">
12+
<div class="col hero">
13+
<h1 class='font-weight-bold text-light mb-4'>
14+
<u>APRENDA COMO PASSAR NAS VAGAS QUE PAGAM OS MELHORES SALÁRIOS!</u>
15+
</h1>
16+
17+
<h4 class='text-light'>
18+
<b>Workshop Online e Gratuito.</b>
19+
<br>Dia 02/06 às 20h
20+
</h4>
21+
</div>
22+
</div>
23+
24+
<div class="row">
25+
<div class='offset-md-2 col-md-8 col-sm-12'>
26+
27+
<span class='text-light font-weight-bold' style='font-size: 16pt'>Preencha o formulário:</span>
28+
<form method="POST" class='mb-5 text-center'>
29+
{% csrf_token %}
30+
{% bootstrap_form form %}
31+
32+
<button type='submit' class='btn btn-warning text-center cta'>
33+
<b>CONFIRMAR MINHA INSCRIÇÃO!</b>
34+
</button>
35+
</form>
36+
</div>
37+
</div>
38+
</div>
39+
</div>
40+
41+
<div class='mt-5'>
42+
<div class="container">
43+
<div class="row">
44+
<div class="col">
45+
<h2 class='font-weight-bold text-center mb-5'>
46+
DESCUBRA O QUE FAZER PARA PASSAR NOS PROCESSOS SELETIVOS <u>MAIS CONCORRIDOS
47+
DO MERCADO...</u>
48+
</h2>
49+
50+
<p>
51+
Sabe aquelas vagas que pagam ótimos salários? Para conseguir passar em
52+
uma entrevista desse nível, não basta apenas saber programar.
53+
</p>
54+
55+
<p>
56+
Em um determinado momento do processo seletivo você vai precisar de um
57+
negócio chamado soft-skill.
58+
</p>
59+
60+
<p>
61+
Pra te ajudar, eu resolvi fazer um workshop online, 100% gratuito,
62+
onde eu vou te ensinar como se portar durante um processo seletivo e
63+
finalmente conseguir o seu emprego dos sonhos como programador!
64+
</p>
65+
66+
<p>
67+
O workshop vai acontecer no dia 02/06, a partir das 20h.
68+
</p>
69+
</div>
70+
71+
</div>
72+
</div>
73+
</div>
74+
75+
<script type="application/javascript">
76+
77+
let phoneInput = document.getElementById('id_phone');
78+
phoneInput.addEventListener('input', function (e) {
79+
var x = e.target.value.replace(/\D/g, '').match(/(\d{0,2})(\d{0,5})(\d{0,4})/);
80+
e.target.value = !x[2] ? x[1] : '(' + x[1] + ') ' + x[2] + (x[3] ? '-' + x[3] : '');
81+
});
82+
83+
let submitButton = document.getElementById('submit_button');
84+
document.getElementById('contact_form').addEventListener('input', function (e) {
85+
if (phoneInput.value.search(/\(\d\d\) \d\d\d\d\d-\d\d\d\d/) === 0) {
86+
submitButton.removeAttribute('disabled');
87+
} else {
88+
submitButton.setAttribute('disabled', 'disabled');
89+
}
90+
});
91+
</script>
92+
{% endblock content %}
93+
94+
{% block footer %}
95+
<div class=''>
96+
<div class="container">
97+
<div class="row">
98+
<div class="col mt-5 mb-5 text-center">
99+
<i>
100+
{% now "Y" %} Python Pro. Todos os direitos reservados. <br>
101+
CNPJ: 31.080.715/0001-25<br>
102+
+55 84 99419-4414 - {{ DEFAULT_FROM_EMAIL }}
103+
</i>
104+
105+
</div>
106+
</div>
107+
</div>
108+
</div>
109+
110+
{% endblock %}
111+
112+
{% block styles %}
113+
{{ block.super }}
114+
<style>
115+
116+
117+
</style>
118+
119+
{% endblock %}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{% extends 'pages/base.html' %}
2+
3+
{% block title %}Insrição Realizada!{% endblock %}
4+
{% block description %}{% endblock %}
5+
6+
{% block content %}
7+
<div class='bg-primary'>
8+
<div class="container">
9+
<div class="row text-center">
10+
<div class="col hero">
11+
<h1 class='font-weight-bold text-light mb-4'>
12+
INSCRIÇÃO REALIZADA COM SUCESSO!
13+
</h1>
14+
15+
<h4 class='text-light'>
16+
<b>Corra para o seu email!</b>
17+
<br>Eu mandei todas as instruções sobre o webinário por lá.
18+
</h4>
19+
20+
<h4 class='text-light mt-5'>
21+
Te vejo na aula!
22+
</h4>
23+
</div>
24+
</div>
25+
26+
<div class="row">
27+
<div class='offset-md-2 col-md-8 col-sm-12'>
28+
29+
</div>
30+
</div>
31+
</div>
32+
</div>
33+
{% endblock content %}
34+
35+
{% block professor %}{% endblock %}
36+
{% block footer %}{% endblock %}
37+

pythonpro/pages/tests/__init__.py

Whitespace-only changes.
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
import pytest
2+
3+
from django.urls import reverse
4+
5+
from pythonpro.django_assertions import dj_assert_contains
6+
7+
8+
def test_should_return_200_when_load_invite_page(client):
9+
resp = client.get(reverse('pages:carreirapro_landing_page'), secure=True)
10+
assert resp.status_code == 200
11+
12+
13+
def test_should_return_200_when_load_thank_you_page(client):
14+
resp = client.get(reverse('pages:carreirapro_thank_you_page'), secure=True)
15+
assert resp.status_code == 200
16+
17+
18+
@pytest.fixture
19+
def create_or_update_with_no_role(mocker):
20+
return mocker.patch('pythonpro.email_marketing.facade.create_or_update_with_no_role.delay')
21+
22+
23+
def test_should_run_form_ok(create_or_update_with_no_role, client):
24+
resp = client.post(
25+
reverse('pages:carreirapro_landing_page'),
26+
{'name': 'Moacir', 'email': 'moacir@python.pro.br'},
27+
secure=True
28+
)
29+
30+
assert resp.status_code == 302
31+
32+
33+
def test_should_inform_form_error(create_or_update_with_no_role, client):
34+
resp = client.post(
35+
reverse('pages:carreirapro_landing_page'),
36+
{'name': 'Moacir', 'email': 'moacirpython.pro.br'},
37+
secure=True
38+
)
39+
40+
assert resp.status_code == 200
41+
dj_assert_contains(resp, 'is-invalid')

0 commit comments

Comments
 (0)