Skip to content

Commit ce8a391

Browse files
moacirmodarenzon
authored andcommitted
creating states to identify launch phases and adapting the page behaviors
1 parent 007fcbd commit ce8a391

File tree

12 files changed

+290
-20
lines changed

12 files changed

+290
-20
lines changed
101 KB
Loading
320 KB
Loading
103 KB
Loading
322 KB
Loading
103 KB
Loading
326 KB
Loading

pythonpro/launch/templates/launch/cpl.html

Lines changed: 76 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -70,14 +70,27 @@
7070
font-size: 1.5rem;
7171
}
7272

73+
.hero {
74+
margin-bottom: 5px;
75+
}
76+
7377
.mobile.hero {
7478
margin: 20px 0;
79+
margin-bottom: 5px;
80+
}
81+
82+
.thumbs-aulas {
83+
margin: 20px;
7584
}
85+
86+
{% comment %} .thumbs-aulas img {
87+
margin: 0px 50px;
88+
} {% endcomment %}
7689

77-
.fb_iframe_widget_fluid_desktop, .fb_iframe_widget_fluid_desktop span, .fb_iframe_widget_fluid_desktop iframe {
78-
max-width: 100% !important;
79-
width: 100% !important;
90+
.video {
91+
margin: 5px;
8092
}
93+
8194

8295
</style>
8396
{% endblock head %}
@@ -91,30 +104,71 @@
91104
<h1 class='font-weight-bold' style='color: #44A5F1'>
92105
SEMANA DO PROGRAMADOR PROFISSIONAL
93106
</h1>
94-
<h2 class='col-md-8 offset-md-2'>
95-
{{ title }}
96-
</h2>
97107
</div>
98108

99109
<!-- mobile -->
100110
<div class="col-md-12 hero mobile d-block d-lg-none d-xl-none">
101111
<h1 class='font-weight-bold' style='color: #44A5F1'>
102112
SEMANA DO PROGRAMADOR PROFISSIONAL
103113
</h1>
104-
<h2 class='col-md-8 offset-md-2'>
105-
{{ title }}
106-
</h2>
107114
</div>
108115
</div>
116+
117+
<div class='row thumbs-aulas justify-content-center text-center'>
118+
119+
120+
<!-- AULA 1 -->
121+
<div class="col-4">
122+
{% if launch_status >= 1 %}
123+
<a href='{% url "launch:cpl1" %}' title='Assistir a Aula 1'>
124+
<img src='{% static 'img/launch/video1-available.png' %}' class="img-fluid"
125+
width="130px" alt="Aula 1 já está disponível!"/>
126+
</a>
127+
{% else %}
128+
<img src='{% static 'img/launch/video1-unavailable.png' %}' class="img-fluid"
129+
width="130px" alt="Aula 2 já está disponível!"/>
130+
{% endif %}
131+
</div>
132+
133+
<!-- AULA 2 -->
134+
<div class="col-4">
135+
{% if launch_status >= 2 %}
136+
<a href='{% url "launch:cpl1" %}' title='Assistir a Aula 2'>
137+
<img src='{% static 'img/launch/video2-available.png' %}' class="img-fluid"
138+
width="130px" alt="Aula 2 já está disponível!"/>
139+
</a>
140+
{% else %}
141+
<img src='{% static 'img/launch/video2-unavailable.png' %}' class="img-fluid"
142+
width="130px" alt="Aula 2 já está disponível!"/>
143+
{% endif %}
144+
</div>
145+
146+
<!-- AULA 3 -->
147+
<div class="col-4">
148+
{% if launch_status >= 3 %}
149+
<a href='{% url "launch:cpl1" %}' title='Assistir a Aula 3'>
150+
<img src='{% static 'img/launch/video3-available.png' %}' class="img-fluid"
151+
width="130px" alt="Aula 3 já está disponível!"/>
152+
</a>
153+
{% else %}
154+
<img src='{% static 'img/launch/video3-unavailable.png' %}' class="img-fluid"
155+
width="130px" alt="Aula 3 já está disponível!"/>
156+
{% endif %}
157+
</div>
158+
159+
</div>
109160
</div>
110161
</div>
111-
<div class='bg-primary pt-4 pb-4'>
162+
163+
164+
165+
<div class='bg-primary'>
112166
<div class="container">
113167
<div class="row justify-content-center text-center">
114-
<div class="col col-lg-8 offset-lg-2">
115-
<div style="max-width: 560px; max-height: 315px">
168+
<div class="col video" style="max-width: 800px">
169+
<div>
116170
<div class="embed-container">
117-
<iframe width="560" height="315" src="https://www.youtube.com/embed/{{ video_id }}"
171+
<iframe src="https://www.youtube.com/embed/{{ video_id }}?autoplay=0&showinfo=0&controls=0&modestbranding=1&autohide=1"
118172
frameborder="0"
119173
webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>
120174
<div id="fb-root"></div>
@@ -128,13 +182,20 @@ <h2 class='col-md-8 offset-md-2'>
128182
<div class="container">
129183
<div class="row text-center">
130184
<div class="col justify-content-center col-lg-8 offset-lg-2">
185+
<div class="mt-5 font-weight-bold">
186+
<h2>
187+
<span class="ec ec-arrow-down-small"></span>
188+
Deixe seu Comentário!
189+
<span class="ec ec-arrow-down-small"></span>
190+
</h2>
191+
</div>
192+
131193
<div class="mt-5">
132-
<a class='btn btn-lg btn-success font-weight-bold text-light mb-5'
194+
<a class='btn btn-lg btn-primary font-weight-bold text-light mb-5'
133195
href='https://t.me/ProgramadorProfissional' target='_blank'>
134196
<i class="fa fa-telegram" aria-hidden="true"></i> Entrar para o canal no Telegram!
135197
</a>
136198
</div>
137-
<h2>Deixe seu Comentário!</h2>
138199
<script async defer crossorigin="anonymous"
139200
src="https://connect.facebook.net/pt_BR/sdk.js#xfbml=1&version=v4.0&appId=828510970515986&autoLogAppEvents=1"></script>
140201
<div class="mb-5">

pythonpro/launch/tests/test_cpl1.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,12 @@ def tag_as_mock(mocker):
1111

1212

1313
@pytest.fixture
14-
def resp(client, tag_as_mock):
14+
def launch_status_as_mock(mocker):
15+
return mocker.patch('pythonpro.launch.views._get_launch_status', return_value=4)
16+
17+
18+
@pytest.fixture
19+
def resp(client, tag_as_mock, launch_status_as_mock):
1520
return client.get(reverse('launch:cpl1'), secure=True)
1621

1722

pythonpro/launch/tests/test_cpl2.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,12 @@ def tag_as_mock(mocker):
1010

1111

1212
@pytest.fixture
13-
def resp(client, tag_as_mock):
13+
def launch_status_as_mock(mocker):
14+
return mocker.patch('pythonpro.launch.views._get_launch_status', return_value=4)
15+
16+
17+
@pytest.fixture
18+
def resp(client, tag_as_mock, launch_status_as_mock):
1419
return client.get(reverse('launch:cpl2'), secure=True)
1520

1621

pythonpro/launch/tests/test_cpl3.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,12 @@ def tag_as_mock(mocker):
1010

1111

1212
@pytest.fixture
13-
def resp(client, tag_as_mock):
13+
def launch_status_as_mock(mocker):
14+
return mocker.patch('pythonpro.launch.views._get_launch_status', return_value=4)
15+
16+
17+
@pytest.fixture
18+
def resp(client, tag_as_mock, launch_status_as_mock):
1419
return client.get(reverse('launch:cpl3'), secure=True)
1520

1621

0 commit comments

Comments
 (0)