From 4536c27f5f75188efb32b27aa79c6b53f372c0e9 Mon Sep 17 00:00:00 2001 From: Zambom Date: Thu, 19 Jan 2017 02:24:22 -0200 Subject: [PATCH] Adding category breadcrumb go back (only in subject view for now) --- subjects/templates/subjects/list.html | 14 ++++++++++++++ subjects/templates/subjects/view.html | 2 +- subjects/urls.py | 1 + subjects/utils.py | 11 +++++++++++ subjects/views.py | 44 ++++++++++++++++++++++++++++++++++++++++---- 5 files changed, 67 insertions(+), 5 deletions(-) diff --git a/subjects/templates/subjects/list.html b/subjects/templates/subjects/list.html index 5c40a13..fbca9be 100644 --- a/subjects/templates/subjects/list.html +++ b/subjects/templates/subjects/list.html @@ -90,6 +90,7 @@
+ {% if category.coordinators.all|length > 0 %}

{% trans "Coordinator(s) " %}: {{ category.coordinators.all|join:', ' }} @@ -193,4 +194,17 @@ + {% endblock %} diff --git a/subjects/templates/subjects/view.html b/subjects/templates/subjects/view.html index c276275..b9ed8f9 100644 --- a/subjects/templates/subjects/view.html +++ b/subjects/templates/subjects/view.html @@ -9,7 +9,7 @@ {% block breadcrumbs %} {{ block.super }} - {% breadcrumb subject.category 'subjects:index' %} + {% breadcrumb subject.category 'subjects:cat_view' subject.category.slug %} {% breadcrumb subject 'subjects:view' subject.slug %} {% endblock %} diff --git a/subjects/urls.py b/subjects/urls.py index de71e12..536cda8 100644 --- a/subjects/urls.py +++ b/subjects/urls.py @@ -4,6 +4,7 @@ from . import views urlpatterns = [ url(r'^home/$', views.HomeView.as_view(), name='home'), url(r'^$', views.IndexView.as_view(), name='index'), + url(r'^category/(?P[\w_-]+)/$', views.IndexView.as_view(), name='cat_view'), url(r'^(?P