Skip to content

Commit

Permalink
Consertado links do dropdown
Browse files Browse the repository at this point in the history
  • Loading branch information
thiago-garcia committed Apr 12, 2024
1 parent 9bb11c6 commit ec70e1e
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pypro/base/templates/base/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdown">
{% for modulo in MODULOS %}
<a class="dropdown-item" href="#">{{ modulo.titulo }}</a>
<a class="dropdown-item" href="{{ modulo.get_absolute_url }}">{{ modulo.titulo }}</a>
<div class="dropdown-divider"></div>
{% endfor %}
</div>
Expand Down
2 changes: 1 addition & 1 deletion pypro/base/tests/test_home.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@


@pytest.fixture
def resp(client):
def resp(client, db):
resp = client.get(reverse('base:home'))
return resp

Expand Down
2 changes: 1 addition & 1 deletion pypro/modulos/tests/test_facade.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ def modulos(db):


def test_listar_modulos_ordenados(modulos):
assert list(sorted(modulos, key=lambda modulo: modulo.titulo)) == facade.listar_modulos_ordenados()
assert list(sorted(modulos, key=lambda modulo: modulo.order)) == facade.listar_modulos_ordenados()
9 changes: 9 additions & 0 deletions pypro/modulos/urls.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
from django.urls import path

from pypro.modulos import views


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

# Create your views here.

def detalhe(request, slug):
pass
1 change: 1 addition & 0 deletions pypro/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
path('admin/', admin.site.urls),
path('', include('pypro.base.urls')),
path('aperitivos/', include('pypro.aperitivos.urls')),
path('modulos/', include('pypro.modulos.urls')),
]


Expand Down

0 comments on commit ec70e1e

Please sign in to comment.