Skip to content

Commit 95a4ebc

Browse files
renzonrenzon
authored andcommitted
Implemented sections skeleton
related to #45
1 parent 747e9fb commit 95a4ebc

12 files changed

Lines changed: 85 additions & 4 deletions

File tree

pythonpro/modules/templates/modules/module_detail.html

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,13 @@
88
<div class="row">
99
<div class="col">
1010
<h1 class="mt-4 mb-3">{{ module.title }}</h1>
11-
<dd>
1211
<dt>Pré-requisitos</dt>
1312
<dd>
1413
<ul>
1514
{% for req_module in module.pre_requirements %}
1615
<li>
1716
<a href="{{ module.get_absolut_url }}">{{ req_module.title }}</a>
1817
</li>
19-
2018
{% empty %}
2119
<li>Nenhum pré-requisito.</li>
2220
{% endfor %}
@@ -40,7 +38,21 @@ <h1 class="mt-4 mb-3">{{ module.title }}</h1>
4038
<li>{{ module.description }}</li>
4139
</ul>
4240
</dd>
43-
</dl>
41+
<dt>Conteúdo</dt>
42+
<dd>
43+
<ol>
44+
<li><a href="#">Paradima Procedural</a>
45+
<ol>
46+
<li><a href="#"> Introdução</a></li>
47+
<li><a href="#"> Instalação e Edição</a></li>
48+
<li><a href="#"> Tipos Embutidos</a></li>
49+
<li><a href="#"> Containers</a></li>
50+
</ol>
51+
</li>
52+
<li><a href="#">Orientação a Objetos</a>
53+
</li>
54+
</ol>
55+
</dd>
4456
</div>
4557
</div>
4658
</div>

pythonpro/sections/__init__.py

Whitespace-only changes.

pythonpro/sections/admin.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from django.contrib import admin
2+
3+
# Register your models here.

pythonpro/sections/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 SectionsConfig(AppConfig):
5+
name = 'pythonpro.sections'

pythonpro/sections/migrations/__init__.py

Whitespace-only changes.

pythonpro/sections/models.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from django.db import models
2+
3+
# Create your models here.
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{% extends 'core/base.html' %}
2+
{% load static %}
3+
4+
{% block title %}{{ section.title }}{% endblock %}
5+
6+
{% block body %}
7+
<div class="container">
8+
<div class="row">
9+
<div class="col">
10+
<h1 class="mt-4 mb-3">{{ section.title }}</h1>
11+
<dt>Descrição</dt>
12+
<dd>
13+
<ul>
14+
<li>{{ section.description }}</li>
15+
</ul>
16+
</dd>
17+
<dt>Capítulos</dt>
18+
<dd>
19+
<ol>
20+
<li><a href="#"> Introdução</a></li>
21+
<li><a href="#"> Instalação e Edição</a></li>
22+
<li><a href="#"> Tipos Embutidos</a></li>
23+
<li><a href="#"> Containers</a></li>
24+
</ol>
25+
</dd>
26+
</div>
27+
</div>
28+
</div>
29+
{% endblock body %}

pythonpro/sections/tests.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import pytest
2+
from django.urls import reverse
3+
from model_mommy import mommy
4+
5+
6+
@pytest.fixture
7+
def resp(client, django_user_model):
8+
user = mommy.make(django_user_model)
9+
client.force_login(user)
10+
return client.get(reverse('sections:detail', kwargs={'slug': 'procedural'}))
11+
12+
13+
def test_status_code(resp):
14+
assert resp.status_code == 200

pythonpro/sections/urls.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
from django.urls import path
2+
3+
from . import views
4+
5+
app_name = 'sections'
6+
urlpatterns = [
7+
path('<slug:slug>/', views.detail, name='detail'),
8+
]

pythonpro/sections/views.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
from django.shortcuts import render
2+
3+
4+
def detail(request, slug):
5+
return render(request, 'sections/section_detail.html')

0 commit comments

Comments
 (0)