Commit e2dcefc6b4ed4ac4452458ec1a1ec0178a2321ec

Authored by ailsoncgt
1 parent 1c8a523a

Forum breadcrumbs #356

courses/templates/topic/index.html
... ... @@ -13,7 +13,7 @@
13 13  
14 14 {% block breadcrumbs %}
15 15 {{ block.super }}
16   - {% breadcrumb topic.name 'course:view_topic' %}
  16 + {% breadcrumb topic.name 'course:view_topic' topic.slug %}
17 17 {% endblock %}
18 18  
19 19 {% block content %}
... ...
forum/templates/forum/forum_view.html
1   -{% extends 'home.html' %}
  1 +{% extends 'topic/index.html' %}
2 2  
3   -{% load static i18n permission_tags list_post %}
  3 +{% load static i18n permission_tags list_post django_bootstrap_breadcrumbs %}
4 4 {% load widget_tweaks %}
5 5  
6 6 {% block javascript %}
... ... @@ -8,17 +8,8 @@
8 8 {% endblock %}
9 9  
10 10 {% block breadcrumbs %}
11   -
12   - <ol class="breadcrumb">
13   - <li><a href="{% url 'app:index' %}">{% trans 'Home' %}</a></li>
14   - <li><a href="{% url 'course:view' forum.topic.subject.course.slug %}">{{ forum.topic.subject.course }}</a></li>
15   - {% if user|has_role:'professor' or user|has_role:'system_admin' %}
16   - <li class="active">{% trans 'Forum' %}</li>
17   - {% else %}
18   - <li class="active">{{ forum.name }}</li>
19   - {% endif %}
20   -
21   - </ol>
  11 + {{ block.super }}
  12 + {% breadcrumb forum 'course:forum:view' forum.slug %}
22 13 {% endblock %}
23 14  
24 15  
... ...
forum/views.py
... ... @@ -245,6 +245,9 @@ class ForumDetailView(LoginRequiredMixin, LogMixin, generic.DetailView):
245 245 context['form'] = PostForm()
246 246 context['forum'] = forum
247 247 context['title'] = forum.name
  248 + context['course'] = forum.topic.subject.course
  249 + context['subject'] = forum.topic.subject
  250 + context['topic'] = forum.topic
248 251  
249 252 return context
250 253  
... ...