Skip to content

Commit c26725e

Browse files
renzonrenzon
authored andcommitted
Embedded YouTube Teck Talks
close #445
1 parent 4a2a0e7 commit c26725e

5 files changed

Lines changed: 46 additions & 3 deletions

File tree

pythonpro/core/templates/core/base.html

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<script type="application/javascript" src="{% static 'js/bootstrap.bundle.min.js' %}"></script>
1212
<link href='//fonts.googleapis.com/css?family=Ubuntu:400,500' rel='stylesheet' type='text/css'/>
1313
</head>
14-
<body >
14+
<body>
1515
<nav class="navbar navbar-dark bg-dark navbar-expand-md">
1616
<a class="navbar-brand" href="/">Python Pro</a>
1717
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent"
@@ -63,8 +63,10 @@
6363
<a class="nav-link" href="{{ DISCOURSE_BASE_URL }}">Fórum</a>
6464
</li>
6565
{% endif %}
66+
<li class="nav-item">
67+
<a class="nav-link" href="{% url 'core:tech_talks' %}">Tech Talks</a>
68+
</li>
6669
</ul>
67-
6870
{% if user.is_authenticated %}
6971
<ul class="navbar-nav ">
7072
<li class="nav-item dropdown">
@@ -73,7 +75,6 @@
7375
aria-haspopup="true" aria-expanded="false">
7476
{{ user.first_name }}
7577
</a>
76-
7778
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="dropdownMenuButton">
7879
<a class="dropdown-item" href="{% url 'core:profile' %}">Perfil</a>
7980
<div class="dropdown-divider"></div>
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{% extends 'core/base.html' %}
2+
{% load static %}
3+
{% block body %}
4+
<div class="container mt-5">
5+
<div class="row">
6+
<div class="col">
7+
<h1 class="mb-3">Tech Talks Python Pro</h1>
8+
<p class="mb-0">Tech Talks são encontros períodicos em que tratamos temas trazidos pelos alunos. Abaixo você encontra toda a lista de vídeos já gravados.<br/>
9+
<a href="https://www.youtube.com/watch?v=bo3wH14JzQQ&index=1&list=PLA05yVJtRWYSQ0loqX4Er6wIwJ_sU8j3S" target="_blank">Inscreva-se no canal</a> para ser avisado dos novos vídeos e lives!
10+
</p>
11+
<div class="embed-container mt-3 border rounded">
12+
<iframe src="https://www.youtube.com/embed/videoseries?list=PLA05yVJtRWYSQ0loqX4Er6wIwJ_sU8j3S" width="640" height="360"
13+
frameborder="0"
14+
webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>
15+
</div>
16+
</div>
17+
</div>
18+
</div>
19+
{% endblock body %}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import pytest
2+
from django.urls import reverse
3+
4+
from pythonpro.django_assertions import dj_assert_contains
5+
6+
7+
@pytest.fixture
8+
def resp(client):
9+
return client.get(reverse('core:tech_talks'), secure=True)
10+
11+
12+
def test_status_code(resp):
13+
assert 200 == resp.status_code
14+
15+
16+
def test_link_on_home(client):
17+
resp = client.get('/', secure=True)
18+
dj_assert_contains(resp, reverse('core:tech_talks'))

pythonpro/core/urls.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
app_name = 'core'
66
urlpatterns = [
77
path('', views.index, name='index'),
8+
path('tech-talks', views.teck_talks, name='tech_talks'),
89
path('obrigado', views.thanks, name='thanks'),
910
path('perfil', views.profile, name='profile'),
1011
path('perfil/nome', views.profile_name, name='profile_name'),

pythonpro/core/views.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ def thanks(request):
1616
return render(request, 'core/lead_thanks.html', {})
1717

1818

19+
def teck_talks(request):
20+
return render(request, 'core/tech_talks.html', {})
21+
22+
1923
@login_required
2024
def profile(request):
2125
return render(request, 'core/profile_detail.html', {})

0 commit comments

Comments
 (0)