Skip to content

Commit

Permalink
Criado app aperitivos para vídeos promocionais via vimeo
Browse files Browse the repository at this point in the history
close #62
  • Loading branch information
thiago-garcia committed Apr 6, 2024
1 parent 8983398 commit 10b9b0e
Show file tree
Hide file tree
Showing 9 changed files with 110 additions and 0 deletions.
Empty file added pypro/aperitivos/__init__.py
Empty file.
Empty file.
72 changes: 72 additions & 0 deletions pypro/aperitivos/templates/aperitivos/video.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
{% load static %}
<!DOCTYPE html>
<html lang="pt-br">

<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">

<title>Python Pro</title>

<meta name="description" content="Página do curso Python Pro">
<meta name="author" content="Thiago Garcia">
<link rel="icon" type="image/png" href="{% static 'img/favicon.png' %}" />

<link href="{% static 'css/bootstrap.min.css' %}" rel="stylesheet">
<link href="{% static 'css/style.css' %}" rel="stylesheet">
<script src="{% static 'js/jquery.min.js' %}"></script>
<script src="{% static 'js/bootstrap.min.js' %}"></script>
<script src="{% static 'js/scripts.js' %}"></script>

</head>

<body>
<nav class="navbar navbar-expand-lg navbar-dark bg-dark">
<a class="navbar-brand" href="{% url 'base:home' %}">Python Pro</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent"
aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>

<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav mr-auto">
</ul>
</div>
</nav>
<div class="container">
<div class="row">
<div class="col-md-12">
<h1 class="mt-4 mb-3">Vídeo Aperitivo: Motivação</h1>
<iframe src="https://player.vimeo.com/video/288344114?h=63fff44243&title=0&byline=0&portrait=0"
width="640" height="360" frameborder="0" allow="autoplay; fullscreen; picture-in-picture" allowfullscreen>
</iframe>
</div>
</div>
</div>
<footer class="main-footer mt-5 pt-4 text-light">
<div class="container">
<div class="row">
<div class="col">
<h3>Entre em contato</h3>
<address>
+55 00 12345-6789
<br />
<a href="mailto:[email protected]" class="text-light">[email protected]</a>
</address>
</div>
</div>
</div>
<div class="rights pb-4">
<div class="container">
<div class="row">
<div class="col">
{% now "Y" %} Python Pro. Todos os direitos reservados
</div>
</div>
</div>
</div>
</footer>
</body>

</html>
22 changes: 22 additions & 0 deletions pypro/aperitivos/tests.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
from django.urls import reverse
import pytest

from pypro.django_assertions import assert_contains


@pytest.fixture
def resp(client):
return client.get(reverse('aperitivos:video', args=('motivacao',)))


def test_status_code(resp):
assert resp.status_code == 200


def test_titulo_video(resp):
assert_contains(resp, '<h1 class="mt-4 mb-3">Vídeo Aperitivo: Motivação</h1>')


def test_conteudo_video(resp):
assert_contains(resp,
'<iframe src="https://player.vimeo.com/video/288344114?h=63fff44243&title=0&byline=0&portrait=0"')
8 changes: 8 additions & 0 deletions pypro/aperitivos/urls.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from django.urls import path

from pypro.aperitivos.views import video

app_name = 'aperitivos'
urlpatterns = [
path('<slug:slug>', video, name='video'),
]
5 changes: 5 additions & 0 deletions pypro/aperitivos/views.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from django.shortcuts import render


def video(request, slug):
return render(request, 'aperitivos/video.html')
1 change: 1 addition & 0 deletions pypro/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
'collectfast',
'django.contrib.staticfiles',
'pypro.base',
'pypro.aperitivos',
]

MIDDLEWARE = [
Expand Down
1 change: 1 addition & 0 deletions pypro/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
urlpatterns = [
path('admin/', admin.site.urls),
path('', include('pypro.base.urls')),
path('aperitivos/', include('pypro.aperitivos.urls')),
]


Expand Down
1 change: 1 addition & 0 deletions pytest.ini
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
[pytest]
DJANGO_SETTINGS_MODULE = pypro.settings
python_files = tests.py test_*.py *_tests.py

0 comments on commit 10b9b0e

Please sign in to comment.